GBA Audio: Fix sample order in audio channel 3
Jeffrey Pfau jeffrey@endrift.com
Mon, 29 Jun 2015 01:08:14 -0700
2 files changed,
6 insertions(+),
5 deletions(-)
M
CHANGES
→
CHANGES
@@ -50,6 +50,7 @@ - VFS: Fix line-reading to return proper values
- GBA Memory: Fix load/store multiple video memory waitstates - GBA: Fix timing of reading from timer registers - Util: Allow loading IPS patches that grow the ROM + - GBA Audio: Fix sample order in audio channel 3 Misc: - Qt: Handle saving input settings better - Debugger: Free watchpoints in addition to breakpoints
M
src/gba/audio.c
→
src/gba/audio.c
@@ -704,15 +704,15 @@ } else {
start = 3; end = 0; } - uint32_t bitsCarry = ch->wavedata[end] & 0x0F000000; + uint32_t bitsCarry = ch->wavedata[end] & 0x000000F0; uint32_t bits; for (i = start; i >= end; --i) { - bits = ch->wavedata[i] & 0x0F000000; - ch->wavedata[i] = ((ch->wavedata[i] & 0xF0F0F0F0) >> 4) | ((ch->wavedata[i] & 0x000F0F0F) << 12); - ch->wavedata[i] |= bitsCarry >> 20; + bits = ch->wavedata[i] & 0x000000F0; + ch->wavedata[i] = ((ch->wavedata[i] & 0x0F0F0F0F) << 4) | ((ch->wavedata[i] & 0xF0F0F000) >> 12); + ch->wavedata[i] |= bitsCarry << 20; bitsCarry = bits; } - ch->sample = bitsCarry >> 24; + ch->sample = bitsCarry >> 4; ch->sample -= 8; ch->sample *= volume * 4; return 8 * (2048 - ch->control.rate);