all repos — mgba @ d1e2f2be6bba2e853c4b132ee98287731615f0ae

mGBA Game Boy Advance Emulator

GB Audio: Fix channel 4 sampling
Jeffrey Pfau jeffrey@endrift.com
Sat, 17 Sep 2016 12:36:24 -0700
commit

d1e2f2be6bba2e853c4b132ee98287731615f0ae

parent

159fd77a8aa4220433d53917bc0a1b7f46a51d3d

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M src/gb/audio.csrc/gb/audio.c

@@ -553,7 +553,7 @@ audio->nextCh4 -= audio->eventDiff;

if (!audio->ch4.envelope.dead && frame == 7) { --audio->ch4.envelope.nextStep; if (audio->ch4.envelope.nextStep == 0) { - int8_t sample = (audio->ch4.sample >> 31) * 0x8; + int8_t sample = (audio->ch4.sample >> 7) * 0x8; _updateEnvelope(&audio->ch4.envelope); audio->ch4.sample = sample * audio->ch4.envelope.currentVolume; }