From f62109a09e541ed92c4e7dec2c42f0e6e3307cf5 Mon Sep 17 00:00:00 2001 From: RadWolfie Date: Sun, 26 Feb 2023 06:36:52 -0600 Subject: [PATCH] d3d8ltcg: update D3DDevice_SelectVertexShader_4 signatures Renamed: - D3DDevice_SelectVertexShader_4 to D3DDevice_SelectVertexShader_4__LTCG_eax1 Added: - 4039 --- src/OOVPADatabase/D3D8LTCG/3911.inl | 32 +++++++++++++----------- src/OOVPADatabase/D3D8LTCG/4039.inl | 27 ++++++++++++++++++++ src/OOVPADatabase/D3D8LTCG/4531.inl | 35 ++++++++++++++------------ src/OOVPADatabase/D3D8LTCG/4627.inl | 37 +++++++++++++++------------- src/OOVPADatabase/D3D8LTCG_OOVPA.inl | 2 +- src/test/libverify/D3D8.cpp | 2 +- 6 files changed, 86 insertions(+), 49 deletions(-) diff --git a/src/OOVPADatabase/D3D8LTCG/3911.inl b/src/OOVPADatabase/D3D8LTCG/3911.inl index 69730096..76e401c3 100644 --- a/src/OOVPADatabase/D3D8LTCG/3911.inl +++ b/src/OOVPADatabase/D3D8LTCG/3911.inl @@ -1016,22 +1016,26 @@ OOVPA_SIG_MATCH( //****************************************************************** //* D3DDevice_SelectVertexShader //****************************************************************** -//C740040600000083 ...C20400 -OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_4, - 2024) +OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_4__LTCG_eax1, + 3911) OOVPA_SIG_MATCH( - { 0x00, 0x85 }, - { 0x03, 0x8B }, - - { 0x46, 0xC7 }, - { 0x47, 0x40 }, - { 0x48, 0x04 }, - { 0x49, 0x06 }, - { 0x4A, 0x00 }, - { 0x4B, 0x00 }, - { 0x4C, 0x00 }, - { 0x4D, 0x83 }, + // test param_1,param_1 + OV_MATCH(0x00, 0x85, 0xC0), + + // mov e??,[D3D_g_pDevice] + OV_MATCH(0x03, 0x8B), + + // mov [eax],0x00081E94 + OV_MATCH(0x40, 0xC7, 0x00, 0x94, 0x1E, 0x08, 0x00), + // mov [eax + 0x4],0x6 + OV_MATCH(0x46, 0xC7, 0x40, 0x04, 0x06, 0x00), + //OV_MATCH(0x4B, 0x00, 0x00), + // add eax,0xC + OV_MATCH(0x4D, 0x83, 0xC0, 0x0C), + + // ret 0x4 + OV_MATCH(0x7B, 0xC2, 0x04), // ); diff --git a/src/OOVPADatabase/D3D8LTCG/4039.inl b/src/OOVPADatabase/D3D8LTCG/4039.inl index 5748ab85..24654a9e 100644 --- a/src/OOVPADatabase/D3D8LTCG/4039.inl +++ b/src/OOVPADatabase/D3D8LTCG/4039.inl @@ -1580,3 +1580,30 @@ OOVPA_SIG_MATCH( OV_MATCH(0x14, 0xC2, 0x08), // ); + +//****************************************************************** +//* D3DDevice_SelectVertexShader +//****************************************************************** +OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_4__LTCG_eax1, + 4039) +OOVPA_SIG_MATCH( + + // test param_1,param_1 + OV_MATCH(0x00, 0x85, 0xC0), + + // mov e??,[D3D_g_pDevice] + OV_MATCH(0x03, 0x8B), + + // mov [eax],0x00081E94 + OV_MATCH(0x4C, 0xC7, 0x00, 0x94, 0x1E, 0x08, 0x00), + // mov [eax + 0x4],0x6 + OV_MATCH(0x52, 0xC7, 0x40, 0x04, 0x06, 0x00), + //OV_MATCH(0x4B, 0x00, 0x00), + + // lea ecx,[eax + 0xC] + OV_MATCH(0x5C, 0x8D, 0x48, 0x0C), + + // ret 0x4 + OV_MATCH(0x92, 0xC2, 0x04), + // +); diff --git a/src/OOVPADatabase/D3D8LTCG/4531.inl b/src/OOVPADatabase/D3D8LTCG/4531.inl index 6e88e4d2..97fbc747 100644 --- a/src/OOVPADatabase/D3D8LTCG/4531.inl +++ b/src/OOVPADatabase/D3D8LTCG/4531.inl @@ -117,25 +117,28 @@ OOVPA_SIG_MATCH( //****************************************************************** //* D3DDevice_SelectVertexShader //****************************************************************** -//04C700941E080083 ...C20400 -OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_4, - 2048) +OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_4__LTCG_eax1, + 4531) OOVPA_SIG_MATCH( - { 0x00, 0x85 }, - { 0x01, 0xC0 }, + // test param_1,param_1 + OV_MATCH(0x00, 0x85, 0xC0), + + // mov e??,[D3D_g_pDevice] + OV_MATCH(0x03, 0x8B), - { 0x4B, 0x04 }, - { 0x4C, 0xC7 }, - { 0x4D, 0x00 }, - { 0x4E, 0x94 }, - { 0x4F, 0x1E }, - { 0x50, 0x08 }, - { 0x51, 0x00 }, - { 0x52, 0x83 }, - - { 0x95, 0xC2 }, - { 0x96, 0x04 }, + // mov [eax],0x00081E94 + OV_MATCH(0x4C, 0xC7, 0x00, 0x94, 0x1E, 0x08, 0x00), + + // mov [eax + 0x4],0x6 + OV_MATCH(0x55, 0xC7, 0x40, 0x04, 0x06, 0x00), + //OV_MATCH(0x5A, 0x00, 0x00), + + // add eax,0xC + OV_MATCH(0x5F, 0x83, 0xC0, 0x0C), + + // ret + OV_MATCH(0x95, 0xC2, 0x04), // ); diff --git a/src/OOVPADatabase/D3D8LTCG/4627.inl b/src/OOVPADatabase/D3D8LTCG/4627.inl index 6b19dbd3..4678da5b 100644 --- a/src/OOVPADatabase/D3D8LTCG/4627.inl +++ b/src/OOVPADatabase/D3D8LTCG/4627.inl @@ -1281,25 +1281,28 @@ OOVPA_SIG_MATCH( // ****************************************************************** // * D3DDevice_SelectVertexShader // ****************************************************************** -//04C700941E080083 ...C20400 -OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_4, - 2060) +OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_4__LTCG_eax1, + 4627) OOVPA_SIG_MATCH( - { 0x00, 0x85 }, - { 0x01, 0xC0 }, - - { 0x41, 0x04 }, - { 0x42, 0xC7 }, - { 0x43, 0x00 }, - { 0x44, 0x94 }, - { 0x45, 0x1E }, - { 0x46, 0x08 }, - { 0x47, 0x00 }, - { 0x48, 0x83 }, - - { 0x8B, 0xC2 }, - { 0x8C, 0x04 }, + // test param_1,param_1 + OV_MATCH(0x00, 0x85, 0xC0), + + // mov e??,[D3D_g_pDevice] + OV_MATCH(0x03, 0x8B), + + // mov [eax],0x00081E94 + OV_MATCH(0x42, 0xC7, 0x00, 0x94, 0x1E, 0x08, 0x00), + + // mov [eax + 0x4],0x6 + OV_MATCH(0x4B, 0xC7, 0x40, 0x04, 0x06, 0x00), + //OV_MATCH(0x50, 0x00, 0x00), + + // add eax,0xC + OV_MATCH(0x55, 0x83, 0xC0, 0x0C), + + // ret + OV_MATCH(0x8B, 0xC2, 0x04), // ); diff --git a/src/OOVPADatabase/D3D8LTCG_OOVPA.inl b/src/OOVPADatabase/D3D8LTCG_OOVPA.inl index e123f134..887b9a86 100644 --- a/src/OOVPADatabase/D3D8LTCG_OOVPA.inl +++ b/src/OOVPADatabase/D3D8LTCG_OOVPA.inl @@ -136,7 +136,7 @@ OOVPATable D3D8LTCG_OOVPA[] = { REGISTER_OOVPAS_BIND_XREF(D3DDevice_RunVertexStateShader_4, D3DDevice_RunVertexStateShader, 2048), REGISTER_OOVPAS(D3DDevice_SelectVertexShader, 1024, 1036), REGISTER_OOVPAS_BIND_XREF(D3DDevice_SelectVertexShader_0__LTCG_eax1_ebx2, D3DDevice_SelectVertexShader, 2024, 2048, 2060, 2061, 2062, 2072, 2084), - REGISTER_OOVPAS_BIND_XREF(D3DDevice_SelectVertexShader_4, D3DDevice_SelectVertexShader, 2024, 2048, 2060), + REGISTER_OOVPAS_BIND_XREF(D3DDevice_SelectVertexShader_4__LTCG_eax1, D3DDevice_SelectVertexShader, 3911, 4039, 4531, 4627), REGISTER_OOVPAS(D3DDevice_SelectVertexShaderDirect, 1024), REGISTER_OOVPAS_BIND_XREF(D3DDevice_SelectVertexShaderDirect_0, D3DDevice_SelectVertexShaderDirect, 2024, 2048), REGISTER_OOVPAS_BIND_XREF(D3DDevice_SetFlickerFilter_0, D3DDevice_SetFlickerFilter, 2024), diff --git a/src/test/libverify/D3D8.cpp b/src/test/libverify/D3D8.cpp index d16a2825..04d2e666 100644 --- a/src/test/libverify/D3D8.cpp +++ b/src/test/libverify/D3D8.cpp @@ -202,7 +202,7 @@ static const library_list database_full = { REGISTER_SYMBOLS(D3DDevice_SelectVertexShader, REGISTER_SYMBOL(D3DDevice_SelectVertexShader, VER_RANGE(3911, VER_MAX, VER_NONE, VER_NONE)), REGISTER_SYMBOL(D3DDevice_SelectVertexShader_0__LTCG_eax1_ebx2, VER_RANGE(3911, VER_MAX, VER_NONE, VER_NONE)), - REGISTER_SYMBOL(D3DDevice_SelectVertexShader_4, VER_RANGE(3911, VER_MAX, VER_NONE, VER_NONE))), // NOTE: LTCG usage + REGISTER_SYMBOL(D3DDevice_SelectVertexShader_4__LTCG_eax1, VER_RANGE(3911, VER_MAX, VER_NONE, VER_NONE))), REGISTER_SYMBOLS(D3DDevice_SelectVertexShaderDirect, REGISTER_SYMBOL(D3DDevice_SelectVertexShaderDirect, VER_RANGE(4361, VER_MAX, VER_NONE, VER_NONE)), REGISTER_SYMBOL(D3DDevice_SelectVertexShaderDirect_0, VER_RANGE(4361, VER_MAX, VER_NONE, VER_NONE))), // NOTE: LTCG usage