Skip to content

fix: preserve MIDI Manager dispatch frames - #585

Closed
benletchford wants to merge 1 commit into
masterfrom
dev/legacy-sound-dispatch
Closed

fix: preserve MIDI Manager dispatch frames#585
benletchford wants to merge 1 commit into
masterfrom
dev/legacy-sound-dispatch

Conversation

@benletchford

Copy link
Copy Markdown
Owner

Summary

  • distinguish the legacy MIDI Manager $0004 selector family from Sound Manager routines
  • implement the MIDI 2.0 version, sign-in, port, connection, wake-up, and stop-time selectors as a generic silent facade
  • preserve each selector's documented Pascal stack frame and return values
  • add regression coverage for the version result, return slots, reference number, and stack movement

Root cause

SoundDispatch previously routed only on the selector's routine byte. That made $00000004 (MIDIVersion) fall through to SndStartFilePlay, while later MIDI selectors retained their arguments because the MIDI family does not encode parameter sizes in the selector. A Director application eventually returned through those arguments to an invalid PC.

The new handling uses the Universal Interfaces 3.4 MIDI.h declarations for the legacy ABI. Systemless exposes a silent MIDI facade: clients can register and connect ports without corrupting execution, while packet transport and timer callbacks remain inactive.

Validation

  • cargo test --lib — 2,951 passed, 3 ignored
  • cargo check --no-default-features
  • cargo fmt --check
  • replayed the affected Director title through 2,102 guest ticks to its stable interactive gameplay interface

Closes #583

@benletchford

Copy link
Copy Markdown
Owner Author

Superseded by #586, which contains the evidence-backed fix for #583 and is ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SoundDispatch selector $00640004 leaves a Director extension argument on the stack

1 participant