diff options
Diffstat (limited to 'src/core/mem_map_funcs.cpp')
-rw-r--r-- | src/core/mem_map_funcs.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/core/mem_map_funcs.cpp b/src/core/mem_map_funcs.cpp index 8ab647714..86e9eaa20 100644 --- a/src/core/mem_map_funcs.cpp +++ b/src/core/mem_map_funcs.cpp @@ -73,6 +73,10 @@ inline void _Read(T &var, const u32 addr) { } else if ((vaddr >= SHARED_MEMORY_VADDR) && (vaddr < SHARED_MEMORY_VADDR_END)) { var = *((const T*)&g_shared_mem[vaddr & SHARED_MEMORY_MASK]); + // System memory + } else if ((vaddr >= SYSTEM_MEMORY_VADDR) && (vaddr < SYSTEM_MEMORY_VADDR_END)) { + var = *((const T*)&g_system_mem[vaddr & SYSTEM_MEMORY_MASK]); + // Config memory } else if ((vaddr >= CONFIG_MEMORY_VADDR) && (vaddr < CONFIG_MEMORY_VADDR_END)) { ConfigMem::Read<T>(var, vaddr); @@ -115,6 +119,10 @@ inline void _Write(u32 addr, const T data) { } else if ((vaddr >= SHARED_MEMORY_VADDR) && (vaddr < SHARED_MEMORY_VADDR_END)) { *(T*)&g_shared_mem[vaddr & SHARED_MEMORY_MASK] = data; + // System memory + } else if ((vaddr >= SYSTEM_MEMORY_VADDR) && (vaddr < SYSTEM_MEMORY_VADDR_END)) { + *(T*)&g_system_mem[vaddr & SYSTEM_MEMORY_MASK] = data; + // VRAM } else if ((vaddr >= VRAM_VADDR) && (vaddr < VRAM_VADDR_END)) { *(T*)&g_vram[vaddr & VRAM_MASK] = data; @@ -153,9 +161,13 @@ u8 *GetPointer(const u32 addr) { return g_heap + (vaddr & HEAP_MASK); // Shared memory - } else if ((vaddr > SHARED_MEMORY_VADDR) && (vaddr < SHARED_MEMORY_VADDR_END)) { + } else if ((vaddr >= SHARED_MEMORY_VADDR) && (vaddr < SHARED_MEMORY_VADDR_END)) { return g_shared_mem + (vaddr & SHARED_MEMORY_MASK); + // System memory + } else if ((vaddr >= SYSTEM_MEMORY_VADDR) && (vaddr < SYSTEM_MEMORY_VADDR_END)) { + return g_system_mem + (vaddr & SYSTEM_MEMORY_MASK); + // VRAM } else if ((vaddr > VRAM_VADDR) && (vaddr < VRAM_VADDR_END)) { return g_vram + (vaddr & VRAM_MASK); |