Commit efcd749e authored by Erik Faye-Lund's avatar Erik Faye-Lund
Browse files

clean up some comments


Signed-off-by: default avatarErik Faye-Lund <kusmabite@gmail.com>
parent a99068da
......@@ -37,7 +37,6 @@ typedef volatile u32 vu32;
void CpuFastSet( const void *src, void *dst, u32 mode)
{
/* call BIOS-function CpuFastSet() to clear buffer */
asm (
"mov r0, %[src] \n"
"mov r1, %[dst] \n"
......@@ -75,6 +74,7 @@ void pimp_gba_init(const struct pimp_module *module, const void *sample_bank)
pimp_gba_mixer.mix_buffer = pimp_gba_mix_buffer;
pimp_mod_context_init(&pimp_gba_ctx, (const pimp_module*)module, (const u8*)sample_bank, &pimp_gba_mixer, PIMP_GBA_SAMPLERATE);
/* call BIOS-function CpuFastSet() to clear buffer */
CpuFastSet(&zero, &pimp_gba_sound_buffers[0][0], DMA_SRC_FIXED | ((SOUND_BUFFER_SIZE / 4) * 2));
REG_SOUNDCNT_H = SNDA_VOL_100 | SNDA_L_ENABLE | SNDA_R_ENABLE | SNDA_RESET_FIFO;
REG_SOUNDCNT_X = (1 << 7);
......@@ -141,11 +141,14 @@ void pimp_mixer_clear(s32 *target, const u32 samples)
static const u32 zero = 0;
const u32 *src = &zero;
u32 *dst = (u32*)target;
/* bit 24 = fixed source address, bit 0-20 = wordcount (must be dividable by 8) */
const int mode = (1 << 24) | (samples & ~7);
ASSERT(NULL != src);
ASSERT(NULL != dst);
/* clear the samples that CpuFastSet() can't */
for (i = samples & 7; i; --i)
{
*dst++ = 0;
......@@ -155,6 +158,7 @@ void pimp_mixer_clear(s32 *target, const u32 samples)
ASSERT(((int)src & 3) == 0);
ASSERT(((int)dst & 3) == 0);
/* call BIOS-function CpuFastSet() to clear buffer */
CpuFastSet(src, dst, mode);
}
#endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment