This commit is contained in:
Lior Halphon 2020-02-21 17:22:57 +02:00
parent 8409d3bcfb
commit f86e682d2c

View File

@ -211,7 +211,7 @@ static void cycle_write(GB_gameboy_t *gb, uint16_t addr, uint8_t value)
/* Handle disabling objects while already fetching an object */
if ((old_value & 2) && !(value & 2)) {
if (gb->during_object_fetch) {
gb->cycles_for_line -= gb->display_cycles;
gb->cycles_for_line += gb->display_cycles;
gb->display_cycles = 0;
gb->object_fetch_aborted = true;
}
@ -226,7 +226,7 @@ static void cycle_write(GB_gameboy_t *gb, uint16_t addr, uint8_t value)
/* Handle disabling objects while already fetching an object */
if ((old_value & 2) && !(value & 2)) {
if (gb->during_object_fetch) {
gb->cycles_for_line -= gb->display_cycles;
gb->cycles_for_line += gb->display_cycles;
gb->display_cycles = 0;
gb->object_fetch_aborted = true;
}
@ -244,7 +244,7 @@ static void cycle_write(GB_gameboy_t *gb, uint16_t addr, uint8_t value)
/* Handle disabling objects while already fetching an object */
if ((old_value & 2) && !(value & 2)) {
if (gb->during_object_fetch) {
gb->cycles_for_line -= gb->display_cycles;
gb->cycles_for_line += gb->display_cycles;
gb->display_cycles = 0;
gb->object_fetch_aborted = true;
}
@ -253,7 +253,7 @@ static void cycle_write(GB_gameboy_t *gb, uint16_t addr, uint8_t value)
/* Handle disabling objects while already fetching an object */
if ((old_value & 2) && !(value & 2)) {
if (gb->during_object_fetch) {
gb->cycles_for_line -= gb->display_cycles;
gb->cycles_for_line += gb->display_cycles;
gb->display_cycles = 0;
gb->object_fetch_aborted = true;
}