diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-02-08 14:38:00 +0100 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-04-06 01:14:33 +0200 |
commit | 34b009cf38643dc8ac45a366d24208d36a2eb2f9 (patch) | |
tree | ffd88b43959d9a46a2f4155413dc893356fe66bc /src/core/mem_map_funcs.cpp | |
parent | Merge pull request #680 from archshift/bg-color (diff) | |
download | yuzu-34b009cf38643dc8ac45a366d24208d36a2eb2f9.tar yuzu-34b009cf38643dc8ac45a366d24208d36a2eb2f9.tar.gz yuzu-34b009cf38643dc8ac45a366d24208d36a2eb2f9.tar.bz2 yuzu-34b009cf38643dc8ac45a366d24208d36a2eb2f9.tar.lz yuzu-34b009cf38643dc8ac45a366d24208d36a2eb2f9.tar.xz yuzu-34b009cf38643dc8ac45a366d24208d36a2eb2f9.tar.zst yuzu-34b009cf38643dc8ac45a366d24208d36a2eb2f9.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/mem_map_funcs.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/core/mem_map_funcs.cpp b/src/core/mem_map_funcs.cpp index a161a8204..5878b99dc 100644 --- a/src/core/mem_map_funcs.cpp +++ b/src/core/mem_map_funcs.cpp @@ -23,10 +23,12 @@ VAddr PhysicalToVirtualAddress(const PAddr addr) { // to virtual address translations here. This is quite hacky, but necessary until we implement // proper MMU emulation. // TODO: Screw it, I'll let bunnei figure out how to do this properly. - if ((addr >= VRAM_PADDR) && (addr < VRAM_PADDR_END)) { + if (addr == 0) { + return 0; + } else if ((addr >= VRAM_PADDR) && (addr < VRAM_PADDR_END)) { return addr - VRAM_PADDR + VRAM_VADDR; - }else if ((addr >= FCRAM_PADDR) && (addr < FCRAM_PADDR_END)) { - return addr - FCRAM_PADDR + FCRAM_VADDR; + } else if ((addr >= FCRAM_PADDR) && (addr < FCRAM_PADDR_END)) { + return addr - FCRAM_PADDR + HEAP_LINEAR_VADDR; } LOG_ERROR(HW_Memory, "Unknown physical address @ 0x%08x", addr); @@ -39,10 +41,12 @@ PAddr VirtualToPhysicalAddress(const VAddr addr) { // to virtual address translations here. This is quite hacky, but necessary until we implement // proper MMU emulation. // TODO: Screw it, I'll let bunnei figure out how to do this properly. - if ((addr >= VRAM_VADDR) && (addr < VRAM_VADDR_END)) { - return addr - 0x07000000; - } else if ((addr >= FCRAM_VADDR) && (addr < FCRAM_VADDR_END)) { - return addr - FCRAM_VADDR + FCRAM_PADDR; + if (addr == 0) { + return 0; + } else if ((addr >= VRAM_VADDR) && (addr < VRAM_VADDR_END)) { + return addr - VRAM_VADDR + VRAM_PADDR; + } else if ((addr >= HEAP_LINEAR_VADDR) && (addr < HEAP_LINEAR_VADDR_END)) { + return addr - HEAP_LINEAR_VADDR + FCRAM_PADDR; } LOG_ERROR(HW_Memory, "Unknown virtual address @ 0x%08x", addr); |