improved HINT accuracy in Master System Compatibility mode.

This commit is contained in:
ekeeke31 2011-04-28 00:13:23 +00:00
parent ea8228be66
commit 7cd0eb4a4b

View File

@ -757,6 +757,14 @@ static void system_frame_sms(int do_skip)
hint_pending = 0x10;
if (reg[0] & 0x10)
{
/* IRQ line is latched between instructions, on instruction last cycle */
/* This means that if Z80 cycle count is exactly a multiple of MCYCLES_PER_LINE, */
/* interrupt should be triggered AFTER the next instruction. */
if ((mcycles_z80 % MCYCLES_PER_LINE) == 0)
{
z80_run(mcycles_z80 + 1);
}
Z80.irq_state = ASSERT_LINE;
}
}