git.y1.nz

SameBoy

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

commit 2d766982799b03c4333b6784593c903f54d55e45
parent d67580c96405c7ee07168b3dcedd7a29d4b18041
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Sun, 31 Jan 2021 19:17:26 +0200

Emulation of NR43 bit 3 glitch on CGB-C and older

Diffstat:
MCore/apu.c10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/Core/apu.c b/Core/apu.c @@ -1209,7 +1209,15 @@ void GB_apu_write(GB_gameboy_t *gb, uint8_t reg, uint8_t value) } /* Step LFSR */ if (new_bit && (!old_bit || gb->model <= GB_MODEL_CGB_C)) { - step_lfsr(gb, 0); + if (gb->model <= GB_MODEL_CGB_C) { + bool previous_narrow = gb->apu.noise_channel.narrow; + gb->apu.noise_channel.narrow = true; + step_lfsr(gb, 0); + gb->apu.noise_channel.narrow = previous_narrow; + } + else { + step_lfsr(gb, 0); + } } break; }

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