summaryrefslogtreecommitdiff
path: root/src/core/mem_map_funcs.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2015-02-08 11:38:00 -0200
committerGravatar Yuri Kunde Schlesner2015-04-05 20:14:33 -0300
commit34b009cf38643dc8ac45a366d24208d36a2eb2f9 (patch)
treeffd88b43959d9a46a2f4155413dc893356fe66bc /src/core/mem_map_funcs.cpp
parentMerge pull request #680 from archshift/bg-color (diff)
downloadyuzu-34b009cf38643dc8ac45a366d24208d36a2eb2f9.tar.gz
yuzu-34b009cf38643dc8ac45a366d24208d36a2eb2f9.tar.xz
yuzu-34b009cf38643dc8ac45a366d24208d36a2eb2f9.zip
Clean-up mem_map constants and fix framebuffer translation errors
Diffstat (limited to 'src/core/mem_map_funcs.cpp')
-rw-r--r--src/core/mem_map_funcs.cpp18
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) {
23 // to virtual address translations here. This is quite hacky, but necessary until we implement 23 // to virtual address translations here. This is quite hacky, but necessary until we implement
24 // proper MMU emulation. 24 // proper MMU emulation.
25 // TODO: Screw it, I'll let bunnei figure out how to do this properly. 25 // TODO: Screw it, I'll let bunnei figure out how to do this properly.
26 if ((addr >= VRAM_PADDR) && (addr < VRAM_PADDR_END)) { 26 if (addr == 0) {
27 return 0;
28 } else if ((addr >= VRAM_PADDR) && (addr < VRAM_PADDR_END)) {
27 return addr - VRAM_PADDR + VRAM_VADDR; 29 return addr - VRAM_PADDR + VRAM_VADDR;
28 }else if ((addr >= FCRAM_PADDR) && (addr < FCRAM_PADDR_END)) { 30 } else if ((addr >= FCRAM_PADDR) && (addr < FCRAM_PADDR_END)) {
29 return addr - FCRAM_PADDR + FCRAM_VADDR; 31 return addr - FCRAM_PADDR + HEAP_LINEAR_VADDR;
30 } 32 }
31 33
32 LOG_ERROR(HW_Memory, "Unknown physical address @ 0x%08x", addr); 34 LOG_ERROR(HW_Memory, "Unknown physical address @ 0x%08x", addr);
@@ -39,10 +41,12 @@ PAddr VirtualToPhysicalAddress(const VAddr addr) {
39 // to virtual address translations here. This is quite hacky, but necessary until we implement 41 // to virtual address translations here. This is quite hacky, but necessary until we implement
40 // proper MMU emulation. 42 // proper MMU emulation.
41 // TODO: Screw it, I'll let bunnei figure out how to do this properly. 43 // TODO: Screw it, I'll let bunnei figure out how to do this properly.
42 if ((addr >= VRAM_VADDR) && (addr < VRAM_VADDR_END)) { 44 if (addr == 0) {
43 return addr - 0x07000000; 45 return 0;
44 } else if ((addr >= FCRAM_VADDR) && (addr < FCRAM_VADDR_END)) { 46 } else if ((addr >= VRAM_VADDR) && (addr < VRAM_VADDR_END)) {
45 return addr - FCRAM_VADDR + FCRAM_PADDR; 47 return addr - VRAM_VADDR + VRAM_PADDR;
48 } else if ((addr >= HEAP_LINEAR_VADDR) && (addr < HEAP_LINEAR_VADDR_END)) {
49 return addr - HEAP_LINEAR_VADDR + FCRAM_PADDR;
46 } 50 }
47 51
48 LOG_ERROR(HW_Memory, "Unknown virtual address @ 0x%08x", addr); 52 LOG_ERROR(HW_Memory, "Unknown virtual address @ 0x%08x", addr);