mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-08 07:05:40 +12:00
FIx DSP region calculation
This commit is contained in:
parent
908222f26f
commit
c7db6fe5dc
2 changed files with 7 additions and 1 deletions
|
@ -142,7 +142,7 @@ namespace Audio {
|
||||||
} else if (counter1 == 0xffff && counter0 != 0xfffe) {
|
} else if (counter1 == 0xffff && counter0 != 0xfffe) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return counter0 > counter1 ? 0 : 0;
|
return counter0 > counter1 ? 0 : 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -216,6 +216,11 @@ namespace Audio {
|
||||||
SharedMemory& read = readRegion();
|
SharedMemory& read = readRegion();
|
||||||
SharedMemory& write = writeRegion();
|
SharedMemory& write = writeRegion();
|
||||||
|
|
||||||
|
// TODO: Properly implement mixers
|
||||||
|
// The DSP checks the DSP configuration dirty bits on every frame, applies them, and clears them
|
||||||
|
read.dspConfiguration.dirtyRaw = 0;
|
||||||
|
// read.dspConfiguration.dirtyRaw2 = 0;
|
||||||
|
|
||||||
for (int i = 0; i < sourceCount; i++) {
|
for (int i = 0; i < sourceCount; i++) {
|
||||||
// Update source configuration from the read region of shared memory
|
// Update source configuration from the read region of shared memory
|
||||||
auto& config = read.sourceConfigurations.config[i];
|
auto& config = read.sourceConfigurations.config[i];
|
||||||
|
@ -401,6 +406,7 @@ namespace Audio {
|
||||||
// samples.insert(samples.end(), source.currentSamples.begin(), source.currentSamples.begin() + sampleCount);
|
// samples.insert(samples.end(), source.currentSamples.begin(), source.currentSamples.begin() + sampleCount);
|
||||||
source.currentSamples.erase(source.currentSamples.begin(), source.currentSamples.begin() + sampleCount);
|
source.currentSamples.erase(source.currentSamples.begin(), source.currentSamples.begin() + sampleCount);
|
||||||
|
|
||||||
|
source.samplePosition += sampleCount;
|
||||||
outputCount += sampleCount;
|
outputCount += sampleCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue