git.y1.nz

SameBoy

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

commit 461083523ae821a4cda1f9ad2fccb851a4c39918
parent b8e32e6d539f3ed716d8c1572f5b70dbcb967f1c
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Fri, 16 Aug 2024 20:51:40 +0300

Correctly emulate LYC edge cases when emulating CGB-0 to CGB-C in double speed mode

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

diff --git a/Core/display.c b/Core/display.c @@ -444,7 +444,7 @@ void GB_STAT_update(GB_gameboy_t *gb) bool previous_interrupt_line = gb->stat_interrupt_line; /* Set LY=LYC bit */ - if (gb->ly_for_comparison != (uint16_t)-1 || gb->model <= GB_MODEL_CGB_C) { + if (gb->ly_for_comparison != (uint16_t)-1 || (gb->model <= GB_MODEL_CGB_C && !gb->cgb_double_speed)) { if (gb->ly_for_comparison == gb->io_registers[GB_IO_LYC]) { gb->lyc_interrupt_line = true; gb->io_registers[GB_IO_STAT] |= 4; @@ -2141,7 +2141,7 @@ skip_slow_mode_3: GB_SLEEP(gb, display, 15, (gb->model > GB_MODEL_CGB_C)? 4: 2); gb->io_registers[GB_IO_LY] = 0; - gb->ly_for_comparison = (gb->model > GB_MODEL_CGB_C)? 153 : -1; + gb->ly_for_comparison = (gb->model > GB_MODEL_CGB_C || gb->cgb_double_speed)? 153 : -1; GB_STAT_update(gb); GB_SLEEP(gb, display, 16, 4);

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