33 lines
834 B
C++
33 lines
834 B
C++
//
|
|
// Created by Wouter Groeneveld on 07/08/18.
|
|
//
|
|
|
|
#include <engine/gba/tonc_memmap.h>
|
|
#include "sound.h"
|
|
|
|
void SoundControl::accept(const void *data, int totalSamples, int ticksPerSample) {
|
|
*DMASourceAddress = (u32) data;
|
|
*DMADestinationAddress = (u32) FiFoBuffer;
|
|
vblanksTotal = vblanksRemaning = totalSamples * ticksPerSample * (1.0 / CYCLES_PER_BLANK);
|
|
};
|
|
|
|
SoundControl* SoundControl::channelAControl() {
|
|
return new SoundControl{
|
|
®_DMA1CNT,
|
|
®_DMA1SAD,
|
|
®_DMA1DAD,
|
|
®_FIFOA,
|
|
SDS_AR | SDS_AL | SDS_ARESET
|
|
};
|
|
}
|
|
|
|
SoundControl* SoundControl::channelBControl() {
|
|
return new SoundControl{
|
|
®_DMA2CNT,
|
|
®_DMA2SAD,
|
|
®_DMA2DAD,
|
|
®_FIFOB,
|
|
SDS_BR | SDS_BL | SDS_BRESET
|
|
};
|
|
}
|