Recover the Mac unit-timer allocator's pointer contract
Ghidra vmac 105 · 3bccb89
EVENT_AllocTimerToUnit consumes ECX game and EDX unit, with no stack inputs, and returns the allocated individual timer in full EAX. Its complete189-byte body obtains a48-byte record from the600-record pool, zeroes0x30 bytes, attaches it to unit+0xdc, copies unit type/GUID to timer+0x10/+c, and ends MOV EAX,EDI/RET. Both code callers explicitly supply their game/unit registers and immediately use returned EAX as a timer: write type byte+0, frame+4 and callback+0x2c before queue insertion. Restore D2TimerStrc* return and game/unit inputs using Mac __fastcc. All paths, both complete callers, pool stride and helper bodies verified. No shared layout, callback, caller or Windows change; no runtime/build/matching result claimed.
Changes 1, applied together
Set prototype
mac 0x001abb32signatureundefined EVENT_AllocTimerToUnit(void)→D2TimerStrc * EVENT_AllocTimerToUnit(D2GameStrc * pGame, D2UnitStrc * pUnit)conventionunknown→__fastcc