MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / __OSStopAudioSystem

Function __OSStopAudioSystem

src/dolphin/src/os/OSAudioSystem.c:84–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84void __OSStopAudioSystem(void) {
85 u32 r28;
86
87#define waitUntil(load, mask) \
88 r28 = (load); \
89 while (r28 & (mask)) { \
90 r28 = (load); \
91 }
92
93 __DSPRegs[5] = 0x804;
94 r28 = __DSPRegs[27];
95 __DSPRegs[27] = r28 & ~0x8000;
96 waitUntil(__DSPRegs[5], 0x400);
97 waitUntil(__DSPRegs[5], 0x200);
98 __DSPRegs[5] = 0x8ac;
99 __DSPRegs[0] = 0;
100
101 while (((__DSPRegs[2] << 16) | __DSPRegs[3]) & 0x80000000)
102 ;
103 r28 = OSGetTick();
104 while ((s32)(OSGetTick() - r28) < 0x2c)
105 ;
106 __DSPRegs[5] |= 1;
107 waitUntil(__DSPRegs[5], 0x001);
108
109#undef waitUntil
110}
111
112#ifdef __cplusplus
113}

Callers 1

OSResetSystemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected