Add two more LTCG specific patches
This commit is contained in:
parent
f9a3fde976
commit
511fd017f5
|
@ -2456,10 +2456,7 @@ void Direct3D_CreateDevice_End()
|
|||
// Set g_XboxD3DDevice to point to the Xbox D3D Device
|
||||
auto it = g_SymbolAddresses.find("D3DDEVICE");
|
||||
if (it != g_SymbolAddresses.end()) {
|
||||
xbaddr dwD3DDevice = it->second;
|
||||
if (dwD3DDevice != xbnull) {
|
||||
g_XboxD3DDevice = *((DWORD**)dwD3DDevice);
|
||||
}
|
||||
g_XboxD3DDevice = (DWORD*)it->second;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2515,6 +2512,35 @@ HRESULT WINAPI XTL::EMUPATCH(Direct3D_CreateDevice_16)
|
|||
return hRet;
|
||||
}
|
||||
|
||||
// ******************************************************************
|
||||
// * patch: D3DDevice_SetIndices_4
|
||||
// LTCG specific D3DDevice_SetIndices function...
|
||||
// This uses a custom calling convention where parameter is passed in EBX and Stack
|
||||
// Test Case: Conker
|
||||
// ******************************************************************
|
||||
VOID WINAPI XTL::EMUPATCH(D3DDevice_SetIndices_4)
|
||||
(
|
||||
UINT BaseVertexIndex
|
||||
)
|
||||
{
|
||||
X_D3DIndexBuffer *pIndexData;
|
||||
|
||||
__asm {
|
||||
mov pIndexData, ebx
|
||||
}
|
||||
// Cache the base vertex index
|
||||
g_XboxBaseVertexIndex = BaseVertexIndex;
|
||||
|
||||
// Call LTCG-specific trampoline
|
||||
XB_trampoline(VOID, WINAPI, D3DDevice_SetIndices_4, (UINT));
|
||||
__asm {
|
||||
mov ebx, pIndexData
|
||||
push BaseVertexIndex
|
||||
call XB_D3DDevice_SetIndices_4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ******************************************************************
|
||||
// * patch: D3DDevice_SetIndices
|
||||
// ******************************************************************
|
||||
|
@ -7436,6 +7462,27 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetPixelShader)
|
|||
D3DDevice_SetPixelShaderCommon(Handle);
|
||||
}
|
||||
|
||||
// ******************************************************************
|
||||
// * patch: D3DDevice_DrawVertices_4
|
||||
// LTCG specific D3DDevice_DrawVertices function...
|
||||
// This uses a custom calling convention where parameter is passed in ECX, EAX and Stack
|
||||
// Test Case: Conker
|
||||
// ******************************************************************
|
||||
VOID WINAPI XTL::EMUPATCH(D3DDevice_DrawVertices_4)
|
||||
(
|
||||
X_D3DPRIMITIVETYPE PrimitiveType
|
||||
)
|
||||
{
|
||||
UINT VertexCount;
|
||||
UINT StartVertex;
|
||||
|
||||
_asm {
|
||||
mov VertexCount, eax
|
||||
mov StartVertex, ecx
|
||||
}
|
||||
|
||||
EMUPATCH(D3DDevice_DrawVertices)(PrimitiveType, StartVertex, VertexCount);
|
||||
}
|
||||
|
||||
// ******************************************************************
|
||||
// * patch: D3DDevice_DrawVertices
|
||||
|
|
|
@ -589,6 +589,14 @@ VOID WINAPI EMUPATCH(D3DDevice_SetIndices)
|
|||
X_D3DIndexBuffer *pIndexData,
|
||||
UINT BaseVertexIndex
|
||||
);
|
||||
|
||||
// ******************************************************************
|
||||
// * patch: D3DDevice_SetIndices_4
|
||||
// ******************************************************************
|
||||
VOID WINAPI EMUPATCH(D3DDevice_SetIndices_4)
|
||||
(
|
||||
UINT BaseVertexIndex
|
||||
);
|
||||
|
||||
// ******************************************************************
|
||||
// * patch: D3DDevice_SetTexture
|
||||
|
@ -1368,6 +1376,14 @@ VOID WINAPI EMUPATCH(D3DDevice_DrawVertices)
|
|||
X_D3DPRIMITIVETYPE PrimitiveType,
|
||||
UINT StartVertex,
|
||||
UINT VertexCount
|
||||
);
|
||||
|
||||
// ******************************************************************
|
||||
// * patch: D3DDevice_DrawVertices_4
|
||||
// ******************************************************************
|
||||
VOID WINAPI EMUPATCH(D3DDevice_DrawVertices_4)
|
||||
(
|
||||
X_D3DPRIMITIVETYPE PrimitiveType
|
||||
);
|
||||
|
||||
// ******************************************************************
|
||||
|
|
|
@ -71,7 +71,8 @@ std::map<const std::string, const xbox_patch_t> g_PatchTable = {
|
|||
PATCH_ENTRY("D3DDevice_DrawIndexedVerticesUP", XTL::EMUPATCH(D3DDevice_DrawIndexedVerticesUP), PATCH_HLE_D3D),
|
||||
PATCH_ENTRY("D3DDevice_DrawRectPatch", XTL::EMUPATCH(D3DDevice_DrawRectPatch), PATCH_HLE_D3D),
|
||||
PATCH_ENTRY("D3DDevice_DrawTriPatch", XTL::EMUPATCH(D3DDevice_DrawTriPatch), PATCH_HLE_D3D),
|
||||
PATCH_ENTRY("D3DDevice_DrawVertices", XTL::EMUPATCH(D3DDevice_DrawVertices), PATCH_HLE_D3D),
|
||||
PATCH_ENTRY("D3DDevice_DrawVertices", XTL::EMUPATCH(D3DDevice_DrawVertices), PATCH_HLE_D3D),
|
||||
PATCH_ENTRY("D3DDevice_DrawVertices_4", XTL::EMUPATCH(D3DDevice_DrawVertices_4), PATCH_HLE_D3D),
|
||||
PATCH_ENTRY("D3DDevice_DrawVerticesUP", XTL::EMUPATCH(D3DDevice_DrawVerticesUP), PATCH_HLE_D3D),
|
||||
PATCH_ENTRY("D3DDevice_EnableOverlay", XTL::EMUPATCH(D3DDevice_EnableOverlay), PATCH_HLE_D3D),
|
||||
PATCH_ENTRY("D3DDevice_End", XTL::EMUPATCH(D3DDevice_End), PATCH_HLE_D3D),
|
||||
|
@ -123,7 +124,8 @@ std::map<const std::string, const xbox_patch_t> g_PatchTable = {
|
|||
PATCH_ENTRY("D3DDevice_SetFlickerFilter", XTL::EMUPATCH(D3DDevice_SetFlickerFilter), PATCH_HLE_D3D),
|
||||
PATCH_ENTRY("D3DDevice_SetFlickerFilter_0", XTL::EMUPATCH(D3DDevice_SetFlickerFilter_0), PATCH_HLE_D3D),
|
||||
PATCH_ENTRY("D3DDevice_SetGammaRamp", XTL::EMUPATCH(D3DDevice_SetGammaRamp), PATCH_HLE_D3D),
|
||||
PATCH_ENTRY("D3DDevice_SetIndices", XTL::EMUPATCH(D3DDevice_SetIndices), PATCH_HLE_D3D),
|
||||
PATCH_ENTRY("D3DDevice_SetIndices", XTL::EMUPATCH(D3DDevice_SetIndices), PATCH_HLE_D3D),
|
||||
PATCH_ENTRY("D3DDevice_SetIndices_4", XTL::EMUPATCH(D3DDevice_SetIndices_4), PATCH_HLE_D3D),
|
||||
PATCH_ENTRY("D3DDevice_SetLight", XTL::EMUPATCH(D3DDevice_SetLight), PATCH_HLE_D3D),
|
||||
PATCH_ENTRY("D3DDevice_SetMaterial", XTL::EMUPATCH(D3DDevice_SetMaterial), PATCH_HLE_D3D),
|
||||
PATCH_ENTRY("D3DDevice_SetModelView", XTL::EMUPATCH(D3DDevice_SetModelView), PATCH_HLE_D3D),
|
||||
|
|
Loading…
Reference in New Issue