Skip to content

Commit c12659d

Browse files
committed
d3d8ltcg: update D3DDevice_SetTextureState_ColorKeyColor_4__LTCG_eax1 signatures
Updated: - 2048 to 4039 - 2060 to 4531
1 parent 0487a70 commit c12659d

3 files changed

Lines changed: 36 additions & 24 deletions

File tree

src/OOVPADatabase/D3D8LTCG/4039.inl

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -399,19 +399,26 @@ OOVPA_SIG_MATCH(
399399
// ******************************************************************
400400
// * D3DDevice_SetTextureState_ColorKeyColor
401401
// ******************************************************************
402-
//E00A040089 ...C20400
403402
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SetTextureState_ColorKeyColor_4__LTCG_eax1,
404-
2048)
403+
4039)
405404
OOVPA_SIG_MATCH(
405+
// push ebx
406+
OV_MATCH(0x00, 0x53),
406407

407-
{ 0x00, 0x53 },
408-
{ 0x01, 0x8B },
408+
// mov esi, param_1
409+
// mov eax, [e??]
410+
OV_MATCH(0x10, 0x8B, 0xF0, 0x8B),
411+
// cmp eax, ecx
412+
// jne +0x0B
413+
OV_MATCH(0x14, 0x3B, 0xC1, 0x72, 0x0B),
409414

410-
{ 0x26, 0xE0 },
411-
{ 0x27, 0x0A },
412-
{ 0x28, 0x04 },
413-
{ 0x29, 0x00 },
414-
{ 0x2A, 0x89 },
415+
// lea e??, [e?? * 0x04 + 0x40AE0] // 0x40AE0 is a reliable hardcoded value across all builds.
416+
OV_MATCH(0x23, 0x8D),
417+
OV_MATCH(0x26, 0xE0, 0x0A, 0x04, 0x00),
418+
419+
// This is required OV pair to tell the difference from the (symbol)_4__LTCG_eax1_ebx2 signature.
420+
// retn 0x04
421+
OV_MATCH(0x40, 0xC2, 0x04),
415422
//
416423
);
417424

src/OOVPADatabase/D3D8LTCG/4531.inl

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,27 @@ OOVPA_SIG_MATCH(
5151
// ******************************************************************
5252
// * D3DDevice_SetTextureState_ColorKeyColor
5353
// ******************************************************************
54-
//8D0CB5E00A0400 ...C20400
54+
// Generic OOVPA as of 4531 and newer
5555
OOVPA_SIG_HEADER_NO_XREF(D3DDevice_SetTextureState_ColorKeyColor_4__LTCG_eax1,
56-
2060)
56+
4531)
5757
OOVPA_SIG_MATCH(
58-
59-
{ 0x00, 0x53 },
60-
61-
{ 0x26, 0x8D },
62-
{ 0x27, 0x0C },
63-
{ 0x28, 0xB5 },
64-
{ 0x29, 0xE0 },
65-
{ 0x2A, 0x0A },
66-
{ 0x2B, 0x04 },
67-
{ 0x2C, 0x00 },
68-
69-
{ 0x43, 0xC2 },
58+
// push ebx
59+
OV_MATCH(0x00, 0x53),
60+
61+
// mov esi, param_1
62+
// mov eax, [e??]
63+
OV_MATCH(0x10, 0x8B, 0xF0, 0x8B),
64+
// cmp eax, ecx
65+
// jne +0x0E
66+
OV_MATCH(0x14, 0x3B, 0xC1, 0x72, 0x0E),
67+
68+
// lea e??, [e?? * 0x04 + 0x40AE0] // 0x40AE0 is a reliable hardcoded value across all builds.
69+
OV_MATCH(0x26, 0x8D),
70+
OV_MATCH(0x29, 0xE0, 0x0A, 0x04, 0x00),
71+
72+
// This is required OV pair to tell the difference from the (symbol)_4__LTCG_eax1_ebx2 signature.
73+
// retn 0x04
74+
OV_MATCH(0x43, 0xC2, 0x04),
7075
//
7176
);
7277

src/OOVPADatabase/D3D8LTCG_OOVPA.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ static OOVPATable D3D8LTCG_OOVPA_Table[] = {
343343
REGISTER_OOVPAS(SYM_FUN_LTCG(D3DDevice_SetTextureState_ColorKeyColor, CALL(unk), STACK(0), PARAMS(PARAM(eax, Stage), PARAM(ebx, Value))),
344344
SYM_SIG(3911, 5233, 5788)),
345345
REGISTER_OOVPAS(SYM_FUN_LTCG(D3DDevice_SetTextureState_ColorKeyColor, CALL(unk), STACK(4), PARAMS(PARAM(eax, Stage), PARAM(psh, Value))),
346-
SYM_SIG(2048, 2060)),
346+
SYM_SIG(4039, 4531)),
347347
REGISTER_OOVPAS_M(SYM_FUN(D3DDevice_SetTextureState_TexCoordIndex, CALL(std), STACK(/*default*/), PARAMS(PARAM(psh, Stage), PARAM(psh, Value))),
348348
SYM_SIG(1944, 1958)),
349349
REGISTER_OOVPAS_M(SYM_FUN_LTCG(D3DDevice_SetTextureState_TexCoordIndex, CALL(unk), STACK(0), PARAMS(PARAM(edi, Stage), PARAM(eax, Value))),

0 commit comments

Comments
 (0)