| 190 | } |
| 191 | |
| 192 | void finishDSPFrame() { |
| 193 | int dacIdx = sDspDacWriteBuffer + 1; |
| 194 | if (dacIdx == sDspDacBufferCount) { |
| 195 | dacIdx = 0; |
| 196 | } |
| 197 | if (dacIdx == sDspDacReadBuffer) { |
| 198 | sDspStatus = 0; |
| 199 | return; |
| 200 | } |
| 201 | sDspDacWriteBuffer = dacIdx; |
| 202 | JASAudioThread::setDSPSyncCount(getSubFrames()); |
| 203 | JASProbe::start(7, "DSP-MAIN"); |
| 204 | u32 frameSamples = getFrameSamples(); |
| 205 | JASDsp::syncFrame(getSubFrames(), (u32)sDspDacBuffer[sDspDacWriteBuffer], (u32)(sDspDacBuffer[sDspDacWriteBuffer] + frameSamples)); |
| 206 | sDspStatus = 1; |
| 207 | updateDSP(); |
| 208 | if (sDspDacCallback) { |
| 209 | (*sDspDacCallback)(sDspDacBuffer[sDspDacWriteBuffer], frameSamples); |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | void setSubFrames(u32 frames) { // UNUSED |
| 214 | sSubFrames = frames; |
no test coverage detected