Fix a window bug in CGB mode, fixes #123

This commit is contained in:
Lior Halphon 2020-11-22 00:21:19 +02:00
parent bbf609f46b
commit 67c0e03f3b

View File

@ -1021,7 +1021,7 @@ void GB_display_run(GB_gameboy_t *gb, uint8_t cycles)
bool should_activate_window = false; bool should_activate_window = false;
if (gb->io_registers[GB_IO_WX] == 0) { if (gb->io_registers[GB_IO_WX] == 0) {
static const uint8_t scx_to_wx0_comparisons[] = {-7, -9, -10, -11, -12, -13, -14, -14}; static const uint8_t scx_to_wx0_comparisons[] = {-7, -9, -10, -11, -12, -13, -14, -14};
if (gb->position_in_line == scx_to_wx0_comparisons[gb->io_registers[GB_IO_SCX] & 7]) { if (gb->position_in_line == scx_to_wx0_comparisons[gb->io_registers[GB_IO_SCX] & 7] && !GB_is_cgb(gb)) {
should_activate_window = true; should_activate_window = true;
} }
} }