git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit a4525c3336ac95618b2f50d1d30bf8547c5ce672
parent 482b9a15622ded90a7548efd0536c5fb9d0bacf0
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Sun,  7 Jul 2024 16:09:53 +0300

Slightly improve OAM read blocking timing

Diffstat:
MCore/display.c6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Core/display.c b/Core/display.c @@ -1603,7 +1603,7 @@ void GB_display_run(GB_gameboy_t *gb, unsigned cycles, bool force) GB_SLEEP(gb, display, 6, 1); gb->io_registers[GB_IO_LY] = gb->current_line; - gb->oam_read_blocked = true; + gb->oam_read_blocked = !gb->cgb_double_speed || gb->model >= GB_MODEL_CGB_D; gb->ly_for_comparison = gb->current_line? -1 : 0; /* The OAM STAT interrupt occurs 1 T-cycle before STAT actually changes, except on line 0. @@ -1618,7 +1618,7 @@ void GB_display_run(GB_gameboy_t *gb, unsigned cycles, bool force) GB_STAT_update(gb); GB_SLEEP(gb, display, 7, 1); - + gb->oam_read_blocked = true; gb->io_registers[GB_IO_STAT] &= ~3; gb->io_registers[GB_IO_STAT] |= 2; gb->mode_for_interrupt = 2; @@ -1910,7 +1910,7 @@ skip_slow_mode_3: if (!gb->cgb_double_speed) { gb->io_registers[GB_IO_STAT] &= ~3; gb->mode_for_interrupt = 0; - gb->oam_read_blocked = false; + gb->oam_read_blocked = gb->model >= GB_MODEL_CGB_D; gb->vram_read_blocked = false; gb->oam_write_blocked = false; gb->vram_write_blocked = false;

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.