MCPcopy Create free account
hub / github.com/doldecomp/mkdd / run

Method run

libs/JSystem/JAudio/System/JASAudioThread.cpp:41–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void *JASAudioThread::run() {
42 OSInitFastCast();
43 JASDriver::initAI(DMACallback);
44 JASDsp::boot(DSPCallback);
45 JASDsp::initBuffer();
46 JASDSPChannel::initAll();
47 JASPoolAllocObject_MultiThreaded<JASChannel>::newMemPool(0x48);
48 JASDriver::startDMA();
49
50 do {
51 OSMessage msg = waitMessageBlock();
52
53 switch ((int)msg) {
54 case 0: {
55 if (sbPauseFlag) {
56 //JUT_ASSERT_MSG(false, "AUDIO THREAD PAUSED\n");
57 JASDriver::stopDMA();
58 OSSleepThread(&sThreadQueue);
59 }
60 JASDriver::updateDac();
61 JASDriver::updateDacCallback();
62 break;
63 }
64 case 1: {
65#line 119
66 JUT_ASSERT(snIntCount != 0);
67 snIntCount--;
68 if (snIntCount == 0) {
69 JASProbe::stop(7);
70 JASDriver::finishDSPFrame();
71 }
72 else {
73 JASProbe::start(2, "SFR_DSP");
74 JASDriver::updateDSP();
75 JASProbe::stop(2);
76 }
77 break;
78 }
79 case 2: {
80 JASDriver::stopDMA();
81 OSExitThread(NULL);
82 break;
83 }
84 default: {
85 //JUT_ASSERT_MSG(false, "AUDIO THREAD INVALID MESSAGE\n");
86 break;
87 }
88 }
89
90 } while (true);
91}
92
93void JASAudioThread::DMACallback() {
94#line 152

Callers

nothing calls this directly

Calls 13

OSInitFastCastFunction · 0.85
initAIFunction · 0.85
bootFunction · 0.85
initBufferFunction · 0.85
newMemPoolFunction · 0.85
startDMAFunction · 0.85
stopDMAFunction · 0.85
OSSleepThreadFunction · 0.85
updateDacFunction · 0.85
updateDacCallbackFunction · 0.85
finishDSPFrameFunction · 0.85
updateDSPFunction · 0.85

Tested by

no test coverage detected