z80, fix sms interrupt handling in cz80

This commit is contained in:
kub 2021-10-06 19:45:37 +02:00
parent 4b3e9d92e3
commit 80bf9bcce9
5 changed files with 104 additions and 94 deletions

View file

@ -686,8 +686,8 @@ OP_CCF:
OP(0x76): // HALT
OP_HALT:
CPU->HaltState = 1;
goto Cz80_Check_Interrupt;
CPU->Status |= CZ80_HALTED;
RET(4)
OP(0xf3): // DI
OP_DI:
@ -709,9 +709,12 @@ OP_EI:
zR++;
#endif
}
afterEI = 1;
CPU->ExtraCycles += 1 - CPU->ICount;
CPU->ICount = 1;
if (CPU->IRQState)
{
CPU->Status |= CZ80_HAS_INT;
CPU->ExtraCycles -= CPU->ICount;
CPU->ICount = 0;
}
}
else zIFF2 = (1 << 2);
goto Cz80_Exec_nocheck;