Refined OAM interrupt timing. Fixes Pinball Deluxe in DMG mode; closes #1.

This commit is contained in:
Lior Halphon 2017-09-23 21:08:05 +03:00
parent 1804a5c8e6
commit 7a41a9b417
1 changed files with 9 additions and 1 deletions

View File

@ -440,6 +440,14 @@ static void update_display_state(GB_gameboy_t *gb, uint8_t cycles)
}
/* Handle everything else */
/* OAM interrupt happens slightly before STAT is actually updated. (About 1-3 T-cycles)
Todo: Test double speed CGB */
if (position_in_line == 0 && stat_delay) {
if (gb->io_registers[GB_IO_STAT] & 0x20) {
gb->stat_interrupt_line = true;
dmg_future_stat = true;
}
}
if (position_in_line == stat_delay) {
gb->io_registers[GB_IO_STAT] &= ~3;
gb->io_registers[GB_IO_STAT] |= 2;
@ -593,7 +601,7 @@ static void update_display_state(GB_gameboy_t *gb, uint8_t cycles)
gb->io_registers[GB_IO_IF] |= 2;
}
}
}
};
#if 0
/* The value of LY is glitched in the last cycle of every line in CGB mode CGB in single speed