REDIVIVUS

Proposals / #1394

Recover the Mac skill-calc argument-count callback's integer cdecl API

checked · by eejitgames · submitted 2026-11-07

Mac0013ba77 is installed as the fifth compiler argument by both skill/skilldesc field parsers. Its complete18-byte body reads DWORD[EBP+8], sets AL from index==6, zero-extends to EAX and ORs2, returning3 for index6 and2 otherwise via bare RET. The compiler passes one DWORD on its stack to this callback and compares full EAX with operand depth. Recover int cdecl(int nFunctionIndex) from undefined(void)/unknown and copy the verified Windows006119e0 name DATATBLS_CalcExpr_GetArgCount. The12-byte Windows body computes the same rule from ECX; its fastcall stays unchanged. Pending1393 edits only the parent compiler, not this callback. No runtime/build improvement or indirect-call typedef repair is claimed.

Changes 2, applied together

  1. Set prototype mac 0x0013ba77

    signatureundefined FUN_0013ba77(void)→int FUN_0013ba77(int nFunctionIndex)
    conventionunknown→__cdecl
  2. Rename function mac 0x0013ba77

    nameFUN_0013ba77→DATATBLS_CalcExpr_GetArgCount