diff --git a/src/platform/gba/asm/sndPCM.s b/src/platform/gba/asm/sndPCM.s index 83bfdf5d..1c2d4353 100644 --- a/src/platform/gba/asm/sndPCM.s +++ b/src/platform/gba/asm/sndPCM.s @@ -19,7 +19,7 @@ tmp .req ampA .macro clamp amp // Vanadium's clamp trick (-128..127) mov tmp, \amp, asr #31 // tmp <- 0xffffffff - cmp tmp, \amp, asr #7 // not equal + cmp tmp, \amp, asr #7 // not equal eorne \amp, tmp, #0x7F // amp <- 0xffffff80 .endm diff --git a/src/platform/gba/main.cpp b/src/platform/gba/main.cpp index 932d4572..9c5102cf 100644 --- a/src/platform/gba/main.cpp +++ b/src/platform/gba/main.cpp @@ -497,14 +497,14 @@ void soundInit() void soundFill() { - if (curSoundBuffer == 1) { + if (curSoundBuffer) { REG_DMA1CNT = 0; REG_DMA1SAD = (u32)soundBuffer; REG_DMA1CNT = DMA_DST_FIXED | DMA_REPEAT | DMA_16 | DMA_AT_FIFO | DMA_ENABLE; } - sndFill(soundBuffer + curSoundBuffer * SND_SAMPLES, SND_SAMPLES); - curSoundBuffer ^= 1; + sndFill(soundBuffer + curSoundBuffer, SND_SAMPLES); + curSoundBuffer ^= SND_SAMPLES; } void vblank()