| 250 | } |
| 251 | |
| 252 | u32* 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 | |
| 287 | void csndWriteCmd(int cmdid, u8 *cmdparams) |
| 288 | { |
no outgoing calls
no test coverage detected