This commit is contained in:
Arisotura 2021-10-28 21:24:39 +02:00
parent e121953c9a
commit 43daa1c7d2
3 changed files with 33 additions and 31 deletions

View File

@ -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;
}
}

View File

@ -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];

View File

@ -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()