mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-01-06 03:29:55 -06:00
Combine guest memory and function table into one virtual allocation.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
#include <bit>
|
||||
|
||||
#include "audio.h"
|
||||
#include "cpu/code_cache.h"
|
||||
#include <kernel/memory.h>
|
||||
|
||||
#define AUDIO_DRIVER_KEY (uint32_t)('DAUD')
|
||||
|
||||
@@ -21,7 +21,7 @@ uint32_t XAudioRegisterRenderDriverClient(be<uint32_t>* callback, be<uint32_t>*
|
||||
#endif
|
||||
|
||||
*driver = AUDIO_DRIVER_KEY;
|
||||
XAudioRegisterClient(KeFindHostFunction(*callback), callback[1]);
|
||||
XAudioRegisterClient(g_memory.FindFunction(*callback), callback[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "sdl2_driver.h"
|
||||
#include <cpu/code_cache.h>
|
||||
#include <cpu/guest_thread.h>
|
||||
#include <cpu/guest_code.h>
|
||||
#include <kernel/heap.h>
|
||||
|
||||
static PPCFunc* g_clientCallback{};
|
||||
@@ -50,7 +48,7 @@ static void AudioThread()
|
||||
if ((queuedAudioSize / callbackAudioSize) <= MAX_LATENCY)
|
||||
{
|
||||
ctx.ppcContext.r3.u32 = g_clientCallbackParam;
|
||||
g_clientCallback(ctx.ppcContext, reinterpret_cast<uint8_t*>(g_memory.base));
|
||||
g_clientCallback(ctx.ppcContext, g_memory.base);
|
||||
}
|
||||
|
||||
auto now = std::chrono::steady_clock::now();
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#include <stdafx.h>
|
||||
#include "xaudio_driver.h"
|
||||
#include <xaudio2.h>
|
||||
#include <cpu/code_cache.h>
|
||||
#include <cpu/guest_thread.h>
|
||||
#include <cpu/guest_code.h>
|
||||
#include <cpu/ppc_context.h>
|
||||
#include <kernel/heap.h>
|
||||
|
||||
@@ -55,7 +53,7 @@ PPC_FUNC(DriverLoop)
|
||||
WaitForSingleObject(g_audioSemaphore, INFINITE);
|
||||
|
||||
ctx.r3.u64 = g_clientCallbackParam;
|
||||
GuestCode::Run((void*)g_clientCallback, &ctx);
|
||||
g_clientCallback(ctx, g_memory.base);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user