MCPcopy Create free account
hub / github.com/devkitPro/libctru / csndAddCmd

Function csndAddCmd

libctru/source/services/csnd.c:252–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252u32* csndAddCmd(int cmdid)
253{
254 vu16* ptr;
255 u32 prevoff;
256 s32 outindex=0;
257
258 svcWaitSynchronizationN(&outindex, &csndMutex, 1, 0, ~0);
259
260 if (csndCmdStartOff != csndCmdCurOff)
261 {
262 if (csndCmdCurOff>=0x20)
263 prevoff = csndCmdCurOff-0x20;
264 else
265 prevoff = csndCmdBlockSize-0x20;
266
267 ptr = (vu16*)&csndSharedMem[prevoff>>2];
268 *ptr = csndCmdCurOff;
269 }
270
271 ptr = (vu16*)&csndSharedMem[csndCmdCurOff>>2];
272
273 ptr[0] = 0xFFFF;
274 ptr[1] = cmdid;
275 ptr[2] = 0;
276 ptr[3] = 0;
277 u32* ret = (u32*)&ptr[4];
278
279 csndCmdCurOff += 0x20;
280 if (csndCmdCurOff >= csndCmdBlockSize)
281 csndCmdCurOff = 0;
282
283 svcReleaseMutex(csndMutex);
284 return ret;
285}
286
287void csndWriteCmd(int cmdid, u8 *cmdparams)
288{

Callers 15

csndWriteCmdFunction · 0.85
CSND_SetPlayStateRFunction · 0.85
CSND_SetPlayStateFunction · 0.85
CSND_SetEncodingFunction · 0.85
CSND_SetBlockFunction · 0.85
CSND_SetLoopingFunction · 0.85
CSND_SetBit7Function · 0.85
CSND_SetInterpFunction · 0.85
CSND_SetDutyFunction · 0.85
CSND_SetTimerFunction · 0.85
CSND_SetVolFunction · 0.85
CSND_SetAdpcmStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected