mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-12 08:04:09 +02:00
#368 GBA sound buffer switch optimization (one MUL, minor)
This commit is contained in:
@@ -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
|
||||
|
||||
|
@@ -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()
|
||||
|
Reference in New Issue
Block a user