diff --git a/game/overlord/jak2/dma.cpp b/game/overlord/jak2/dma.cpp index 93b4942f13..4d2b7fa4f3 100644 --- a/game/overlord/jak2/dma.cpp +++ b/game/overlord/jak2/dma.cpp @@ -97,7 +97,7 @@ int SpuDmaIntr(int, void*) { // if we just finished the first upload, start playing! I'm not entirely sure if this is playing // sound yet, or if we're just looping and waiting for the second upload to actually start. - // (we don't set the appropriate volumes here, so this is probably not the real playback) + // (this is probably not the real playback) if (DmaVagCmd->num_processed_chunks == 1) { int pitch = CalculateVAGPitch(DmaVagCmd->pitch1, DmaVagCmd->unk_256_pitch2); if (!DmaStereoVagCmd) { @@ -107,6 +107,10 @@ int SpuDmaIntr(int, void*) { sceSdSetParam(SD_VP_ADSR2 | DmaVagCmd->voice, 0x1fc0); sceSdSetParam(SD_VP_PITCH | DmaVagCmd->voice, pitch); + // setting volume to 0 on first chunk to avoid unpleasant initial chirps of audio. + sceSdSetParam(SD_VP_VOLL | DmaVagCmd->voice, 0x0); + sceSdSetParam(SD_VP_VOLR | DmaVagCmd->voice, 0x0); + sceSdSetSwitch(SD_S_KON | (DmaVagCmd->voice & 1), VOICE_BIT(DmaVagCmd->voice)); } else { // same for stereo, but we start both voices. @@ -123,6 +127,12 @@ int SpuDmaIntr(int, void*) { sceSdSetParam(SD_VP_PITCH | DmaVagCmd->voice, pitch); sceSdSetParam(SD_VP_PITCH | DmaStereoVagCmd->voice, pitch); + // setting volume to 0 on first chunk to avoid unpleasant initial chirps of audio. + sceSdSetParam(SD_VP_VOLL | DmaVagCmd->voice, 0x0); + sceSdSetParam(SD_VP_VOLL | DmaStereoVagCmd->voice, 0x0); + sceSdSetParam(SD_VP_VOLR | DmaVagCmd->voice, 0x0); + sceSdSetParam(SD_VP_VOLR | DmaStereoVagCmd->voice, 0x0); + sceSdSetSwitch(SD_S_KON | (DmaVagCmd->voice & 1), VOICE_BIT(DmaVagCmd->voice) | VOICE_BIT(DmaStereoVagCmd->voice)); } diff --git a/game/system/IOP_Kernel.cpp b/game/system/IOP_Kernel.cpp index 149c1f4d7c..38acbe6abc 100644 --- a/game/system/IOP_Kernel.cpp +++ b/game/system/IOP_Kernel.cpp @@ -72,6 +72,7 @@ s32 IOP_Kernel::CreateThread(std::string name, void (*func)(), u32 priority) { * Start a thread. Marking it to run on each dispatch of the IOP kernel. */ void IOP_Kernel::StartThread(s32 id) { + threads.at(id).waitType = IopThread::Wait::None; threads.at(id).state = IopThread::State::Ready; } @@ -114,6 +115,7 @@ void IOP_Kernel::SleepThread() { void IOP_Kernel::YieldThread() { ASSERT(_currentThread); + _currentThread->waitType = IopThread::Wait::None; _currentThread->state = IopThread::State::Ready; leaveThread(); } @@ -130,6 +132,7 @@ void IOP_Kernel::WakeupThread(s32 id) { return; } + threads.at(id).waitType = IopThread::Wait::None; threads.at(id).state = IopThread::State::Ready; }