REDIVIVUS

Proposals / #1399

Recover the Mac sound TXT descriptor arrays in constant data and stack storage

checked · by eejitgames · submitted 2026-11-07

Mac SOUNDHDR_Init copies two constant TXT field tables into stack objects still stored as one-byte undefined values. Decode the940 source bytes as24/23 existing20B D2BinFieldInputStrc records, including one end/type0 terminator each; all45 active names resolve to sound/environment columns. Native memcpy lengths480/460 and both dispatcher argument bases independently confirm the extents. Type both source globals and both stack copies as those arrays, and name only their default labels/locals. The source arrays end at003d08e4/003d0ab0; stack ranges fit without overlap, with4B between them. Current environment decompile over-infers464B. Windows already types corresponding local arrays24/23, corroborating the Mac bytes without copying its differing sound-record layout.1396 only fixes the dispatcher API;933 only the initializer prototype. No new struct/callback type or measured generated-code/runtime improvement is claimed.

Changes 8, applied together

  1. Rename global mac 0x003d0704

    namePTR_s_Filename_003d0704→gaSoundsFields
  2. Retype global mac 0x003d0704

    typepointer (4 bytes)→D2BinFieldInputStrc[24]
  3. Rename global mac 0x003d08e4

    namePTR_s_Song_003d08e4→gaSoundEnvironFields
  4. Retype global mac 0x003d08e4

    typepointer (4 bytes)→D2BinFieldInputStrc[23]
  5. Retype variable mac 0x00094e23 Stack[-0x2fc]

    typeundefined→D2BinFieldInputStrc[24]
  6. Rename variable mac 0x00094e23 Stack[-0x2fc]

    namelocal_2fc→aSoundsFields
  7. Retype variable mac 0x00094e23 Stack[-0x4cc]

    typeundefined→D2BinFieldInputStrc[23]
  8. Rename variable mac 0x00094e23 Stack[-0x4cc]

    namelocal_4cc→aSoundEnvironFields