SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit ceae5ecd4edd77df174a9b51c4558a4aa5d5ce06 parent 11fe9aa1c028cf586b4270a0baaee85ad91d78c2 Author: Lior Halphon <LIJI32@gmail.com> Date: Sat, 11 Oct 2025 17:48:02 +0300 Fix channel 2 PCM read on CGB≤C Diffstat:
| M | Core/apu.c | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Core/apu.c b/Core/apu.c @@ -541,7 +541,7 @@ static void tick_square_envelope(GB_gameboy_t *gb, GB_channel_t index) gb->apu.pcm_mask[0] &= gb->apu.square_channels[GB_SQUARE_1].current_volume | 0xF1; } else { - gb->apu.pcm_mask[0] &= (gb->apu.square_channels[GB_SQUARE_2].current_volume << 2) | 0x1F; + gb->apu.pcm_mask[0] &= (gb->apu.square_channels[GB_SQUARE_2].current_volume << 4) | 0x1F; } } @@ -568,7 +568,7 @@ static void tick_noise_envelope(GB_gameboy_t *gb) if (!(nr42 & 7)) return; if (gb->cgb_double_speed) { - gb->apu.pcm_mask[0] &= (gb->apu.noise_channel.current_volume << 2) | 0x1F; + gb->apu.pcm_mask[0] &= (gb->apu.noise_channel.current_volume << 4) | 0x1F; } if (nr42 & 8) {
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.