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

Function AIInit

src/dolphin/src/ai/ai.c:186–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186void AIInit(u8* stack)
187{
188 if (__AI_init_flag == TRUE)
189 {
190 return;
191 }
192
193 OSRegisterVersion(__AIVersion);
194 bound_32KHz = OSNanosecondsToTicks(31524);
195 bound_48KHz = OSNanosecondsToTicks(42024);
196 min_wait = OSNanosecondsToTicks(42000);
197 max_wait = OSNanosecondsToTicks(63000);
198 buffer = OSNanosecondsToTicks(3000);
199
200 AISetStreamVolRight(0);
201 AISetStreamVolLeft(0);
202 __AIRegs[3] = 0;
203 __AIRegs[0] = (__AIRegs[0] & ~0x20) | 0x20;
204 __AI_set_stream_sample_rate(1);
205 AISetDSPSampleRate(0);
206 __AIS_Callback = 0;
207 __AID_Callback = 0;
208 __CallbackStack = stack;
209 __OSSetInterruptHandler(5, __AIDHandler);
210 __OSUnmaskInterrupts(0x04000000);
211 __OSSetInterruptHandler(8, __AISHandler);
212 __OSUnmaskInterrupts(0x800000);
213 __AI_init_flag = TRUE;
214}
215
216void __AISHandler(s16 interrupt, OSContext* context)
217{

Callers 1

iSndInitFunction · 0.85

Calls 6

OSRegisterVersionFunction · 0.85
AISetStreamVolRightFunction · 0.85
AISetStreamVolLeftFunction · 0.85
AISetDSPSampleRateFunction · 0.85
__OSUnmaskInterruptsFunction · 0.85

Tested by

no test coverage detected