HLE DSP: Init/deinit sources better

This commit is contained in:
wheremyfoodat 2024-04-05 20:53:17 +03:00
parent 5da93d17bd
commit 43a1c89478
2 changed files with 17 additions and 2 deletions

View file

@ -14,6 +14,13 @@ namespace Audio {
};
}
HLE_DSP::HLE_DSP(Memory& mem, Scheduler& scheduler, DSPService& dspService) : DSPCore(mem, scheduler, dspService) {
// Set up source indices
for (int i = 0; i < sources.size(); i++) {
sources[i].index = i;
}
}
void HLE_DSP::resetAudioPipe() {
#define DSPOffset(var) (0x8000 + offsetof(Audio::HLE::SharedMemory, var) / 2)
@ -56,6 +63,10 @@ namespace Audio {
e.clear();
}
for (auto& source : sources) {
source.reset();
}
// Note: Reset audio pipe AFTER resetting all pipes, otherwise the new data will be yeeted
resetAudioPipe();
}
@ -189,6 +200,7 @@ namespace Audio {
SharedMemory& write = writeRegion();
for (int source = 0; source < sourceCount; source++) {
//updateSourceConfig(sources[source]);
Helpers::panic("Panda");
}
}