mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-27 04:41:39 +00: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 {}
|
void OnVoiceError(void* pBufferContext, HRESULT Error) override {}
|
||||||
} gVoiceCallback;
|
} gVoiceCallback;
|
||||||
|
|
||||||
inline PPC_FUNC(DriverLoop)
|
PPC_FUNC(DriverLoop)
|
||||||
{
|
{
|
||||||
GuestThread::SetThreadName(GetCurrentThreadId(), "Audio Driver");
|
GuestThread::SetThreadName(GetCurrentThreadId(), "Audio Driver");
|
||||||
|
|
||||||
auto* cpu = GetPPCContext();
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
if (!g_clientCallback)
|
if (!g_clientCallback)
|
||||||
{
|
{
|
||||||
|
// NOTE: This if statement doesn't get compiled in without this barrier. What?
|
||||||
|
_ReadBarrier();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
WaitForSingleObject(g_audioSemaphore, INFINITE);
|
WaitForSingleObject(g_audioSemaphore, INFINITE);
|
||||||
|
|
||||||
cpu->r3.u64 = g_clientCallbackParam;
|
ctx.r3.u64 = g_clientCallbackParam;
|
||||||
GuestCode::Run(g_clientCallback, cpu);
|
GuestCode::Run(g_clientCallback, &ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue