SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 4abb5f35393545d0c67675119fbd9db00222f315 parent aff7f1706c380861eecadae2a3e9d54ebb66db27 Author: Lior Halphon <LIJI32@gmail.com> Date: Sat, 5 Jul 2025 16:37:48 +0300 Fix AGB mixing – the bias should only be applied if the channel is connected to a terminal Diffstat:
| M | Core/apu.c | 6 | +++--- |
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Core/apu.c b/Core/apu.c @@ -164,7 +164,7 @@ static void update_sample(GB_gameboy_t *gb, GB_channel_t index, int8_t value, un if (index == GB_WAVE) { /* For some reason, channel 3 is inverted on the AGB, and has a different "silence" value */ value ^= 0xF; - silence = 7; + silence = 7 * 2; } uint8_t bias = agb_bias_for_channel(gb, index); @@ -173,8 +173,8 @@ static void update_sample(GB_gameboy_t *gb, GB_channel_t index, int8_t value, un bool right = gb->io_registers[GB_IO_NR51] & (1 << index); GB_sample_t output = { - .left = (0xF - (left? value : silence) * 2 + bias) * left_volume, - .right = (0xF - (right? value : silence) * 2 + bias) * right_volume + .left = (0xF - (left? value * 2 + bias : silence)) * left_volume, + .right = (0xF - (right? value * 2 + bias : silence)) * right_volume }; if (unlikely(gb->apu_output.channel_muted[index])) {
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.