Opened 15 years ago

Closed 15 years ago

Last modified 8 months ago

#8316 closed patch (fixed)

Possible fix for Sam & Max music glitch

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

Description

I've begun play-testing Sam & Max (talkie version) with
a January 27 CVS snapshot, but got side-tracked on the
following bug: When Doug tells me about the Ball of
Twine, the music goes silent.

This is what the script looks like:

[0D2E] (5D) if (ifClassOfIs(102,[19])) {
[0D3B] (AC) soundKludge([14,29,0,1,60,40])
[0D51] (5F) startScriptQuick(45,[102,1,1])
[0D61] (6C) break()
[0D62] (AC) soundKludge([14,29,0,1,127,100])
[0D78] (**) }

IMUSE command 14 is the Sam and Max "parameter fade",
which is here used to fade down the volume of the Mole
Man theme to 60. The US map is shown to reveal the
location of the Ball of Twine, and then the Mole Man
theme is faded back up. In theory.

Unfortunately it's not able to find player 29.
Apparently the US map script does one of those
temporary save/restore kind of things, and
ScummEngine::loadState() will call
_sound->stopAllSounds(), causing the music to stop.

The iMUSE state was not saved (and therefore not
restored) because _saveSound is 0 and
_saveLoadCompatible is 1. I can only assume that this
is deliberate, but it does mean that the music won't be
restarted. So in that case we shouldn't call
stopAllSounds(). Maybe not stopCD() either, but the CD
state is always saved as far as I can see.

Normally I might have simply applied this right away,
but since we're getting close to 0.6.0 I'd like some
feedback first to make sure I'm not missing anything
important.

Ticket imported from: #886058. Ticket imported from: patches/421.

Attachments (2)

samnmax.s20 (17.4 KB) - added by eriktorbjorn 15 years ago.
Savegame at Doug's place
samnmax.diff (966 bytes) - added by eriktorbjorn 15 years ago.
Patch against a January 27 CVS snapshot

Download all attachments as: .zip

Change History (12)

Changed 15 years ago by eriktorbjorn

Attachment: samnmax.s20 added

Savegame at Doug's place

comment:1 Changed 15 years ago by eriktorbjorn

Summary: Possible fix for Sam & Max music glitchPossible fix for Sam & Max music glitch

Changed 15 years ago by eriktorbjorn

Attachment: samnmax.diff added

Patch against a January 27 CVS snapshot

comment:2 Changed 15 years ago by fingolfin

Jamiesons might know more. Of course Jamieson currently isn't
"here", but I assign this to him anyway, just in case ... :-)

comment:3 Changed 15 years ago by fingolfin

Owner: set to SF/jamieson630

comment:4 Changed 15 years ago by eriktorbjorn

The music also goes quiet at Bumpusville when Bruno tells
you the location of the bigfoot party. I assume it's for the
same reason, because it didn't happen when I played the
scene with the patch applied, but I haven't had the time to
investigate any further.

comment:5 Changed 15 years ago by Kirben

That change is definately right for samnmax, I just checked
disasm. Original game only stopped all sounds when reloading
save game if _savesound was true.

comment:6 Changed 15 years ago by eriktorbjorn

What about the _saveLoadCompatible flag? Or is there no
corresponding flag in the original?

Speaking of that, why is there a 'compat' parameter to
saveState() and loadState()? As far as I can tell, it's
always the same as _saveLoadCompatible anyway.

comment:7 Changed 15 years ago by Kirben

I can't see anything like a _saveLoadCompatible flag in the
disasm. of original game.

comment:8 Changed 15 years ago by SF/ender

Owner: changed from SF/jamieson630 to SF/ender
Resolution: fixed
Status: newclosed

comment:9 Changed 15 years ago by SF/ender

It makes sense to me, anyway. The only area this particular
change could possibly break are temporary state saves, such as
some cutscenes in Tentacle and FOA. I didn't notice any
regressions in DOTT with this, so it should be fine. Applied.

comment:10 Changed 8 months ago by digitall

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