Fix card reads below 0x8000

This commit is contained in:
normmatt234 2009-04-05 22:50:03 +00:00
parent 64a4300ba2
commit df915330e7
1 changed files with 5 additions and 0 deletions

View File

@ -3121,6 +3121,11 @@ u32 FASTCALL _MMU_ARM9_read32(u32 adr)
case 0xB7:
{
/* TODO: prevent read if the address is out of range */
/* Make sure any reads below 0x8000 redirect to 0x8000+(adr%0x1FF) as on real cart */
if(MMU.dscard[ARMCPU_ARM9].address < 0x8000)
{
MMU.dscard[ARMCPU_ARM9].address = (0x8000 + (MMU.dscard[ARMCPU_ARM9].address&0x1FF));
}
val = T1ReadLong(MMU.CART_ROM, MMU.dscard[ARMCPU_ARM9].address);
}
break;