Skip to content

Commit

Permalink
upgrade d3d8 symbol group to include support for stack and params
Browse files Browse the repository at this point in the history
  • Loading branch information
RadWolfie committed Aug 13, 2024
1 parent 19728de commit 81602d6
Show file tree
Hide file tree
Showing 15 changed files with 415 additions and 331 deletions.
18 changes: 9 additions & 9 deletions include/xref/d3d8.def
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ XREF_SYMBOL(D3DTSS_TEXCOORDINDEX)


// Offsets :
XREF_SYMBOL(OFFSET_D3DDevice__m_PixelShader) // initially set to XREF_ADDR_DERIVE
XREF_SYMBOL(OFFSET_D3DDevice__m_Textures) // initially set to XREF_ADDR_DERIVE
XREF_SYMBOL(OFFSET_D3DDevice__m_Palettes) // initially set to XREF_ADDR_DERIVE
XREF_SYMBOL(OFFSET_D3DDevice__m_RenderTarget) // initially set to XREF_ADDR_DERIVE
XREF_SYMBOL(OFFSET_D3DDevice__m_DepthStencil) // initially set to XREF_ADDR_DERIVE
XREF_SYMBOL(OFFSET_D3DDevice__m_VerticalBlankEvent) // initially set to XREF_ADDR_DERIVE
XREF_SYMBOL(OFFSET_D3DDevice__m_SwapCallback) // initially set to XREF_ADDR_DERIVE
XREF_SYMBOL(OFFSET_D3DDevice__m_VBlankCallback) // initially set to XREF_ADDR_DERIVE
XREF_SYMBOL(OFFSET_D3DDevice__m_VertexShader) // initially set to XREF_ADDR_DERIVE
XREF_SYMBOL(D3DDevice__m_PixelShader_OFFSET) // initially set to XREF_ADDR_DERIVE
XREF_SYMBOL(D3DDevice__m_Textures_OFFSET) // initially set to XREF_ADDR_DERIVE
XREF_SYMBOL(D3DDevice__m_Palettes_OFFSET) // initially set to XREF_ADDR_DERIVE
XREF_SYMBOL(D3DDevice__m_RenderTarget_OFFSET) // initially set to XREF_ADDR_DERIVE
XREF_SYMBOL(D3DDevice__m_DepthStencil_OFFSET) // initially set to XREF_ADDR_DERIVE
XREF_SYMBOL(D3DDevice__m_VerticalBlankEvent_OFFSET) // initially set to XREF_ADDR_DERIVE
XREF_SYMBOL(D3DDevice__m_SwapCallback_OFFSET) // initially set to XREF_ADDR_DERIVE
XREF_SYMBOL(D3DDevice__m_VBlankCallback_OFFSET) // initially set to XREF_ADDR_DERIVE
XREF_SYMBOL(D3DDevice__m_VertexShader_OFFSET) // initially set to XREF_ADDR_DERIVE

// Functions
// include D3D8 prefix
Expand Down
56 changes: 52 additions & 4 deletions src/OOVPADatabase/D3D8/3911.inl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ OOVPA_SIG_MATCH(
XREF_ENTRY(0x01, XREF_D3D_g_pDevice),

// add eax, OFFSET_D3DDevice__m_VerticalBlankEvent
XREF_ENTRY(0x18, XREF_OFFSET_D3DDevice__m_VerticalBlankEvent), // <-- Deriving this XRef is the purpose of this OOVPA
XREF_ENTRY(0x18, XREF_D3DDevice__m_VerticalBlankEvent_OFFSET), // <-- Deriving this XRef is the purpose of this OOVPA

// mov eax,[D3D_g_pDevice]
OV_MATCH(0x00, 0xA1),
Expand Down Expand Up @@ -110,6 +110,54 @@ OOVPA_SIG_MATCH(
//
);

// ******************************************************************
// * D3D_g_pDevice
// ******************************************************************
// dummy signature
OOVPA_SIG_HEADER_NO_XREF(D3D_g_pDevice,
0)
OOVPA_SIG_MATCH_DUMMY();

// ******************************************************************
// * D3DDevice__m_PixelShader OFFSET
// ******************************************************************
// dummy signature
OOVPA_SIG_HEADER_NO_XREF(D3DDevice__m_PixelShader_OFFSET,
0)
OOVPA_SIG_MATCH_DUMMY();

// ******************************************************************
// * D3DDevice__m_VerticalBlankEvent OFFSET
// ******************************************************************
// dummy signature
OOVPA_SIG_HEADER_NO_XREF(D3DDevice__m_VerticalBlankEvent_OFFSET,
0)
OOVPA_SIG_MATCH_DUMMY();

// ******************************************************************
// * D3DDevice__m_SwapCallback OFFSET
// ******************************************************************
// dummy signature
OOVPA_SIG_HEADER_NO_XREF(D3DDevice__m_SwapCallback_OFFSET,
0)
OOVPA_SIG_MATCH_DUMMY();

// ******************************************************************
// * D3DDevice__m_VBlankCallback OFFSET
// ******************************************************************
// dummy signature
OOVPA_SIG_HEADER_NO_XREF(D3DDevice__m_VBlankCallback_OFFSET,
0)
OOVPA_SIG_MATCH_DUMMY();

// ******************************************************************
// * D3DDevice__m_VertexShader OFFSET
// ******************************************************************
// dummy signature
OOVPA_SIG_HEADER_NO_XREF(D3DDevice__m_VertexShader_OFFSET,
0)
OOVPA_SIG_MATCH_DUMMY();

// ******************************************************************
// * Direct3D_CreateDevice
// ******************************************************************
Expand Down Expand Up @@ -1557,7 +1605,7 @@ OOVPA_SIG_MATCH(
XREF_ENTRY(0x01, XREF_D3D_g_pDevice),

// D3DDevice_BlockUntilVerticalBlank+0x17 : add eax, OFFSET_D3DDevice__m_VerticalBlankEvent
XREF_ENTRY(0x18, XREF_OFFSET_D3DDevice__m_VerticalBlankEvent),
XREF_ENTRY(0x18, XREF_D3DDevice__m_VerticalBlankEvent_OFFSET),

// D3DDevice_BlockUntilVerticalBlank+0x00 : mov eax,[D3D_g_pDevice]
OV_MATCH(0x00, 0xA1),
Expand Down Expand Up @@ -1596,7 +1644,7 @@ OOVPA_SIG_MATCH(
XREF_ENTRY(0x06, XREF_D3D_g_pDevice),

// D3DDevice_SetVerticalBlankCallback+0x0A : mov [ecx+OFFSET_D3DDevice__m_VBlankCallback],eax
XREF_ENTRY(0x0C, XREF_OFFSET_D3DDevice__m_VBlankCallback),
XREF_ENTRY(0x0C, XREF_D3DDevice__m_VBlankCallback_OFFSET),

// D3DDevice_SetVerticalBlankCallback+0x00 : mov eax,[esp+0x04]
OV_MATCH(0x00, 0x8B, 0x44, 0x24, 0x04),
Expand Down Expand Up @@ -1753,7 +1801,7 @@ OOVPA_SIG_HEADER_XREF(D3DDevice_SetVertexShader,
XRefOne)
OOVPA_SIG_MATCH(

XREF_ENTRY(0x12, XREF_OFFSET_D3DDevice__m_VertexShader), // Derived
XREF_ENTRY(0x12, XREF_D3DDevice__m_VertexShader_OFFSET), // Derived

// D3DDevice_SetVertexShader+0x00 : push ebx
{ 0x00, 0x53 },
Expand Down
2 changes: 1 addition & 1 deletion src/OOVPADatabase/D3D8/4034.inl
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ OOVPA_SIG_HEADER_XREF(D3DDevice_SetVertexShader,
XRefOne)
OOVPA_SIG_MATCH(

XREF_ENTRY(0x13, XREF_OFFSET_D3DDevice__m_VertexShader), // Derived
XREF_ENTRY(0x13, XREF_D3DDevice__m_VertexShader_OFFSET), // Derived

// D3DDevice_SetVertexShader+0x06 : test bl, 1
{ 0x06, 0xF6 },
Expand Down
2 changes: 1 addition & 1 deletion src/OOVPADatabase/D3D8/4039.inl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ OOVPA_SIG_MATCH(
XREF_ENTRY(0x06, XREF_D3D_g_pDevice),

// D3DDevice_SetSwapCallback+0x0A : mov [ecx+OFFSET_D3DDevice__m_SwapCallback],eax
XREF_ENTRY(0x0C, XREF_OFFSET_D3DDevice__m_SwapCallback),
XREF_ENTRY(0x0C, XREF_D3DDevice__m_SwapCallback_OFFSET),

// D3DDevice_SetSwapCallback+0x00 : mov eax,[esp+0x04]
OV_MATCH(0x00, 0x8B, 0x44, 0x24, 0x04),
Expand Down
2 changes: 1 addition & 1 deletion src/OOVPADatabase/D3D8/4134.inl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ OOVPA_SIG_HEADER_XREF(D3DDevice_SetVertexShader,
XRefOne)
OOVPA_SIG_MATCH(

XREF_ENTRY(0x13, XREF_OFFSET_D3DDevice__m_VertexShader), // Derived
XREF_ENTRY(0x13, XREF_D3DDevice__m_VertexShader_OFFSET), // Derived

// D3DDevice_SetVertexShader+0x06 : test bl, 1
{ 0x06, 0xF6 },
Expand Down
2 changes: 1 addition & 1 deletion src/OOVPADatabase/D3D8/5028.inl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ OOVPA_SIG_HEADER_XREF(D3DDevice_SetVertexShader,
XRefOne)
OOVPA_SIG_MATCH(

XREF_ENTRY(0x13, XREF_OFFSET_D3DDevice__m_VertexShader), // Derived
XREF_ENTRY(0x13, XREF_D3DDevice__m_VertexShader_OFFSET), // Derived

// D3DDevice_SetVertexShader+0x06 : test bl, 1
{ 0x06, 0xF6 },
Expand Down
2 changes: 1 addition & 1 deletion src/OOVPADatabase/D3D8/5455.inl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ OOVPA_SIG_HEADER_XREF(D3DDevice_SetVertexShader,
XRefOne)
OOVPA_SIG_MATCH(

XREF_ENTRY(0x13, XREF_OFFSET_D3DDevice__m_VertexShader), // Derived (confirmed)
XREF_ENTRY(0x13, XREF_D3DDevice__m_VertexShader_OFFSET), // Derived (confirmed)

{ 0x1E, 0x89 },
{ 0x3E, 0x5F },
Expand Down
4 changes: 2 additions & 2 deletions src/OOVPADatabase/D3D8LTCG/3911.inl
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ OOVPA_SIG_HEADER_XREF(D3DDevice_SetVertexShader_0__LTCG_ebx1,
XRefOne)
OOVPA_SIG_MATCH(

XREF_ENTRY(0x0D, XREF_OFFSET_D3DDevice__m_VertexShader), // Derived (confirmed)
XREF_ENTRY(0x0D, XREF_D3DDevice__m_VertexShader_OFFSET), // Derived (confirmed)

{ 0x00, 0xF6 },
{ 0x01, 0xC3 },
Expand Down Expand Up @@ -1249,7 +1249,7 @@ OOVPA_SIG_MATCH(
XREF_ENTRY(0x01, XREF_D3D_g_pDevice),

// D3DDevice_BlockUntilVerticalBlank+0x17 : add eax, OFFSET_D3DDevice__m_VerticalBlankEvent
XREF_ENTRY(0x18, XREF_OFFSET_D3DDevice__m_VerticalBlankEvent),
XREF_ENTRY(0x18, XREF_D3DDevice__m_VerticalBlankEvent_OFFSET),

// D3DDevice_BlockUntilVerticalBlank+0x00 : mov eax,[D3D_g_pDevice]
OV_MATCH(0x00, 0xA1),
Expand Down
2 changes: 1 addition & 1 deletion src/OOVPADatabase/D3D8LTCG/4039.inl
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ OOVPA_SIG_HEADER_XREF(D3DDevice_SetVertexShader,
XRefOne)
OOVPA_SIG_MATCH(

XREF_ENTRY(0x12, XREF_OFFSET_D3DDevice__m_VertexShader), // Derived (unverified, yet should be align base on existing 4 bytes in signatures)
XREF_ENTRY(0x12, XREF_D3DDevice__m_VertexShader_OFFSET), // Derived (unverified, yet should be align base on existing 4 bytes in signatures)

{ 0x00, 0x53 },
{ 0x01, 0x8B },
Expand Down
2 changes: 1 addition & 1 deletion src/OOVPADatabase/D3D8LTCG/4432.inl
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ OOVPA_SIG_HEADER_XREF(D3DDevice_SetVertexShader,
XRefOne)
OOVPA_SIG_MATCH(

XREF_ENTRY(0x13, XREF_OFFSET_D3DDevice__m_VertexShader), // Derived (OK, yet unverified)
XREF_ENTRY(0x13, XREF_D3DDevice__m_VertexShader_OFFSET), // Derived (OK, yet unverified)

{ 0x00, 0x51 },
{ 0x01, 0x53 },
Expand Down
2 changes: 1 addition & 1 deletion src/OOVPADatabase/D3D8LTCG/5233.inl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ OOVPA_SIG_HEADER_XREF(D3DDevice_SetVertexShader_0__LTCG_ebx1,
XRefOne)
OOVPA_SIG_MATCH(

XREF_ENTRY(0x0E, XREF_OFFSET_D3DDevice__m_VertexShader), // Derived (unverified, yet should be align base on existing 4 bytes in signatures)
XREF_ENTRY(0x0E, XREF_D3DDevice__m_VertexShader_OFFSET), // Derived (unverified, yet should be align base on existing 4 bytes in signatures)

{ 0x00, 0x51 },

Expand Down
Loading

0 comments on commit 81602d6

Please sign in to comment.