properly reset IE/IF, fixes some reset issues.

This commit is contained in:
StapleButter 2017-11-09 16:02:37 +01:00
parent 35c3b34a09
commit c3675af538
1 changed files with 11 additions and 1 deletions

View File

@ -290,7 +290,11 @@ void Reset()
memset(ROMSeed1, 0, 2*8);
IME[0] = 0;
IE[0] = 0;
IF[0] = 0;
IME[1] = 0;
IE[1] = 0;
IF[1] = 0;
PostFlag9 = 0x00;
PostFlag7 = 0x00;
@ -395,6 +399,7 @@ void RunSystem(s32 cycles)
continue;
SchedList[i].WaitCycles -= cycles;
if (SchedList[i].WaitCycles < 1)
{
SchedListMask &= ~(1<<i);
@ -943,6 +948,7 @@ u8 ARM9Read8(u32 addr)
case 0x08000000:
case 0x09000000:
printf("GBA read8 %08X\n", addr);
return 0xFF;
}
@ -990,6 +996,7 @@ u16 ARM9Read16(u32 addr)
case 0x08000000:
case 0x09000000:
printf("GBA read16 %08X\n", addr);
return 0xFFFF;
}
@ -1037,6 +1044,7 @@ u32 ARM9Read32(u32 addr)
case 0x08000000:
case 0x09000000:
printf("GBA read32 %08X\n", addr);
return 0xFFFFFFFF;
}
@ -1105,7 +1113,7 @@ void ARM9Write16(u32 addr, u16 val)
return;
}
//printf("unknown arm9 write16 %08X %04X\n", addr, val);
printf("unknown arm9 write16 %08X %04X\n", addr, val);
}
void ARM9Write32(u32 addr, u32 val)
@ -1598,6 +1606,8 @@ u32 ARM9IORead32(u32 addr)
case 0x040000E8: return DMA9Fill[2];
case 0x040000EC: return DMA9Fill[3];
case 0x040000F4: return 0; // ???? Golden Sun Dark Dawn keeps reading this
case 0x04000100: return TimerGetCounter(0) | (Timers[0].Cnt << 16);
case 0x04000104: return TimerGetCounter(1) | (Timers[1].Cnt << 16);
case 0x04000108: return TimerGetCounter(2) | (Timers[2].Cnt << 16);