Fix timer bug; fixes #409

This commit is contained in:
Lior Halphon 2021-10-10 16:53:07 +03:00
parent 01f80a3f3e
commit 4ce643d5eb
1 changed files with 1 additions and 1 deletions

View File

@ -434,7 +434,7 @@ void GB_emulate_timer_glitch(GB_gameboy_t *gb, uint8_t old_tac, uint8_t new_tac)
/* The bit used for overflow testing must have been 1 */
if (gb->div_counter & old_clocks) {
/* And now either the timer must be disabled, or the new bit used for overflow testing be 0. */
if (!(new_tac & 4) || gb->div_counter & new_clocks) {
if (!(new_tac & 4) || !(gb->div_counter & new_clocks)) {
increase_tima(gb);
}
}