Accurate PCM12 read for channel 2 on CGB-0 double speed

This commit is contained in:
Lior Halphon
2025-10-11 19:43:27 +03:00
parent ceae5ecd4e
commit 421fd132e3
+2 -2
View File
@@ -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) {