SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 421fd132e316c88defd80b60dff29210496b84fb parent ceae5ecd4edd77df174a9b51c4558a4aa5d5ce06 Author: Lior Halphon <LIJI32@gmail.com> Date: Sat, 11 Oct 2025 19:43:27 +0300 Accurate PCM12 read for channel 2 on CGB-0 double speed 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 << 4) | 0x1F; + gb->apu.pcm_mask[0] &= (gb->apu.square_channels[GB_SQUARE_2].current_volume << 4) | (gb->model == GB_MODEL_CGB_0? 0x3F : 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 << 4) | 0x1F; + gb->apu.pcm_mask[0] &= (gb->apu.noise_channel.current_volume << 4) | (gb->model == GB_MODEL_CGB_0? 0x3F : 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.