REDIVIVUS

Proposals / #1688

Recover the Mac diminished-stat helper's unit/index register contract

checked · by eejitgames · submitted 2026-11-08

Mac00190575 is stored as undefined(void)/unknown, but entry code writes incoming ECX as the unit argument to001964bd and multiplies incoming EDX by12 for the stat-table index. Its full78-byte body returns a full EAX zero or signed IDIV quotient at its sole bareRET. All five known E8callers set ECX=unit and EDX=0..4, then consume all32 result bits. Windows00621740 has the same stat lookup, signed formula and byte-identical five-record table. Restore int32_t __fastcc(D2UnitStrc*,int32_t) on Mac only; preserve the Windows custom ECX/EAX contract and existing names.

Changes 1, applied together

  1. Set prototype mac 0x00190575

    signatureundefined FUN_00190575(void)→int32_t FUN_00190575(D2UnitStrc * pUnit, int32_t nIndex)
    conventionunknown→__fastcc