REDIVIVUS

Proposals / #934

Mac SOUND_Calculate3DPosition: __fastcc void (D2SoundChannelStrc * pChannel, float * pPosition)

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

Ghidra vmac 111 · 3c6740e

Mac body: ECX (ESI) and EDX (EDI) are both null-checked (assert line 0x1a6); EDX is read as three floats (+0, +4, +8) and ECX is written (+0xc/+0x10 copy of the x/y pair, +0x14 = z, +0x18 = computed pan), so ECX is the channel and EDX the position vector; no stack arguments, plain RET. Windows twin SOUND_Calculate3DPosition 0x004b98f0 is void (float * pfPosition, D2SoundChannelStrc * pChannel); the Mac order puts the channel first. (pfPosition is refused by the prefix check, so pPosition.)

Changes 1, applied together

  1. Set prototype mac 0x0009602f

    signatureundefined SOUND_Calculate3DPosition(void)→void SOUND_Calculate3DPosition(D2SoundChannelStrc * pChannel, float * pPosition)
    conventionunknown→__fastcc