| 90 | } |
| 91 | |
| 92 | void AISetDSPSampleRate(u32 rate) |
| 93 | { |
| 94 | u32 state; |
| 95 | s32 oldInts; |
| 96 | u8 left; |
| 97 | u8 right; |
| 98 | u32 sampleRate; |
| 99 | |
| 100 | if (rate == AIGetDSPSampleRate()) |
| 101 | { |
| 102 | return; |
| 103 | } |
| 104 | |
| 105 | __AIRegs[0] &= ~0x40; |
| 106 | if (rate == 0) |
| 107 | { |
| 108 | left = AIGetStreamVolLeft(); |
| 109 | right = AIGetStreamVolRight(); |
| 110 | state = AIGetStreamPlayState(); |
| 111 | sampleRate = AIGetStreamSampleRate(); |
| 112 | AISetStreamVolLeft(0); |
| 113 | AISetStreamVolRight(0); |
| 114 | oldInts = OSDisableInterrupts(); |
| 115 | __AI_SRC_INIT(); |
| 116 | __AIRegs[0] = (__AIRegs[0] & ~0x20) | 0x20; |
| 117 | __AIRegs[0] = (__AIRegs[0] & ~2) | (sampleRate * 2); |
| 118 | __AIRegs[0] = (__AIRegs[0] & ~1) | state; |
| 119 | __AIRegs[0] |= 0x40; |
| 120 | OSRestoreInterrupts(oldInts); |
| 121 | AISetStreamVolLeft(left); |
| 122 | AISetStreamVolRight(right); |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | u32 AIGetDSPSampleRate() |
| 127 | { |
no test coverage detected