REDIVIVUS

Proposals / #1411

Recover the Mac unit sound-list head accessor's register input and pointer result

checked · by eejitgames · submitted 2026-11-07

Mac 00128e04 is stored as undefined(void), but its full body saves incoming ECX, checks it, and returns ECX+0x78 in EAX. All nine executable callers explicitly supply their unit in ECX and use the result as the address of a list-head slot. The existing Mac D2UnitStrc embeds D2UnitDataClientSide at 0x64, whose void* pUnitSfxData is at +0x14: its address is therefore void** at unit+0x78. Restore the D2UnitStrc* input and void** result, preserve __fastcc, and name the default helper for that field. Paired Windows insertion/removal wrappers inline the same null check and +0x78 address calculation. This concerns the node-pointer slot; it makes no pointer-only claim about node payloads. No generic node struct or field-layout change is required.

Changes 2, applied together

  1. Set prototype mac 0x00128e04

    signatureundefined FUN_00128e04(void)→void ** FUN_00128e04(D2UnitStrc * pUnit)
    convention__fastcc
  2. Rename function mac 0x00128e04

    nameFUN_00128e04→UNITSND_GetSfxListHeadAddress