Remove GetViewportOffsetAndScale patches

This commit is contained in:
Anthony Miles 2020-02-16 19:47:56 +13:00
parent f48b9478ac
commit 605c31af46
3 changed files with 76 additions and 76 deletions

View File

@ -4092,81 +4092,6 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_SetViewport)
UpdateViewPortOffsetAndScaleConstants();
}
// LTCG specific D3DDevice_GetViewportOffsetAndScale function...
// This function is still not working so should be investigated...
// This uses a custom calling convention where parameter is passed in EDX, ECX
// Test-case: RalliSport Challenge 2
VOID __stdcall XTL::EMUPATCH(D3DDevice_GetViewportOffsetAndScale_0)
(
)
{
D3DXVECTOR4 *pOffset;
D3DXVECTOR4 *pScale;
__asm {
mov pScale, ecx
mov pOffset, edx
}
return EMUPATCH(D3DDevice_GetViewportOffsetAndScale)(pOffset, pScale);
}
// ******************************************************************
// * patch: D3DDevice_GetViewportOffsetAndScale
// ******************************************************************
VOID WINAPI XTL::EMUPATCH(D3DDevice_GetViewportOffsetAndScale)
(
X_D3DXVECTOR4 *pOffset,
X_D3DXVECTOR4 *pScale
)
{
LOG_FUNC_BEGIN
LOG_FUNC_ARG(pOffset)
LOG_FUNC_ARG(pScale)
LOG_FUNC_END;
// LOG_TEST_CASE("D3DDevice_GetViewportOffsetAndScale"); // Get us some test-cases
// Test case : 007: From Russia with Love
// Test case : Army Men?: Sarge's War
// Test case : BeatDown - Fists of Vengeance
// Test case : Big Mutha Truckers
// Test case : Big Mutha Truckers 2
// Test case : Classified : The Sentinel Crisis
// Test case : Cold Fear
// Test case : Commandos SF
// Test case : Darkwatch
// Test case : Dr.Muto
// Test case : GTA : Vice City
// Test case : Jacked
// Test case : Madagascar
// Test case : Max Payne 2
// Test case : NBA LIVE 2005
// Test case : NFS : Underground
// Test case : NFS : Underground 2
// Test case : PoP : The Sands of Time
// Test case : Prince of Persia : T2T - see #1109 (comment)
// Test case : RPM Tuning
// Test case : Street Racing Syndicate
// Test case : Spongebob - Battle for Bikini Bottom
// Test case : The Incredibles : Rise of the Underminer
// Test case : The SpongeBob SquarePants Movie
// Test case : TMNT(R)2
// Test case : TMNT(R)3
float vOffset[4], vScale[4];
GetViewPortOffsetAndScale(vOffset, vScale);
pOffset->x = vOffset[0];
pOffset->y = vOffset[1];
pOffset->z = vOffset[2];
pOffset->w = vOffset[3];
pScale->x = vScale[0];
pScale->y = vScale[1];
pScale->z = vScale[2];
pScale->w = vScale[3];
}
// LTCG specific D3DDevice_SetShaderConstantMode function...
// This uses a custom calling convention where parameter is passed in EAX
VOID __stdcall XTL::EMUPATCH(D3DDevice_SetShaderConstantMode_0)

View File

@ -3968,3 +3968,78 @@ VOID WINAPI XTL::EMUPATCH(D3DDevice_GetVertexShaderType)
}
}
}
// LTCG specific D3DDevice_GetViewportOffsetAndScale function...
// This function is still not working so should be investigated...
// This uses a custom calling convention where parameter is passed in EDX, ECX
// Test-case: RalliSport Challenge 2
VOID __stdcall XTL::EMUPATCH(D3DDevice_GetViewportOffsetAndScale_0)
(
)
{
D3DXVECTOR4 *pOffset;
D3DXVECTOR4 *pScale;
__asm {
mov pScale, ecx
mov pOffset, edx
}
return EMUPATCH(D3DDevice_GetViewportOffsetAndScale)(pOffset, pScale);
}
// ******************************************************************
// * patch: D3DDevice_GetViewportOffsetAndScale
// ******************************************************************
VOID WINAPI XTL::EMUPATCH(D3DDevice_GetViewportOffsetAndScale)
(
X_D3DXVECTOR4 *pOffset,
X_D3DXVECTOR4 *pScale
)
{
LOG_FUNC_BEGIN
LOG_FUNC_ARG(pOffset)
LOG_FUNC_ARG(pScale)
LOG_FUNC_END;
// LOG_TEST_CASE("D3DDevice_GetViewportOffsetAndScale"); // Get us some test-cases
// Test case : 007: From Russia with Love
// Test case : Army Men?: Sarge's War
// Test case : BeatDown - Fists of Vengeance
// Test case : Big Mutha Truckers
// Test case : Big Mutha Truckers 2
// Test case : Classified : The Sentinel Crisis
// Test case : Cold Fear
// Test case : Commandos SF
// Test case : Darkwatch
// Test case : Dr.Muto
// Test case : GTA : Vice City
// Test case : Jacked
// Test case : Madagascar
// Test case : Max Payne 2
// Test case : NBA LIVE 2005
// Test case : NFS : Underground
// Test case : NFS : Underground 2
// Test case : PoP : The Sands of Time
// Test case : Prince of Persia : T2T - see #1109 (comment)
// Test case : RPM Tuning
// Test case : Street Racing Syndicate
// Test case : Spongebob - Battle for Bikini Bottom
// Test case : The Incredibles : Rise of the Underminer
// Test case : The SpongeBob SquarePants Movie
// Test case : TMNT(R)2
// Test case : TMNT(R)3
float vOffset[4], vScale[4];
GetViewPortOffsetAndScale(vOffset, vScale);
pOffset->x = vOffset[0];
pOffset->y = vOffset[1];
pOffset->z = vOffset[2];
pOffset->w = vOffset[3];
pScale->x = vScale[0];
pScale->y = vScale[1];
pScale->z = vScale[2];
pScale->w = vScale[3];
}

View File

@ -97,7 +97,7 @@ std::map<const std::string, const xbox_patch_t> g_PatchTable = {
PATCH_ENTRY("D3DDevice_GetVertexShaderInput", XTL::EMUPATCH(D3DDevice_GetVertexShaderInput), PATCH_HLE_D3D),
//PATCH_ENTRY("D3DDevice_GetVertexShaderSize", XTL::EMUPATCH(D3DDevice_GetVertexShaderSize), PATCH_HLE_D3D),
//PATCH_ENTRY("D3DDevice_GetVertexShaderType", XTL::EMUPATCH(D3DDevice_GetVertexShaderType), PATCH_HLE_D3D),
PATCH_ENTRY("D3DDevice_GetViewportOffsetAndScale", XTL::EMUPATCH(D3DDevice_GetViewportOffsetAndScale), PATCH_HLE_D3D),
//PATCH_ENTRY("D3DDevice_GetViewportOffsetAndScale", XTL::EMUPATCH(D3DDevice_GetViewportOffsetAndScale), PATCH_HLE_D3D),
PATCH_ENTRY("D3DDevice_GetVisibilityTestResult", XTL::EMUPATCH(D3DDevice_GetVisibilityTestResult), PATCH_HLE_D3D),
PATCH_ENTRY("D3DDevice_InsertCallback", XTL::EMUPATCH(D3DDevice_InsertCallback), PATCH_HLE_D3D),
PATCH_ENTRY("D3DDevice_InsertFence", XTL::EMUPATCH(D3DDevice_InsertFence), PATCH_HLE_D3D),