Mac AUTOMAP_AddCellForUnit: __fastcc void (pUnit, nCellNo, ppAutomapCell)
Ghidra vmac 111 · 3c6740e
Mac body: ECX (saved in EDI) is passed to the GetTargetX/GetTargetY calls, so it is the unit; EDX is range-checked (+0x8000 < 0x10000, line 0x3c7) and stored as the word at cell+4 (nCellNo); [EBP+8] is handed in EDX to the tail-jump into the insert-cell routine, so it is the tree root. The Windows twin AUTOMAP_AddCellForUnit 0x00457e80 does the same (nParam -> nCellNo, pAutomapCell -> InsertCellIntoTree, pUnit -> GetTargetX/Y); the Mac order differs.
Changes 1, applied together
Set prototype
mac 0x0009c234signatureundefined AUTOMAP_AddCellForUnit(void)→void AUTOMAP_AddCellForUnit(D2UnitStrc * pUnit, int32_t nCellNo, D2AutomapCellStrc * * ppAutomapCell)conventionunknown→__fastcc