REDIVIVUS

Proposals / #935

Mac SOUND_CalculateUnitDirection: __fastcc void (D2UnitStrc * pUnit, int32_t nSoundId, float * pDirection)

applied · by KierTaylor · submitted 2026-11-02, applied 2026-11-02

Ghidra vmac 111 · 3c6740e

Mac body: ECX (EDI) is passed with an out-POINT to the unit coordinate getter (as is the player unit); EDX (ESI) is compared with sound id 0xa27; [EBP+8] is the output vector whose +0/+4/+8 floats are written (z = 640.0f); no other stack reads, plain RET. Windows twin SOUND_CalculateUnitDirection 0x004b97d0 is void (D2UnitStrc * pUnit, int32_t nSoundId, float * pfDirection); same order on Mac (ECX, EDX, stack). The pf prefix is refused, so pDirection.

Changes 1, applied together

  1. Set prototype mac 0x000962a0

    signatureundefined SOUND_CalculateUnitDirection(void)→void SOUND_CalculateUnitDirection(D2UnitStrc * pUnit, int32_t nSoundId, float * pDirection)
    conventionunknown→__fastcc