diff options
author | bunnei <ericbunnie@gmail.com> | 2014-04-27 18:40:31 +0200 |
---|---|---|
committer | bunnei <ericbunnie@gmail.com> | 2014-04-27 18:40:31 +0200 |
commit | b2a6ad52f4a059b66e2a0ea12813ce968fa04277 (patch) | |
tree | aff9bf7cdb3c4a620708f7c9911a0d7b1c126153 | |
parent | added code to LCD modules keep track of framebuffer location in FCRAM or VRAM (diff) | |
download | yuzu-b2a6ad52f4a059b66e2a0ea12813ce968fa04277.tar yuzu-b2a6ad52f4a059b66e2a0ea12813ce968fa04277.tar.gz yuzu-b2a6ad52f4a059b66e2a0ea12813ce968fa04277.tar.bz2 yuzu-b2a6ad52f4a059b66e2a0ea12813ce968fa04277.tar.lz yuzu-b2a6ad52f4a059b66e2a0ea12813ce968fa04277.tar.xz yuzu-b2a6ad52f4a059b66e2a0ea12813ce968fa04277.tar.zst yuzu-b2a6ad52f4a059b66e2a0ea12813ce968fa04277.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/mem_map.h | 14 | ||||
-rw-r--r-- | src/core/mem_map_funcs.cpp | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/core/mem_map.h b/src/core/mem_map.h index 1a49cc98d..c744e377e 100644 --- a/src/core/mem_map.h +++ b/src/core/mem_map.h @@ -53,7 +53,9 @@ enum { HARDWARE_IO_PADDR_END = (HARDWARE_IO_PADDR + HARDWARE_IO_SIZE), HARDWARE_IO_VADDR_END = (HARDWARE_IO_VADDR + HARDWARE_IO_SIZE), + VRAM_PADDR = 0x18000000, VRAM_VADDR = 0x1F000000, + VRAM_PADDR_END = (VRAM_PADDR + VRAM_SIZE), VRAM_VADDR_END = (VRAM_VADDR + VRAM_SIZE), SCRATCHPAD_VADDR_END = 0x10000000, @@ -141,4 +143,16 @@ inline const char* GetCharPointer(const u32 address) { return (const char *)GetPointer(address); } +inline const u32 VirtualAddressFromPhysical_FCRAM(const u32 address) { + return ((address & FCRAM_MASK) | FCRAM_VADDR); +} + +inline const u32 VirtualAddressFromPhysical_IO(const u32 address) { + return (address + 0x0EB00000); +} + +inline const u32 VirtualAddressFromPhysical_VRAM(const u32 address) { + return (address + 0x07000000); +} + } // namespace diff --git a/src/core/mem_map_funcs.cpp b/src/core/mem_map_funcs.cpp index d0bec31c6..c8daf0df5 100644 --- a/src/core/mem_map_funcs.cpp +++ b/src/core/mem_map_funcs.cpp @@ -22,7 +22,7 @@ u32 _AddressPhysicalToVirtual(const u32 addr) { // to virtual address translations here. This is obviously quite hacky... But we're not doing // any MMU emulation yet or anything if ((addr >= FCRAM_PADDR) && (addr < FCRAM_PADDR_END)) { - return (addr & FCRAM_MASK) | FCRAM_VADDR; + return VirtualAddressFromPhysical_FCRAM(addr); // Hardware IO // TODO(bunnei): FixMe |