Fix wrong D3DDevice_SetVertexShaderConstant_8 implementation

The assumption that one of the parameters has to be taken from EDX
was correct, but the function was not implemented properly
This commit is contained in:
Silent 2020-10-06 19:12:17 +02:00
parent 3fdfa89812
commit 556a65f1dc
No known key found for this signature in database
GPG Key ID: AE53149BB0C45AF1
2 changed files with 20 additions and 16 deletions

View File

@ -4189,26 +4189,23 @@ xbox::hresult_xt WINAPI xbox::EMUPATCH(D3DDevice_CreateVertexShader)
} }
// LTCG specific D3DDevice_SetVertexShaderConstant function... // LTCG specific D3DDevice_SetVertexShaderConstant function...
// This uses a custom calling convention where parameter is passed in EDX // This uses a custom calling convention where ConstantCount parameter is passed in EDX
// Test-case: Murakumo // Test-case: Murakumo
xbox::void_xt __stdcall xbox::EMUPATCH(D3DDevice_SetVertexShaderConstant_8) xbox::void_xt __fastcall xbox::EMUPATCH(D3DDevice_SetVertexShaderConstant_8)
( (
void*,
dword_xt ConstantCount,
int_xt Register,
CONST PVOID pConstantData
) )
{ {
static uint32_t returnAddr; LOG_FUNC_BEGIN
LOG_FUNC_ARG(Register)
LOG_FUNC_ARG(pConstantData)
LOG_FUNC_ARG(ConstantCount)
LOG_FUNC_END;
#ifdef _DEBUG_TRACE CxbxImpl_SetVertexShaderConstant(Register, pConstantData, ConstantCount);
__asm add esp, 4
#endif
__asm {
pop returnAddr
push edx
call EmuPatch_D3DDevice_SetVertexShaderConstant
mov eax, 0
push returnAddr
ret
}
} }
// ****************************************************************** // ******************************************************************

View File

@ -444,7 +444,14 @@ xbox::void_xt WINAPI EMUPATCH(D3DDevice_SetVertexShaderConstant)
dword_xt ConstantCount dword_xt ConstantCount
); );
xbox::void_xt __stdcall EMUPATCH(D3DDevice_SetVertexShaderConstant_8)(); xbox::void_xt __fastcall EMUPATCH(D3DDevice_SetVertexShaderConstant_8)
(
void*,
dword_xt ConstantCount,
int_xt Register,
CONST PVOID pConstantData
);
// ****************************************************************** // ******************************************************************
// * patch: D3DDevice_SetVertexShaderConstant1 // * patch: D3DDevice_SetVertexShaderConstant1