Skip to content

Commit

Permalink
d3d8ltcg: update D3DDevice_SelectVertexShader_4 signatures
Browse files Browse the repository at this point in the history
Renamed:
- D3DDevice_SelectVertexShader_4 to D3DDevice_SelectVertexShader_4__LTCG_eax1

Added:
- 4039
  • Loading branch information
RadWolfie committed Feb 27, 2023
1 parent fc09c41 commit f62109a
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 49 deletions.
32 changes: 18 additions & 14 deletions src/OOVPADatabase/D3D8LTCG/3911.inl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
//
);

Expand Down
27 changes: 27 additions & 0 deletions src/OOVPADatabase/D3D8LTCG/4039.inl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
//
);
35 changes: 19 additions & 16 deletions src/OOVPADatabase/D3D8LTCG/4531.inl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
//
);

Expand Down
37 changes: 20 additions & 17 deletions src/OOVPADatabase/D3D8LTCG/4627.inl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
//
);

Expand Down
2 changes: 1 addition & 1 deletion src/OOVPADatabase/D3D8LTCG_OOVPA.inl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/test/libverify/D3D8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f62109a

Please sign in to comment.