git.y1.nz

SameBoy

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

commit 94db2355b52b140cc147bd13af6c9d9414bd09cf
parent ed8c9529954ea6d415ff8681d0aa2df9891df6bc
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Tue, 14 Oct 2025 21:05:28 +0300

Channels 1 and 2 align different on CGB-0 to C double speed mode

Diffstat:
MCore/apu.c2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Core/apu.c b/Core/apu.c @@ -1471,7 +1471,7 @@ void GB_apu_write(GB_gameboy_t *gb, uint8_t reg, uint8_t value) force_unsurpressed = true; } } - gb->apu.square_channels[index].delay = 6 - gb->apu.lf_div; + gb->apu.square_channels[index].delay = 6 + gb->apu.lf_div * (gb->model < GB_MODEL_CGB_D && gb->cgb_double_speed? 1 : -1); gb->apu.square_channels[index].sample_countdown = (gb->apu.square_channels[index].sample_length ^ 0x7FF) * 2 + gb->apu.square_channels[index].delay; } else {

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