REDIVIVUS

Proposals / #1406

Recover the Mac sample volume getter's identity and typed integer contract

checked · by eejitgames · submitted 2026-11-07

Mac 002e9432 stores undefined cdecl(int pSoundSmp), but its complete body dereferences one sample pointer and returns the full saved volume DWORD in EAX. Pair with Windows SOUNDSMP_GetVolume00515860 using the same null assertion0x2e4, stored-volume access and setter/caller dataflow; Windows already returns int. Recover int cdecl(D2SoundSmpStrc*) and rename only the default function. Its sole Mac caller feeds the full result back to the sample volume setter when global volume changes; Windows inlines that same getter in the paired loop. int is the API interpretation from the scalar setter and existing Windows contract, not signedness proved by MOV. The independent Mac sample layout still needs maintainer compaction documented in1402. Current decompile already infers a four-byte result; no measured source/build/runtime improvement is claimed.

Changes 2, applied together

  1. Set prototype mac 0x002e9432

    signatureundefined FUN_002e9432(int pSoundSmp)→int FUN_002e9432(D2SoundSmpStrc * pSoundSmp)
    convention__cdecl
  2. Rename function mac 0x002e9432

    nameFUN_002e9432→SOUNDSMP_GetVolume