Implemented D3DDevice_DrawVerticesUP_12

LTCG version of D3DDevice_DrawVerticesUP which passes
pVertexStreamZeroData in EBX
This commit is contained in:
Silent 2020-10-07 18:56:29 +02:00
parent 05bae29ec3
commit 13d79192c8
No known key found for this signature in database
GPG Key ID: AE53149BB0C45AF1
3 changed files with 27 additions and 0 deletions

View File

@ -7489,6 +7489,24 @@ xbox::void_xt WINAPI xbox::EMUPATCH(D3DDevice_DrawVerticesUP)
CxbxHandleXboxCallbacks(); CxbxHandleXboxCallbacks();
} }
// LTCG specific D3DDevice_DrawVerticesUP function...
// This uses a custom calling convention where pVertexStreamZeroData is passed in EBX
// Test-case: NASCAR Heat 20002
xbox::void_xt WINAPI xbox::EMUPATCH(D3DDevice_DrawVerticesUP_12)
(
X_D3DPRIMITIVETYPE PrimitiveType,
uint_xt VertexCount,
uint_xt VertexStreamZeroStride
)
{
PVOID pVertexStreamZeroData;
__asm mov pVertexStreamZeroData, ebx
LOG_FORWARD("D3DDevice_DrawVerticesUP");
EMUPATCH(D3DDevice_DrawVerticesUP)(PrimitiveType, VertexCount, pVertexStreamZeroData, VertexStreamZeroStride);
}
// ****************************************************************** // ******************************************************************
// * patch: D3DDevice_DrawIndexedVertices // * patch: D3DDevice_DrawIndexedVertices
// ****************************************************************** // ******************************************************************

View File

@ -1429,6 +1429,14 @@ xbox::void_xt WINAPI EMUPATCH(D3DDevice_DrawVerticesUP)
uint_xt VertexStreamZeroStride uint_xt VertexStreamZeroStride
); );
xbox::void_xt WINAPI EMUPATCH(D3DDevice_DrawVerticesUP_12)
(
X_D3DPRIMITIVETYPE PrimitiveType,
uint_xt VertexCount,
uint_xt VertexStreamZeroStride
);
// ****************************************************************** // ******************************************************************
// * patch: D3DDevice_DrawIndexedVertices // * patch: D3DDevice_DrawIndexedVertices
// ****************************************************************** // ******************************************************************

View File

@ -74,6 +74,7 @@ std::map<const std::string, const xbox_patch_t> g_PatchTable = {
PATCH_ENTRY("D3DDevice_DrawVertices", xbox::EMUPATCH(D3DDevice_DrawVertices), PATCH_HLE_D3D), PATCH_ENTRY("D3DDevice_DrawVertices", xbox::EMUPATCH(D3DDevice_DrawVertices), PATCH_HLE_D3D),
PATCH_ENTRY("D3DDevice_DrawVertices_4", xbox::EMUPATCH(D3DDevice_DrawVertices_4), PATCH_HLE_D3D), PATCH_ENTRY("D3DDevice_DrawVertices_4", xbox::EMUPATCH(D3DDevice_DrawVertices_4), PATCH_HLE_D3D),
PATCH_ENTRY("D3DDevice_DrawVerticesUP", xbox::EMUPATCH(D3DDevice_DrawVerticesUP), PATCH_HLE_D3D), PATCH_ENTRY("D3DDevice_DrawVerticesUP", xbox::EMUPATCH(D3DDevice_DrawVerticesUP), PATCH_HLE_D3D),
PATCH_ENTRY("D3DDevice_DrawVerticesUP_12", xbox::EMUPATCH(D3DDevice_DrawVerticesUP_12), PATCH_HLE_D3D),
PATCH_ENTRY("D3DDevice_EnableOverlay", xbox::EMUPATCH(D3DDevice_EnableOverlay), PATCH_HLE_D3D), PATCH_ENTRY("D3DDevice_EnableOverlay", xbox::EMUPATCH(D3DDevice_EnableOverlay), PATCH_HLE_D3D),
PATCH_ENTRY("D3DDevice_End", xbox::EMUPATCH(D3DDevice_End), PATCH_HLE_D3D), PATCH_ENTRY("D3DDevice_End", xbox::EMUPATCH(D3DDevice_End), PATCH_HLE_D3D),
PATCH_ENTRY("D3DDevice_EndPush", xbox::EMUPATCH(D3DDevice_EndPush), PATCH_HLE_D3D), PATCH_ENTRY("D3DDevice_EndPush", xbox::EMUPATCH(D3DDevice_EndPush), PATCH_HLE_D3D),