Mac SUNITINACTIVE_AllocOrFindInactiveList: D2InactiveUnitListStrc* __fastcall (pGame, nAct, nX, nY, bCreate)
The Mac body takes ECX = pGame (EBX; per-act list head at [pGame + nAct*4 + 0xd8]) and EDX = nAct (saved to [EBP-0x10], used as that index). It compares each node's +0 with [EBP+8] (nX, the sorted key) and +4 with [EBP+0xc] (nY), and [EBP+0x10] is the create flag (TEST, then allocate if nothing is found). It returns the node in EAX. The caller SUNITINACTIVE_AllocInactiveListForRoom 0x00283a3f loads ECX=pGame, EDX=act and stores [ESP]=room X, [ESP+4]=room Y, [ESP+8]=its flag. Same roles as the Windows twin 0x00541d20 (x in EBX there; renamed nX for the prefix rule).
Changes 1, applied together
Set prototype
mac 0x00283887signatureundefined SUNITINACTIVE_AllocOrFindInactiveList(void)→D2InactiveUnitListStrc* SUNITINACTIVE_AllocOrFindInactiveList(D2GameStrc* pGame, int32_t nAct, int32_t nX, int32_t nY, int32_t bCreate)conventionunknown→__fastcall