Opened 17 years ago

Closed 17 years ago

Last modified 11 months ago

#8089 closed patch

SAM: do_command(256) implementation

Reported by: SF/jamieson630 Owned by: SF/ender
Priority: normal Component: Engine: SCUMM
Keywords: Cc:
Game: Sam and Max


This patch implements the Sam & Max interpretation of
do_command(256). This command queries for the last
encountered marker ID, as set by SysEx code 0.

This command is used mostly during the opening
credits to cue each page of credits to the music, thus
causing the credits to span the music in full. It is also
used by the credits to wait until the end of the music
before switching rooms to the office scene.

SysEx code 0 implements triggered commands
specified by do_command(17), ImSetTrigger. This
modification also causes the SysEx response to store
its marker ID *if* no triggered event is already cued.

This business of using the marker ID to identify how far
the music has progressed is used, to my knoweldge,
only during the opening credits. I'm not sure if it's
appropriate to be storing the marker ID in the same slot
as used by ImSetTrigger (since if both are used one or
the other won't work), but I've tested most of the stops in
Sam & Max (the more musically complicated ones,
anyway), and I haven't found any case where this
actually causes unexpected behavior.

Finally, this patch makes a small change to
do_command(14), by preventing a volume fade from
occurring if the time-to-fade is 0. I only did this because
there is a deferred command showing up outside the
Ball of Twine that attempts to do a volume fade, but with
invalid parameters. The result is that the music gets
faded to 0 instantly, and is never heard from again. Until
this patch, the tracks weren't jumping around properly at
all, and this problem never had a chance to manifest
itself. I can't tell whether do_command(14) or the
deferred command mechanism is not implemented
properly. I'll be taking a closer look at that. In the
meantime, this change does not affect any other
observed occurrence of do_command(14).

This patch completes the array of fixes needed to make
the opening cutscene, opening credits, and seamless
transition to the office scene work perfectly. Knock on

Ticket imported from: #622386. Ticket imported from: patches/194.

Attachments (1)

imuse.docommand256.diff (2.0 KB ) - added by SF/jamieson630 17 years ago.
Patch against iMuse.cpp 1.54 (October 12, 2002)

Download all attachments as: .zip

Change History (4)

by SF/jamieson630, 17 years ago

Attachment: imuse.docommand256.diff added

Patch against iMuse.cpp 1.54 (October 12, 2002)

comment:1 by SF/ender, 17 years ago

Great work, this also fixes about 40-odd hangs in Sam and Max from
timing based on (256) events.

Perfect! :)

comment:2 by SF/ender, 17 years ago

Owner: set to SF/ender
Status: newclosed

comment:3 by digitall, 11 months ago

Component: Engine: SCUMM
Game: Sam and Max
Note: See TracTickets for help on using tickets.