Place function table after the executable.

This commit is contained in:
Skyth
2025-01-15 02:01:59 +03:00
parent 0e8dbe797b
commit 27a541b7a3
5 changed files with 12 additions and 9 deletions

View File

@@ -1679,7 +1679,8 @@ static uint32_t CreateDevice(uint32_t a1, uint32_t a2, uint32_t a3, uint32_t a4,
auto device = g_userHeap.AllocPhysical<GuestDevice>();
memset(device, 0, sizeof(*device));
uint32_t functionOffset = 0x443344; // D3D
// Append render state functions to the end of guest function table.
uint32_t functionOffset = PPC_CODE_BASE + PPC_CODE_SIZE;
g_memory.InsertFunction(functionOffset, HostToGuestFunction<SetRenderStateUnimplemented>);
for (size_t i = 0; i < std::size(device->setRenderStateFunctions); i++)