mirror of https://github.com/zeldaret/mm.git
contchannelreset OK (#428)
* contchannelreset OK * Add to functions.h * Rename argument
This commit is contained in:
parent
8ebdb50470
commit
76c39482bc
|
@ -381,7 +381,7 @@ void guRotateF(float mf[4][4], f32 a, f32 x, f32 y, f32 z);
|
||||||
void guRotate(Mtx* m, f32 a, f32 x, f32 y, f32 z);
|
void guRotate(Mtx* m, f32 a, f32 x, f32 y, f32 z);
|
||||||
void __osSetGlobalIntMask(u32 mask);
|
void __osSetGlobalIntMask(u32 mask);
|
||||||
// void osVoiceInit(void);
|
// void osVoiceInit(void);
|
||||||
// void __osContChannelReset(void);
|
s32 __osContChannelReset(OSMesgQueue* mq, s32 channel);
|
||||||
// void __osVoiceSetADConverter(void);
|
// void __osVoiceSetADConverter(void);
|
||||||
s32 osAiSetFrequency(u32 frequency);
|
s32 osAiSetFrequency(u32 frequency);
|
||||||
s32 __osContRamRead(OSMesgQueue* mq, s32 channel, u16 address, u8* buffer);
|
s32 __osContRamRead(OSMesgQueue* mq, s32 channel, u16 address, u8* buffer);
|
||||||
|
|
|
@ -1,3 +1,27 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/contchannelreset/__osContChannelReset.s")
|
s32 __osContChannelReset(OSMesgQueue* mq, s32 channel) {
|
||||||
|
s32 i;
|
||||||
|
s32 ret;
|
||||||
|
u8* bufptr = (u8*)&__osPfsPifRam;
|
||||||
|
|
||||||
|
__osSiGetAccess();
|
||||||
|
|
||||||
|
__osPfsPifRam.pifstatus = 1;
|
||||||
|
|
||||||
|
for (i = 0; i < channel; i++) {
|
||||||
|
*bufptr++ = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
*bufptr++ = 0xFD;
|
||||||
|
*bufptr = CONT_CMD_END;
|
||||||
|
|
||||||
|
__osSiRawStartDma(OS_WRITE, &__osPfsPifRam);
|
||||||
|
osRecvMesg(mq, NULL, OS_MESG_BLOCK);
|
||||||
|
ret = __osSiRawStartDma(OS_READ, &__osPfsPifRam);
|
||||||
|
osRecvMesg(mq, NULL, OS_MESG_BLOCK);
|
||||||
|
|
||||||
|
__osSiRelAccess();
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue