mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-14 09:04:31 +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
|
.macro clamp amp
|
||||||
// Vanadium's clamp trick (-128..127)
|
// Vanadium's clamp trick (-128..127)
|
||||||
mov tmp, \amp, asr #31 // tmp <- 0xffffffff
|
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
|
eorne \amp, tmp, #0x7F // amp <- 0xffffff80
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
@@ -497,14 +497,14 @@ void soundInit()
|
|||||||
|
|
||||||
void soundFill()
|
void soundFill()
|
||||||
{
|
{
|
||||||
if (curSoundBuffer == 1) {
|
if (curSoundBuffer) {
|
||||||
REG_DMA1CNT = 0;
|
REG_DMA1CNT = 0;
|
||||||
REG_DMA1SAD = (u32)soundBuffer;
|
REG_DMA1SAD = (u32)soundBuffer;
|
||||||
REG_DMA1CNT = DMA_DST_FIXED | DMA_REPEAT | DMA_16 | DMA_AT_FIFO | DMA_ENABLE;
|
REG_DMA1CNT = DMA_DST_FIXED | DMA_REPEAT | DMA_16 | DMA_AT_FIFO | DMA_ENABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
sndFill(soundBuffer + curSoundBuffer * SND_SAMPLES, SND_SAMPLES);
|
sndFill(soundBuffer + curSoundBuffer, SND_SAMPLES);
|
||||||
curSoundBuffer ^= 1;
|
curSoundBuffer ^= SND_SAMPLES;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vblank()
|
void vblank()
|
||||||
|
Reference in New Issue
Block a user