diff options
author | Rémi Calixte <remicalixte.rmc@gmail.com> | 2021-08-29 00:12:36 +0200 |
---|---|---|
committer | Rémi Calixte <remicalixte.rmc@gmail.com> | 2021-08-29 00:12:36 +0200 |
commit | c97046f4b518d53a2508c896b15fd467b6559346 (patch) | |
tree | 57ab33da23a252c502711be7c4d64b3a89f7fcf6 /arm7/lib/src/SND_capture.c | |
parent | 8d383810aa08aa9594086ed2f8b3e6a50927d53c (diff) | |
parent | 7994935696dcf9d81888e2d9d991f4b6a3e00738 (diff) |
Merge branch 'master' into unk_02006D98
Diffstat (limited to 'arm7/lib/src/SND_capture.c')
-rw-r--r-- | arm7/lib/src/SND_capture.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arm7/lib/src/SND_capture.c b/arm7/lib/src/SND_capture.c new file mode 100644 index 00000000..57494b72 --- /dev/null +++ b/arm7/lib/src/SND_capture.c @@ -0,0 +1,25 @@ +#include "SND_capture.h" + +#include "registers.h" + +enum SNDLoop +{ + SND_CAP_LOOP = 0, + SND_CAP_ONESHOT = 1 +}; + +void SND_SetupCapture( + int idx, int format, void *captureData, int size, BOOL loop, int capCtrlSrc, int capCtrlDst) +{ + int off = idx * 8; + + reg_SNDCAPxCNT(idx) = (u8)((format << 3) | ((loop ? SND_CAP_LOOP : SND_CAP_ONESHOT) << 2) | + (capCtrlSrc << 1) | capCtrlDst); + *(vu32 *)(0x4000510 + off) = (u32)captureData; + *(vu16 *)(0x4000514 + off) = (u16)size; +} + +BOOL SND_IsCaptureActive(int idx) +{ + return (reg_SNDCAPxCNT(idx) & 0x80) != 0; +} |