diff options
author | bunnei <ericbunnie@gmail.com> | 2014-04-04 04:04:50 +0200 |
---|---|---|
committer | bunnei <ericbunnie@gmail.com> | 2014-04-04 04:07:06 +0200 |
commit | 829952834aca9b5ad373d5af9f239514670c3e52 (patch) | |
tree | 860741aafdd9fcf192aae8989fa3d56092327761 /src/core | |
parent | made memory #define's enum to make debugging easier (diff) | |
download | yuzu-829952834aca9b5ad373d5af9f239514670c3e52.tar yuzu-829952834aca9b5ad373d5af9f239514670c3e52.tar.gz yuzu-829952834aca9b5ad373d5af9f239514670c3e52.tar.bz2 yuzu-829952834aca9b5ad373d5af9f239514670c3e52.tar.lz yuzu-829952834aca9b5ad373d5af9f239514670c3e52.tar.xz yuzu-829952834aca9b5ad373d5af9f239514670c3e52.tar.zst yuzu-829952834aca9b5ad373d5af9f239514670c3e52.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/src/mem_map_funcs.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/core/src/mem_map_funcs.cpp b/src/core/src/mem_map_funcs.cpp index f989e3487..18959dc70 100644 --- a/src/core/src/mem_map_funcs.cpp +++ b/src/core/src/mem_map_funcs.cpp @@ -41,11 +41,19 @@ inline void ReadFromHardware(T &var, const u32 addr) { // Scratchpad memory } else if (addr > MEM_SCRATCHPAD_VADDR && addr <= (MEM_SCRATCHPAD_VADDR + MEM_SCRATCHPAD_SIZE)) { var = *((const T*)&g_scratchpad[addr & MEM_SCRATCHPAD_MASK]); - } + /*else if ((addr & 0x3F800000) == 0x04000000) { var = *((const T*)&m_pVRAM[addr & VRAM_MASK]); }*/ - else { + + // HACK(bunnei): There is no layer yet to translate virtual addresses to physical addresses. + // Until we progress far enough along, we'll accept all physical address reads here. I think + // that this is typically a corner-case from usermode software unless they are trying to do + // bare-metal things (e.g. early 3DS homebrew writes directly to the FB @ 0x20184E60, etc. + } else if (((addr & 0xF0000000) == MEM_FCRAM_PADDR) && (addr < (MEM_FCRAM_PADDR_END))) { + var = *((const T*)&g_fcram[addr & MEM_FCRAM_MASK]); + + } else { _assert_msg_(MEMMAP, false, "unknown hardware read"); // WARN_LOG(MEMMAP, "ReadFromHardware: Invalid addr %08x PC %08x LR %08x", addr, currentMIPS->pc, currentMIPS->r[MIPS_REG_RA]); } @@ -73,6 +81,7 @@ inline void WriteToHardware(u32 addr, const T data) { // heap size... the following is writing to FCRAM + 0, which is actually supposed to be the // application's GSP heap *(T*)&g_fcram[addr & MEM_FCRAM_MASK] = data; + } else if ((addr & 0xFF000000) == 0x14000000) { _assert_msg_(MEMMAP, false, "umimplemented write to GSP heap"); } else if ((addr & 0xFFF00000) == 0x1EC00000) { @@ -85,6 +94,15 @@ inline void WriteToHardware(u32 addr, const T data) { _assert_msg_(MEMMAP, false, "umimplemented write to Configuration Memory"); } else if ((addr & 0xFFFFF000) == 0x1FF81000) { _assert_msg_(MEMMAP, false, "umimplemented write to shared page"); + + // HACK(bunnei): There is no layer yet to translate virtual addresses to physical addresses. + // Until we progress far enough along, we'll accept all physical address writes here. I think + // that this is typically a corner-case from usermode software unless they are trying to do + // bare-metal things (e.g. early 3DS homebrew writes directly to the FB @ 0x20184E60, etc. + } else if (((addr & 0xF0000000) == MEM_FCRAM_PADDR) && (addr < (MEM_FCRAM_PADDR_END))) { + *(T*)&g_fcram[addr & MEM_FCRAM_MASK] = data; + + // Error out... } else { _assert_msg_(MEMMAP, false, "unknown hardware write"); } |