REDIVIVUS

Proposals / #1152

Mac Shrines_GemShrine_SpawnGem: BOOL __fastcc (pGame, pUnit, nItemClassId, pUnit2) prototype

approved · by KierTaylor · submitted 2026-11-05, approved 2026-11-05

Mac 0x001f4ff6 is "undefined (void)", convention unknown. Entry: EBX=ECX (game: [EBX+0x78] word read, passed as [ESP] to spawn helpers), EDI=EDX (unit: passed to 0x0018ef1c coords and 0x0018f1ae room). Stack [EBP+8] is stored into the item-drop parameter block (0x001f50a1), [EBP+0xc] is a pointer tested for NULL (0x001f5143). Plain RET 0x001f51fd. Sole caller Shrines_GemShrineFunction loads ECX=[pArguments+0] (pGame), EDX=[pArguments+8] (pAttacker), stores [ESP]=EDI, [ESP+4]=ESI, then TEST EAX,EAX on the result (0x001f42b9-0x001f42cd). That is the Mac clang fastcc shape. Windows twin 0x00582ac0 has the same four values: BOOL (int32_t nItemClassId, D2UnitStrc* pUnit, pGame, D2UnitStrc* pUnit2).

Changes 1, applied together

  1. Set prototype mac 0x001f4ff6

    signatureundefined Shrines_GemShrine_SpawnGem(void)→BOOL Shrines_GemShrine_SpawnGem(D2GameStrc * pGame, D2UnitStrc * pUnit, int32_t nItemClassId, D2UnitStrc * pUnit2)
    conventionunknown→__fastcc