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

Function __AI_set_stream_sample_rate

src/dolphin/src/ai/ai.c:131–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void __AI_set_stream_sample_rate(u32 rate)
132{
133 s32 oldInts;
134 s32 state;
135 u8 left;
136 u8 right;
137 s32 temp_r26;
138
139 if (rate == AIGetStreamSampleRate())
140 {
141 return;
142 }
143 state = AIGetStreamPlayState();
144 left = AIGetStreamVolLeft();
145 right = AIGetStreamVolRight();
146 AISetStreamVolRight(0);
147 AISetStreamVolLeft(0);
148 temp_r26 = __AIRegs[0] & 0x40;
149 __AIRegs[0] &= ~0x40;
150 oldInts = OSDisableInterrupts();
151 __AI_SRC_INIT();
152 __AIRegs[0] |= temp_r26;
153 __AIRegs[0] = (__AIRegs[0] & ~0x20) | 0x20;
154 __AIRegs[0] = (__AIRegs[0] & ~2) | (rate * 2);
155 OSRestoreInterrupts(oldInts);
156 AISetStreamPlayState(state);
157 AISetStreamVolLeft(left);
158 AISetStreamVolRight(right);
159}
160
161u32 AIGetStreamSampleRate()
162{

Callers 1

AIInitFunction · 0.85

Calls 8

AIGetStreamSampleRateFunction · 0.85
AIGetStreamPlayStateFunction · 0.85
AIGetStreamVolLeftFunction · 0.85
AIGetStreamVolRightFunction · 0.85
AISetStreamVolRightFunction · 0.85
AISetStreamVolLeftFunction · 0.85
OSDisableInterruptsFunction · 0.85
AISetStreamPlayStateFunction · 0.85

Tested by

no test coverage detected