git.y1.nz

SameBoy

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

commit 706135113c3c75c4c828a899beafd226f31ddd76
parent 8c86cff48631eeff387e4ee150533ae8f2a0d5d3
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Thu, 19 May 2022 20:59:48 +0300

Fix AGB APU regression

Diffstat:
MCore/apu.c9+++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/Core/apu.c b/Core/apu.c @@ -68,10 +68,6 @@ static uint8_t agb_bias_for_channel(GB_gameboy_t *gb, unsigned index) static void update_sample(GB_gameboy_t *gb, unsigned index, int8_t value, unsigned cycles_offset) { - if (gb->model > GB_MODEL_CGB_E && index == GB_WAVE) { - /* For some reason, channel 3 is inverted on the AGB */ - value ^= 0xF; - } if (gb->model > GB_MODEL_CGB_E) { /* On the AGB, because no analog mixing is done, the behavior of NR51 is a bit different. @@ -83,6 +79,11 @@ static void update_sample(GB_gameboy_t *gb, unsigned index, int8_t value, unsign unsigned right_volume = (gb->io_registers[GB_IO_NR50] & 7) + 1; unsigned left_volume = ((gb->io_registers[GB_IO_NR50] >> 4) & 7) + 1; + if (index == GB_WAVE) { + /* For some reason, channel 3 is inverted on the AGB */ + value ^= 0xF; + } + GB_sample_t output; uint8_t bias = agb_bias_for_channel(gb, 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.