fix r3643 regression which broke arm7 on certain bios configurations due to bug in the bios protection check
This commit is contained in:
parent
40d58e14fc
commit
37453c7af9
|
@ -4106,6 +4106,9 @@ u8 FASTCALL _MMU_ARM7_read08(u32 adr)
|
||||||
{
|
{
|
||||||
//u32 prot = T1ReadLong_guaranteedAligned(MMU.MMU_MEM[ARMCPU_ARM7][0x40], 0x04000308 & MMU.MMU_MASK[ARMCPU_ARM7][0x40]);
|
//u32 prot = T1ReadLong_guaranteedAligned(MMU.MMU_MEM[ARMCPU_ARM7][0x40], 0x04000308 & MMU.MMU_MASK[ARMCPU_ARM7][0x40]);
|
||||||
//if (prot) INFO("MMU7 read 08 at 0x%08X (PC 0x%08X) BIOSPROT address 0x%08X\n", adr, NDS_ARM7.R[15], prot);
|
//if (prot) INFO("MMU7 read 08 at 0x%08X (PC 0x%08X) BIOSPROT address 0x%08X\n", adr, NDS_ARM7.R[15], prot);
|
||||||
|
|
||||||
|
//How accurate is this? our R[15] may not be exactly what the hardware uses (may use something less by up to 0x08)
|
||||||
|
//This may be inaccurate at the very edge cases.
|
||||||
if (NDS_ARM7.R[15] > 0x3FFF)
|
if (NDS_ARM7.R[15] > 0x3FFF)
|
||||||
return 0xFF;
|
return 0xFF;
|
||||||
}
|
}
|
||||||
|
|
|
@ -395,10 +395,12 @@ FORCEINLINE static u32 armcpu_prefetch()
|
||||||
// }
|
// }
|
||||||
//#else
|
//#else
|
||||||
curInstruction &= 0xFFFFFFFC; //please don't change this to 0x0FFFFFFC -- the NDS will happily run on 0xF******* addresses all day long
|
curInstruction &= 0xFFFFFFFC; //please don't change this to 0x0FFFFFFC -- the NDS will happily run on 0xF******* addresses all day long
|
||||||
armcpu->instruction = _MMU_read32<PROCNUM, MMU_AT_CODE>(curInstruction);
|
//please note that we must setup R[15] before reading the instruction since there is a protection
|
||||||
|
//which prevents PC > 0x3FFF from reading the bios region
|
||||||
armcpu->instruct_adr = curInstruction;
|
armcpu->instruct_adr = curInstruction;
|
||||||
armcpu->next_instruction = curInstruction + 4;
|
armcpu->next_instruction = curInstruction + 4;
|
||||||
armcpu->R[15] = curInstruction + 8;
|
armcpu->R[15] = curInstruction + 8;
|
||||||
|
armcpu->instruction = _MMU_read32<PROCNUM, MMU_AT_CODE>(curInstruction);
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
return MMU_codeFetchCycles<PROCNUM,32>(curInstruction);
|
return MMU_codeFetchCycles<PROCNUM,32>(curInstruction);
|
||||||
|
@ -417,10 +419,12 @@ FORCEINLINE static u32 armcpu_prefetch()
|
||||||
// }
|
// }
|
||||||
//#else
|
//#else
|
||||||
curInstruction &= 0xFFFFFFFE; //please don't change this to 0x0FFFFFFE -- the NDS will happily run on 0xF******* addresses all day long
|
curInstruction &= 0xFFFFFFFE; //please don't change this to 0x0FFFFFFE -- the NDS will happily run on 0xF******* addresses all day long
|
||||||
armcpu->instruction = _MMU_read16<PROCNUM, MMU_AT_CODE>(curInstruction);
|
//please note that we must setup R[15] before reading the instruction since there is a protection
|
||||||
|
//which prevents PC > 0x3FFF from reading the bios region
|
||||||
armcpu->instruct_adr = curInstruction;
|
armcpu->instruct_adr = curInstruction;
|
||||||
armcpu->next_instruction = curInstruction + 2;
|
armcpu->next_instruction = curInstruction + 2;
|
||||||
armcpu->R[15] = curInstruction + 4;
|
armcpu->R[15] = curInstruction + 4;
|
||||||
|
armcpu->instruction = _MMU_read16<PROCNUM, MMU_AT_CODE>(curInstruction);
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
if(PROCNUM==0)
|
if(PROCNUM==0)
|
||||||
|
|
Loading…
Reference in New Issue