From 801f43dfc5a1d3b57213837b72143703cd2c7d56 Mon Sep 17 00:00:00 2001 From: Jaklyy <102590697+Jaklyy@users.noreply.github.com> Date: Sun, 13 Oct 2024 10:14:54 -0400 Subject: [PATCH] reimplement codemem i dont feel like i actually had a good reason for disabling this... --- src/ARM.cpp | 4 ++-- src/CP15.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ARM.cpp b/src/ARM.cpp index 8c74a248..9e768047 100644 --- a/src/ARM.cpp +++ b/src/ARM.cpp @@ -327,7 +327,7 @@ void ARMv5::JumpTo(u32 addr, bool restorecpsr) addr &= ~0x1; R[15] = addr+2; - //if (newregion != oldregion) SetupCodeMem(addr); + if (newregion != oldregion) SetupCodeMem(addr); // two-opcodes-at-once fetch // doesn't matter if we put garbage in the MSbs there @@ -352,7 +352,7 @@ void ARMv5::JumpTo(u32 addr, bool restorecpsr) addr &= ~0x3; R[15] = addr+4; - //if (newregion != oldregion) SetupCodeMem(addr); + if (newregion != oldregion) SetupCodeMem(addr); NextInstr[0] = CodeRead32(addr, true); Cycles += CodeCycles; diff --git a/src/CP15.cpp b/src/CP15.cpp index b1ed52a5..9ac9d568 100644 --- a/src/CP15.cpp +++ b/src/CP15.cpp @@ -979,8 +979,8 @@ u32 ARMv5::CodeRead32(u32 addr, bool branch) NDS.ARM9Timestamp += CodeCycles; if (NDS.ARM9Timestamp < TimestampActual) NDS.ARM9Timestamp = TimestampActual; - //if (CodeMem.Mem) return *(u32*)&CodeMem.Mem[addr & CodeMem.Mask]; DataRegion = Mem9_Null; + if (CodeMem.Mem) return *(u32*)&CodeMem.Mem[addr & CodeMem.Mask]; return BusRead32(addr); }