sceSas : should be always delay thread

This commit is contained in:
raven02 2014-02-04 19:57:27 +08:00
parent 536fcbd719
commit 3f20b5ad77
3 changed files with 4 additions and 26 deletions

View file

@ -131,16 +131,8 @@ u32 _sceSasCore(u32 core, u32 outAddr) {
bool ret = sas->Mix(outAddr);
// Actual delay time seems to between 240 and 1000 us, based on grain and possibly other factors.
// When there's no voicesPlayingCount , we return as no delay and fixes issue #2304.
// Note that Mix() returns true in this case when no voicesPlayingCount.
if (ret) {
// If voicesPlayingCount == 0 , no delay
return 0;
} else {
// if voicesPlayingCount > 0 , delay 240 us and reschedule
return hleDelayResult(0, "sas core", 240);
}
}
// Another way of running the mixer, the inoutAddr should be both input and output
u32 _sceSasCoreWithMix(u32 core, u32 inoutAddr, int leftVolume, int rightVolume) {
@ -152,16 +144,8 @@ u32 _sceSasCoreWithMix(u32 core, u32 inoutAddr, int leftVolume, int rightVolume)
bool ret = sas->Mix(inoutAddr, inoutAddr, leftVolume, rightVolume);
// Actual delay time seems to between 240 and 1000 us, based on grain and possibly other factors.
// When there's no voicesPlayingCount , we return as no delay and fixes issue #2304.
// Note that Mix() returns true in this case when no voicesPlayingCount.
if (ret) {
// If voicesPlayingCount == 0 , no delay
return 0;
} else {
// if voicesPlayingCount > 0 , delay 240 us and reschedule
return hleDelayResult(0, "sas core", 240);
}
}
u32 sceSasSetVoice(u32 core, int voiceNum, u32 vagAddr, int size, int loop) {
DEBUG_LOG(SCESAS, "sceSasSetVoice(%08x, %i, %08x, %i, %i)", core, voiceNum, vagAddr, size, loop);

View file

@ -471,7 +471,7 @@ void SasInstance::MixVoice(SasVoice &voice) {
}
}
bool SasInstance::Mix(u32 outAddr, u32 inAddr, int leftVol, int rightVol) {
void SasInstance::Mix(u32 outAddr, u32 inAddr, int leftVol, int rightVol) {
int voicesPlayingCount = 0;
for (int v = 0; v < PSP_SAS_VOICES_MAX; v++) {
@ -519,12 +519,6 @@ bool SasInstance::Mix(u32 outAddr, u32 inAddr, int leftVol, int rightVol) {
#ifdef AUDIO_TO_FILE
fwrite(Memory::GetPointer(outAddr), 1, grainSize * 2 * 2, audioDump);
#endif
if (voicesPlayingCount == 0) {
return true;
} else {
return false;
}
}
void SasInstance::ApplyReverb() {

View file

@ -276,7 +276,7 @@ public:
FILE *audioDump;
bool Mix(u32 outAddr, u32 inAddr = 0, int leftVol = 0, int rightVol = 0);
void Mix(u32 outAddr, u32 inAddr = 0, int leftVol = 0, int rightVol = 0);
void MixVoice(SasVoice &voice);
// Applies reverb to send buffer, according to waveformEffect.