From 43daa1c7d25043eb4e9eb13e6d2df58f1d0400f6 Mon Sep 17 00:00:00 2001 From: Arisotura Date: Thu, 28 Oct 2021 21:24:39 +0200 Subject: blarg --- src/ARM.cpp | 12 +++++++----- src/ARM.h | 4 ++-- src/DSi.cpp | 48 ++++++++++++++++++++++++------------------------ 3 files changed, 33 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/ARM.cpp b/src/ARM.cpp index 1abdbdd..9b114f2 100644 --- a/src/ARM.cpp +++ b/src/ARM.cpp @@ -83,6 +83,8 @@ ARMv5::ARMv5() : ARM(0) #ifndef JIT_ENABLED DTCM = new u8[DTCMPhysicalSize]; #endif + + PU_Map = PU_PrivMap; } ARMv4::ARMv4() : ARM(1) @@ -162,7 +164,7 @@ void ARMv5::Reset() GetMemRegion = NDS::ARM9GetMemRegion; } - //PU_Map = PU_PrivMap; + PU_Map = PU_PrivMap; ARM::Reset(); } @@ -239,10 +241,10 @@ void ARM::DoSavestate(Savestate* file) SetupCodeMem(R[15]); // should fix it ((ARMv5*)this)->RegionCodeCycles = ((ARMv5*)this)->MemTimings[R[15] >> 12][0]; - /*if ((CPSR & 0x1F) == 0x10) + if ((CPSR & 0x1F) == 0x10) ((ARMv5*)this)->PU_Map = ((ARMv5*)this)->PU_UserMap; else - ((ARMv5*)this)->PU_Map = ((ARMv5*)this)->PU_PrivMap;*/ + ((ARMv5*)this)->PU_Map = ((ARMv5*)this)->PU_PrivMap; } else { @@ -501,10 +503,10 @@ void ARM::UpdateMode(u32 oldmode, u32 newmode, bool phony) if ((!phony) && (Num == 0)) { - /*if ((newmode & 0x1F) == 0x10) + if ((newmode & 0x1F) == 0x10) ((ARMv5*)this)->PU_Map = ((ARMv5*)this)->PU_UserMap; else - ((ARMv5*)this)->PU_Map = ((ARMv5*)this)->PU_PrivMap;*/ + ((ARMv5*)this)->PU_Map = ((ARMv5*)this)->PU_PrivMap; } } diff --git a/src/ARM.h b/src/ARM.h index dd88f7d..bb6a4fd 100644 --- a/src/ARM.h +++ b/src/ARM.h @@ -293,8 +293,8 @@ public: u8 PU_UserMap[0x100000]; // games operate under system mode, generally - #define PU_Map PU_PrivMap - //u8* PU_Map; + //#define PU_Map PU_PrivMap + u8* PU_Map; // code/16N/32N/32S u8 MemTimings[0x100000][4]; diff --git a/src/DSi.cpp b/src/DSi.cpp index eb702d0..7560578 100644 --- a/src/DSi.cpp +++ b/src/DSi.cpp @@ -500,30 +500,30 @@ void SetupDirectBoot() SPI_Firmware::SetupDirectBoot(true); - ARM9->CP15Write(0x100, 0x00056078); - ARM9->CP15Write(0x200, 0x0000004A); - ARM9->CP15Write(0x201, 0x0000004A); - ARM9->CP15Write(0x300, 0x0000000A); - ARM9->CP15Write(0x502, 0x15111011); - ARM9->CP15Write(0x503, 0x05101011); - ARM9->CP15Write(0x600, 0x04000033); - ARM9->CP15Write(0x601, 0x04000033); - ARM9->CP15Write(0x610, 0x02000031); - ARM9->CP15Write(0x611, 0x02000031); - ARM9->CP15Write(0x620, 0x00000000); - ARM9->CP15Write(0x621, 0x00000000); - ARM9->CP15Write(0x630, 0x08000033); - ARM9->CP15Write(0x631, 0x08000033); - ARM9->CP15Write(0x640, 0x0E00001B); - ARM9->CP15Write(0x641, 0x0E00001B); - ARM9->CP15Write(0x650, 0x00000000); - ARM9->CP15Write(0x651, 0x00000000); - ARM9->CP15Write(0x660, 0xFFFF001D); - ARM9->CP15Write(0x661, 0xFFFF001D); - ARM9->CP15Write(0x670, 0x02FFC01B); - ARM9->CP15Write(0x671, 0x02FFC01B); - ARM9->CP15Write(0x910, 0x0E00000A); - ARM9->CP15Write(0x911, 0x00000020); + NDS::ARM9->CP15Write(0x100, 0x00056078); + NDS::ARM9->CP15Write(0x200, 0x0000004A); + NDS::ARM9->CP15Write(0x201, 0x0000004A); + NDS::ARM9->CP15Write(0x300, 0x0000000A); + NDS::ARM9->CP15Write(0x502, 0x15111011); + NDS::ARM9->CP15Write(0x503, 0x05101011); + NDS::ARM9->CP15Write(0x600, 0x04000033); + NDS::ARM9->CP15Write(0x601, 0x04000033); + NDS::ARM9->CP15Write(0x610, 0x02000031); + NDS::ARM9->CP15Write(0x611, 0x02000031); + NDS::ARM9->CP15Write(0x620, 0x00000000); + NDS::ARM9->CP15Write(0x621, 0x00000000); + NDS::ARM9->CP15Write(0x630, 0x08000033); + NDS::ARM9->CP15Write(0x631, 0x08000033); + NDS::ARM9->CP15Write(0x640, 0x0E00001B); + NDS::ARM9->CP15Write(0x641, 0x0E00001B); + NDS::ARM9->CP15Write(0x650, 0x00000000); + NDS::ARM9->CP15Write(0x651, 0x00000000); + NDS::ARM9->CP15Write(0x660, 0xFFFF001D); + NDS::ARM9->CP15Write(0x661, 0xFFFF001D); + NDS::ARM9->CP15Write(0x670, 0x02FFC01B); + NDS::ARM9->CP15Write(0x671, 0x02FFC01B); + NDS::ARM9->CP15Write(0x910, 0x0E00000A); + NDS::ARM9->CP15Write(0x911, 0x00000020); } void SoftReset() -- cgit v1.2.3