REDIVIVUS

Proposals / #687

Type the channel selector and comparator inputs as sound descriptors

applied · by Commit-Will · submitted 2026-11-01, applied 2026-11-01

Ghidra v1797 · 3bccb89

Three scalar arguments are D2SoundChannelStrc pointers. The selector’s sole caller SOUND_PlaySoundWithPanning takes that descriptor type, saves it unchanged, and pushes it as nParam. It also stores the same descriptor into hardware-channel.pActiveSound. Both comparator call paths load descriptors from those existing typed pActiveSound fields; the second forwards nParam unchanged as its first descriptor. The comparator reads BYTE+0x3c, FLOAT+0x18 and DWORD+0x34, exactly the existing 89-byte descriptor layout. Complete comparator (100 bytes), selector (207) and producer (438) ranges match the original Windows PE; every argument setup and path was checked. Retype only comparator pChanA@ECX/pChanB@EDX and selector nParam@Stack4, preserving all chosen names, flag arguments, custom EBX channel-type slot, conventions and returns. No shared field/global change or runtime/byte-match gain is claimed.

Changes 3, applied together

  1. Retype variable win 0x004b9da0 ECX

    typeuint32_t→D2SoundChannelStrc *
  2. Retype variable win 0x004b9da0 EDX

    typeuint32_t→D2SoundChannelStrc *
  3. Retype variable win 0x004dfb50 Stack[0x4]

    typeuint32_t→D2SoundChannelStrc *