diff options
Diffstat (limited to 'src/core/mem_map_funcs.cpp')
-rw-r--r-- | src/core/mem_map_funcs.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/core/mem_map_funcs.cpp b/src/core/mem_map_funcs.cpp index c057a8114..2284b535c 100644 --- a/src/core/mem_map_funcs.cpp +++ b/src/core/mem_map_funcs.cpp @@ -25,7 +25,7 @@ u32 _VirtualAddress(const u32 addr) { return VirtualAddressFromPhysical_FCRAM(addr); // Virtual address mapping FW0B - } else if ((addr >= FRAM_VADDR_FW0B) && (addr < FRAM_VADDR_FW0B_END)) { + } else if ((addr >= FCRAM_VADDR_FW0B) && (addr < FCRAM_VADDR_FW0B_END)) { return VirtualAddressFromPhysical_FCRAM(addr); // Hardware IO @@ -58,6 +58,10 @@ inline void _Read(T &var, const u32 addr) { } else if ((vaddr >= HARDWARE_IO_VADDR) && (vaddr < HARDWARE_IO_VADDR_END)) { HW::Read<T>(var, vaddr); + // ExeFS:/.code is loaded here + } else if ((vaddr >= EXEFS_CODE_VADDR) && (vaddr < EXEFS_CODE_VADDR_END)) { + var = *((const T*)&g_exefs_code[vaddr & EXEFS_CODE_MASK]); + // FCRAM - GSP heap } else if ((vaddr >= HEAP_GSP_VADDR) && (vaddr < HEAP_GSP_VADDR_END)) { var = *((const T*)&g_heap_gsp[vaddr & HEAP_GSP_MASK]); @@ -94,6 +98,10 @@ inline void _Write(u32 addr, const T data) { } else if ((vaddr >= HARDWARE_IO_VADDR) && (vaddr < HARDWARE_IO_VADDR_END)) { HW::Write<T>(vaddr, data); + // ExeFS:/.code is loaded here + } else if ((vaddr >= EXEFS_CODE_VADDR) && (vaddr < EXEFS_CODE_VADDR_END)) { + *(T*)&g_exefs_code[vaddr & EXEFS_CODE_MASK] = data; + // FCRAM - GSP heap } else if ((vaddr >= HEAP_GSP_VADDR) && (vaddr < HEAP_GSP_VADDR_END)) { *(T*)&g_heap_gsp[vaddr & HEAP_GSP_MASK] = data; @@ -127,8 +135,12 @@ inline void _Write(u32 addr, const T data) { u8 *GetPointer(const u32 addr) { const u32 vaddr = _VirtualAddress(addr); + // ExeFS:/.code is loaded here + if ((vaddr >= EXEFS_CODE_VADDR) && (vaddr < EXEFS_CODE_VADDR_END)) { + return g_exefs_code + (vaddr & EXEFS_CODE_MASK); + // FCRAM - GSP heap - if ((vaddr >= HEAP_GSP_VADDR) && (vaddr < HEAP_GSP_VADDR_END)) { + } else if ((vaddr >= HEAP_GSP_VADDR) && (vaddr < HEAP_GSP_VADDR_END)) { return g_heap_gsp + (vaddr & HEAP_GSP_MASK); // FCRAM - application heap |