[saco] Implement/match seven more game/util.cpp functions; 0x100B56F0 patches a real function-pointer global instead of picking with a ternary, and the tail jmp needs the callee convention to match

This commit is contained in:
ricardoofnl
2026-09-05 10:34:46 +07:00
parent ea57e6af81
commit c525ec2bc3
2 changed files with 133 additions and 0 deletions
+121
View File
@@ -1714,3 +1714,124 @@ float FUNC_100B5180(float *pQuat)
return pQuat[0] * pQuat[0] + (pQuat[1] * pQuat[1] + pQuat[2] * pQuat[2] +
pQuat[3] * pQuat[3]);
}
//-----------------------------------------------------------
void FUNC_100B5910(int a1, int a2)
{
DWORD dwFunc = (iGtaVersion != GTASA_VERSION_USA10) ? 0x7F1960 : 0x7F1920;
_asm push a2
_asm push a1
_asm mov edx, dwFunc
_asm call edx
_asm pop edx
_asm pop edx
}
//-----------------------------------------------------------
void FUNC_100B5940(int a1, int a2)
{
DWORD dwFunc = (iGtaVersion != GTASA_VERSION_USA10) ? 0x7F2300 : 0x7F22C0;
_asm push 1
_asm push a2
_asm push a1
_asm mov edx, dwFunc
_asm call edx
_asm pop edx
_asm pop edx
_asm pop edx
}
//-----------------------------------------------------------
void FUNC_100B58D0(int a1, int a2, int a3)
{
int nCopy = a2;
DWORD dwFunc = (iGtaVersion != GTASA_VERSION_USA10) ? 0x7F2010 : 0x7F1FD0;
_asm push 1
_asm push a3
_asm push nCopy
_asm push a1
_asm mov edx, dwFunc
_asm call edx
_asm pop edx
_asm pop edx
_asm pop edx
_asm pop edx
}
//-----------------------------------------------------------
// patched to the EU entry point on first use, so it has to be a real variable
DWORD VAR_101173FC = 0x7EDD90;
void FUNC_100B56F0(int a1, int a2, int a3)
{
if(iGtaVersion == GTASA_VERSION_EU10)
VAR_101173FC = 0x7EDDD0;
_asm push a3
_asm push 1
_asm push a2
_asm push a1
_asm mov edx, VAR_101173FC
_asm call edx
_asm pop edx
_asm pop edx
_asm pop edx
_asm pop edx
}
//-----------------------------------------------------------
void FUNC_100B62B0(BYTE *pObject)
{
if(pObject)
{
if(*pObject == 1)
{
DWORD dwOther = *(DWORD *)(pObject + 4);
FUNC_100B1800(pObject);
if(dwOther) FUNC_100B17D0(dwOther);
}
else if(*pObject == 2)
{
FUNC_100B1C80(pObject);
}
}
}
//-----------------------------------------------------------
BOOL __stdcall FUNC_100B62F0(BYTE *pObject)
{
if(!pObject || *pObject != 1) return FALSE;
DWORD dwFunc = (DWORD)FUNC_100B1430(pObject);
_asm push pObject
_asm mov ebx, dwFunc
_asm call ebx
_asm pop ebx
return TRUE;
}
//-----------------------------------------------------------
void __stdcall FUNC_100B6330(BYTE *pObject)
{
if(pObject)
{
if(*pObject == 1)
FUNC_100B62F0(pObject);
else if(*pObject == 2)
FUNC_100B19D0(pObject);
}
}
+12
View File
@@ -145,6 +145,18 @@ WORD FUNC_100B6470(int a1, int a2, int a3, int a4, int a5); // .text:100B6470
void VectorScale(VECTOR *vecOut, VECTOR *vecIn, float fScale); // .text:100B51B0
void FUNC_100B51E0(int a1, int a2); // .text:100B51E0
float FUNC_100B5180(float *pQuat); // .text:100B5180
DWORD FUNC_100B1430(BYTE *pObject); // .text:100B1430, todo: implement
void FUNC_100B17D0(DWORD dwOther); // .text:100B17D0, todo: implement
void FUNC_100B1800(BYTE *pObject); // .text:100B1800, todo: implement
void FUNC_100B19D0(BYTE *pObject); // .text:100B19D0, todo: implement
void FUNC_100B1C80(BYTE *pObject); // .text:100B1C80, todo: implement
void FUNC_100B5910(int a1, int a2); // .text:100B5910
void FUNC_100B5940(int a1, int a2); // .text:100B5940
void FUNC_100B58D0(int a1, int a2, int a3); // .text:100B58D0
void FUNC_100B56F0(int a1, int a2, int a3); // .text:100B56F0
void FUNC_100B62B0(BYTE *pObject); // .text:100B62B0
BOOL __stdcall FUNC_100B62F0(BYTE *pObject); // .text:100B62F0
void __stdcall FUNC_100B6330(BYTE *pObject); // .text:100B6330
void FUNC_100B5210(int a1, void *a2); // .text:100B5210, __cdecl: the caller's
// stack cleanup is folded into the next call's argument setup