mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-04-28 13:27:58 +03:00
Add temporary fix for audio driver loop.
This commit is contained in:
parent
81d737e14f
commit
bba19ad66d
1 changed files with 5 additions and 4 deletions
|
@ -41,22 +41,23 @@ class VoiceCallback : public IXAudio2VoiceCallback
|
|||
void OnVoiceError(void* pBufferContext, HRESULT Error) override {}
|
||||
} gVoiceCallback;
|
||||
|
||||
inline PPC_FUNC(DriverLoop)
|
||||
PPC_FUNC(DriverLoop)
|
||||
{
|
||||
GuestThread::SetThreadName(GetCurrentThreadId(), "Audio Driver");
|
||||
|
||||
auto* cpu = GetPPCContext();
|
||||
while (true)
|
||||
{
|
||||
if (!g_clientCallback)
|
||||
{
|
||||
// NOTE: This if statement doesn't get compiled in without this barrier. What?
|
||||
_ReadBarrier();
|
||||
continue;
|
||||
}
|
||||
|
||||
WaitForSingleObject(g_audioSemaphore, INFINITE);
|
||||
|
||||
cpu->r3.u64 = g_clientCallbackParam;
|
||||
GuestCode::Run(g_clientCallback, cpu);
|
||||
ctx.r3.u64 = g_clientCallbackParam;
|
||||
GuestCode::Run(g_clientCallback, &ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue