diff --git a/hooks/xact_3dapply.cpp b/hooks/xact_3dapply.cpp deleted file mode 100644 index ea19c643..00000000 --- a/hooks/xact_3dapply.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "../define.h" -asm( - ".section h0; .set h0,0x4D9A60;" - "jmp "QU(xact_3d_apply)";" - "nop;" -); - - \ No newline at end of file diff --git a/hooks/xact_3dapply.hook b/hooks/xact_3dapply.hook new file mode 100644 index 00000000..5cbf9dd4 --- /dev/null +++ b/hooks/xact_3dapply.hook @@ -0,0 +1,2 @@ +0x004D9B21: + call fix__XACTApplyFailed \ No newline at end of file diff --git a/section/xact_3d_fix.cpp b/section/xact_3d_fix.cpp index ced3dcb1..c6866a9d 100644 --- a/section/xact_3d_fix.cpp +++ b/section/xact_3d_fix.cpp @@ -1,83 +1,11 @@ -void xact_3d_apply() +#include "global.h" + +void __cdecl fix__XACTApplyFailed(const char *fmt, const char *reason) { static bool once = true; - asm( - "push ebx;" - "push edi;" - "mov ebx,ecx;" - "mov edi,eax;" - "mov eax,dword ptr [ebx];" - "cmp dword ptr [eax+0x34],0x0;" - "je L0xABEL_0x004D9B2A;" - "push esi;" - "push 0x64;" - "lea esi,dword ptr [eax+0xAC];" - "push 0x0;" - "push esi;" - "call 0xA89110;" - "xorps xmm0,xmm0;" - "mov dword ptr [esi+0x3C],0x1;" - "mov dword ptr [esi],0x0;" - "fld dword ptr [edi];" - "fstp dword ptr [esi+0x1C];" - "fld dword ptr [edi+0x4];" - "fstp dword ptr [esi+0x20];" - "fld dword ptr [edi+0x8];" - "movss dword ptr [esi+0x28],xmm0;" - "movss dword ptr [esi+0x2C],xmm0;" - "fstp dword ptr [esi+0x24];" - "movss dword ptr [esi+0x30],xmm0;" - "movss xmm0,dword ptr [0xDFEC20];" - "movss dword ptr [esi+0x5C],xmm0;" - "movss dword ptr [esi+0xC],xmm0;" - "movss dword ptr [esi+0x14],xmm0;" - "mov ecx,dword ptr [ebx];" - "lea edi,dword ptr [ecx+0x7C];" - "lea eax,dword ptr [ecx+0xAC];" - "lea edx,dword ptr [ecx+0x38];" - "add ecx,0x110;" - "push ecx;" - "call 0x4D81E0;" - "add esp,0x10;" - "test eax,eax;" - "jge L0xABEL_0x004D9B04;" - "call 0x4D8A50;" - - "push eax;" - "push 0xE0B410;" - "call 0x937D30;" - "add esp,0x8;" - - "pop esi;" - "pop edi;" - "pop ebx;" - "ret 0x4;" - "L0xABEL_0x004D9B04:;" - "mov ebx,dword ptr [ebx];" - "mov esi,dword ptr [esp+0x10];" - "lea edi,dword ptr [ebx+0x7C];" - "call 0x4D82A0;" - "test eax,eax;" - "jge L0xABEL_0x004D9B29;" - "call 0x4D8A50;" - ); - if(once) + if (once) { - asm( - "push eax;" - "push 0xE0B430;" - "call 0x937D30;" - "add esp,0x8;" - ); + WarningF(fmt, reason); once = false; } - - asm( - "L0xABEL_0x004D9B29:;" - "pop esi;" - "L0xABEL_0x004D9B2A:;" - "pop edi;" - "pop ebx;" - "ret 0x4;" - ); } \ No newline at end of file