mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-31 22:32:15 +02:00
Slightly more accurate
This commit is contained in:
@@ -1739,7 +1739,15 @@ void GB_display_run(GB_gameboy_t *gb, unsigned cycles, bool force)
|
|||||||
if (!gb->wx_triggered && gb->wy_triggered && (gb->io_registers[GB_IO_LCDC] & GB_LCDC_WIN_ENABLE)) {
|
if (!gb->wx_triggered && gb->wy_triggered && (gb->io_registers[GB_IO_LCDC] & GB_LCDC_WIN_ENABLE)) {
|
||||||
bool should_activate_window = false;
|
bool should_activate_window = false;
|
||||||
if (unlikely(gb->io_registers[GB_IO_WX] == 0)) {
|
if (unlikely(gb->io_registers[GB_IO_WX] == 0)) {
|
||||||
should_activate_window = (gb->position_in_line == (uint8_t)-16 && (gb->io_registers[GB_IO_SCX] & 7)) || (gb->position_in_line == (uint8_t)-7);
|
if (gb->position_in_line == (uint8_t)-7) {
|
||||||
|
should_activate_window = true;
|
||||||
|
}
|
||||||
|
else if (gb->position_in_line == (uint8_t)-16 && (gb->io_registers[GB_IO_SCX] & 7)) {
|
||||||
|
should_activate_window = true;
|
||||||
|
}
|
||||||
|
else if (gb->position_in_line >= (uint8_t)-15 && gb->position_in_line <= (uint8_t)-8) {
|
||||||
|
should_activate_window = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (gb->io_registers[GB_IO_WX] < 166 + GB_is_cgb(gb)) {
|
else if (gb->io_registers[GB_IO_WX] < 166 + GB_is_cgb(gb)) {
|
||||||
if (gb->io_registers[GB_IO_WX] == (uint8_t) (gb->position_in_line + 7)) {
|
if (gb->io_registers[GB_IO_WX] == (uint8_t) (gb->position_in_line + 7)) {
|
||||||
|
Reference in New Issue
Block a user