Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finalize Cleanup for D3D8LTCG errors from Unit Test tool #189

Merged
merged 7 commits into from
Feb 27, 2023
Prev Previous commit
Next Next commit
d3dltcg: rename and update D3DDevice_SelectVertexShader_0__LTCG_eax1_…
…ebx2 sigs

Added:
- 2062
RadWolfie committed Feb 26, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 26074a0fac2fd9db4bf407890b774acb1259cd99
34 changes: 19 additions & 15 deletions src/OOVPADatabase/D3D8LTCG/4432.inl
Original file line number Diff line number Diff line change
@@ -931,25 +931,29 @@ OOVPA_SIG_MATCH(
// ******************************************************************
// * D3DDevice_SelectVertexShader
// ******************************************************************
//04C700941E080083 ...C3
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_0,
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_0__LTCG_eax1_ebx2,
2024)
OOVPA_SIG_MATCH(

{ 0x00, 0x85 },
{ 0x01, 0xC0 },
// test param_1,param_1
OV_MATCH(0x00, 0x85, 0xC0),

{ 0x3C, 0x04 },
{ 0x3D, 0xC7 },
{ 0x3E, 0x00 },
{ 0x3F, 0x94 },
{ 0x40, 0x1E },
{ 0x41, 0x08 },
{ 0x42, 0x00 },
{ 0x43, 0x83 },

{ 0x84, 0x5E },
{ 0x85, 0xC3 },
// mov e??,[D3D_g_pDevice]
OV_MATCH(0x03, 0x8B),

// mov [eax],0x00081E94
OV_MATCH(0x3D, 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(0x50, 0x83, 0xC0, 0x0C),

// pop esi
// ret
OV_MATCH(0x84, 0x5E, 0xC3),
//
);

32 changes: 18 additions & 14 deletions src/OOVPADatabase/D3D8LTCG/5233.inl
Original file line number Diff line number Diff line change
@@ -233,25 +233,29 @@ OOVPA_SIG_MATCH(
// ******************************************************************
// * D3DDevice_SelectVertexShader
// ******************************************************************
//04C700941E080083 ...C3
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_0,
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_0__LTCG_eax1_ebx2,
2048)
OOVPA_SIG_MATCH(

{ 0x00, 0x85 },
{ 0x01, 0xC0 },
// test param_1,param_1
OV_MATCH(0x00, 0x85, 0xC0),

{ 0x46, 0x04 },
{ 0x47, 0xC7 },
{ 0x48, 0x00 },
{ 0x49, 0x94 },
{ 0x4A, 0x1E },
{ 0x4B, 0x08 },
{ 0x4C, 0x00 },
{ 0x4D, 0x83 },
// mov e??,[D3D_g_pDevice]
OV_MATCH(0x03, 0x8B),

// mov [eax],0x00081E94
OV_MATCH(0x47, 0xC7, 0x00, 0x94, 0x1E, 0x08, 0x00),

// mov [eax + 0x4],0x6
OV_MATCH(0x50, 0xC7, 0x40, 0x04, 0x06, 0x00),
//OV_MATCH(0x55, 0x00, 0x00),

{ 0x8E, 0x5E },
{ 0x8F, 0xC3 },
// add eax,0xC
OV_MATCH(0x5A, 0x83, 0xC0, 0x0C),

// pop esi
// ret
OV_MATCH(0x8E, 0x5E, 0xC3),
//
);

91 changes: 77 additions & 14 deletions src/OOVPADatabase/D3D8LTCG/5455.inl
Original file line number Diff line number Diff line change
@@ -48,25 +48,88 @@ OOVPA_SIG_MATCH(
// ******************************************************************
// * D3DDevice_SelectVertexShader
// ******************************************************************
//00008B4904578D ...C3
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_0,
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_0__LTCG_eax1_ebx2,
2060)
OOVPA_SIG_MATCH(

{ 0x00, 0x85 },
{ 0x02, 0x56 },
// test param_1,param_1
OV_MATCH(0x00, 0x85, 0xC0),

{ 0x5B, 0x04 },
{ 0x5C, 0xC7 },
{ 0x5D, 0x00 },
{ 0x5E, 0x94 },
{ 0x5F, 0x1E },
{ 0x60, 0x08 },
{ 0x61, 0x00 },
{ 0x62, 0x83 },
// mov e??,[D3D_g_pDevice]
OV_MATCH(0x03, 0x8B),

// mov [eax],0x00081E94
OV_MATCH(0x5C, 0xC7, 0x00, 0x94, 0x1E, 0x08, 0x00),

// mov [eax + 0x4],0x6
OV_MATCH(0x65, 0xC7, 0x40, 0x04, 0x06, 0x00),
//OV_MATCH(0x6A, 0x00, 0x00),

// add eax,0xC
OV_MATCH(0x6F, 0x83, 0xC0, 0x0C),

// pop esi
// ret
OV_MATCH(0x9E, 0x5E, 0xC3),
//
);

// ******************************************************************
// * D3DDevice_SelectVertexShader
// ******************************************************************
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_0__LTCG_eax1_ebx2,
2061)
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(0x6E, 0xC7, 0x00, 0x94, 0x1E, 0x08, 0x00),

// mov [eax + 0x4],0x6
OV_MATCH(0x77, 0xC7, 0x40, 0x04, 0x06, 0x00),
//OV_MATCH(0x7C, 0x00, 0x00),

{ 0x9E, 0x5E },
{ 0x9F, 0xC3 },
// add eax,0xC
OV_MATCH(0x81, 0x83, 0xC0, 0x0C),

// pop esi
// ret
OV_MATCH(0xB0, 0x5E, 0xC3),
//
);

// ******************************************************************
// * D3DDevice_SelectVertexShader
// ******************************************************************
// NOTE: Detected in b5659 title
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_0__LTCG_eax1_ebx2,
2062)
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(0x6F, 0xC7, 0x00, 0x94, 0x1E, 0x08, 0x00),

// mov [eax + 0x4],0x6
OV_MATCH(0x78, 0xC7, 0x40, 0x04, 0x06, 0x00),
// OV_MATCH(0x7D, 0x00, 0x00),

// add eax,0xC
OV_MATCH(0x82, 0x83, 0xC0, 0x0C),

// pop esi
// ret
OV_MATCH(0xB2, 0x5E, 0xC3),
//
);

68 changes: 38 additions & 30 deletions src/OOVPADatabase/D3D8LTCG/5849.inl
Original file line number Diff line number Diff line change
@@ -338,50 +338,58 @@ OOVPA_SIG_MATCH(
// ******************************************************************
// * D3DDevice_SelectVertexShader
// ******************************************************************
//00008B4904578D
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_0,
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_0__LTCG_eax1_ebx2,
2084)
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),

// mov [eax],0x00081E94
OV_MATCH(0x5D, 0xC7, 0x00, 0x94, 0x1E, 0x08, 0x00),

{ 0x5C, 0x04 },
{ 0x5D, 0xC7 },
{ 0x5E, 0x00 },
{ 0x5F, 0x94 },
{ 0x60, 0x1E },
{ 0x61, 0x08 },
{ 0x62, 0x00 },
{ 0x63, 0x83 },
// mov [eax + 0x4],0x6
OV_MATCH(0x66, 0xC7, 0x40, 0x04, 0x06, 0x00),
//OV_MATCH(0x6B, 0x00, 0x00),

{ 0xA0, 0x5E },
{ 0xA1, 0xC3 },
// add eax,0xC
OV_MATCH(0x70, 0x83, 0xC0, 0x0C),

// pop esi
// ret
OV_MATCH(0xA0, 0x5E, 0xC3),
//
);

// ******************************************************************
// * D3DDevice_SelectVertexShader
// ******************************************************************
//04C700941E080083 ...C3
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_0,
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SelectVertexShader_0__LTCG_eax1_ebx2,
2072)
OOVPA_SIG_MATCH(

{ 0x00, 0x85 },
{ 0x01, 0xC0 },

{ 0x60, 0x04 },
{ 0x61, 0xC7 },
{ 0x62, 0x00 },
{ 0x63, 0x94 },
{ 0x64, 0x1E },
{ 0x65, 0x08 },
{ 0x66, 0x00 },
{ 0x67, 0x83 },

{ 0xA4, 0x5E },
{ 0xA5, 0xC3 },
// test param_1,param_1
OV_MATCH(0x00, 0x85, 0xC0),

// mov e??,[D3D_g_pDevice]
OV_MATCH(0x03, 0x8B),

// mov [eax],0x00081E94
OV_MATCH(0x61, 0xC7, 0x00, 0x94, 0x1E, 0x08, 0x00),

// mov [eax + 0x4],0x6
OV_MATCH(0x6A, 0xC7, 0x40, 0x04, 0x06, 0x00),
//OV_MATCH(0x6F, 0x00, 0x00),

// add eax,0xC
OV_MATCH(0x74, 0x83, 0xC0, 0x0C),

// pop esi
// ret
OV_MATCH(0xA4, 0x5E, 0xC3),
//
);

2 changes: 1 addition & 1 deletion src/OOVPADatabase/D3D8LTCG_OOVPA.inl
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ OOVPATable D3D8LTCG_OOVPA[] = {
REGISTER_OOVPAS_BIND_XREF(D3DDevice_RunPushBuffer_4, D3DDevice_RunPushBuffer, 2048),
REGISTER_OOVPAS_BIND_XREF(D3DDevice_RunVertexStateShader_4, D3DDevice_RunVertexStateShader, 2048),
REGISTER_OOVPAS(D3DDevice_SelectVertexShader, 1024, 1036),
REGISTER_OOVPAS_BIND_XREF(D3DDevice_SelectVertexShader_0, D3DDevice_SelectVertexShader, 2024, 2048, 2060, 2072, 2084),
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(D3DDevice_SelectVertexShaderDirect, 1024),
REGISTER_OOVPAS_BIND_XREF(D3DDevice_SelectVertexShaderDirect_0, D3DDevice_SelectVertexShaderDirect, 2024, 2048),
2 changes: 1 addition & 1 deletion src/test/libverify/D3D8.cpp
Original file line number Diff line number Diff line change
@@ -192,7 +192,7 @@ static const library_list database_full = {
REGISTER_SYMBOL(D3DDevice_RunVertexStateShader_4, VER_RANGE(3911, VER_MAX, VER_NONE, VER_NONE))), // NOTE: LTCG usage
REGISTER_SYMBOLS(D3DDevice_SelectVertexShader,
REGISTER_SYMBOL(D3DDevice_SelectVertexShader, VER_RANGE(3911, VER_MAX, VER_NONE, VER_NONE)),
REGISTER_SYMBOL(D3DDevice_SelectVertexShader_0, VER_RANGE(3911, VER_MAX, VER_NONE, VER_NONE)), // NOTE: LTCG usage
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_SYMBOLS(D3DDevice_SelectVertexShaderDirect,
REGISTER_SYMBOL(D3DDevice_SelectVertexShaderDirect, VER_RANGE(4361, VER_MAX, VER_NONE, VER_NONE)),