Opened 16 months ago

Closed 6 weeks ago

#10907 closed defect (fixed)

SCI: Wrong music when restoring games

Reported by: sluicebox Owned by: ZvikaZ
Priority: normal Component: Engine: SCI
Keywords: midi Cc:
Game:

Description

ScummVM plays the wrong music when restoring SCI games in certain rooms. I have a reproducible test case in SQ4 but I've also seen this recently in LB2 and possibly ECO1.

To reproduce using any DOS version of SQ4:

  1. Warp to room 305. You'll exit the timepod on Estros.
  2. Go to room 320 down by the water (left, down, down)
  3. Save game
  4. Load game
  5. The music is now the ambush/submarine music

Win7x64, all audio settings are defaults. Occurs with latest code, but I tested as far back as 1.8 and it did the same.

Change History (4)

comment:1 by ZvikaZ, 4 months ago

Keywords: midi added

comment:2 by ZvikaZ, 4 months ago

If I understand this correctly, the problem isn't on restore, but rather with regular game play...

When restoring, and running 'songlib' on debugger, we get:

debug> songlib
Song library:
0: 0001:2138 (longSong2), resource id: 1142, status: Stopped, digital audio type
1: 0001:2108 (longSong), resource id: 57, status: Paused, MIDI type

And when getting there during game play, from room 310:

debug> songlib
Song library:
0: 0001:2138 (longSong2), resource id: 1142, status: Stopped, digital audio type
1: 0001:2108 (longSong), resource id: 18, status: Paused, MIDI type

i.e., the problem is that on restore we get resource id 57 (is that what you call ambush/submarine music music?), and on regular game play we get resource id 18.

However, according to SCICompanion, it seems that it should be 57 (from rm320:init):
(gLongSong number: 57 flags: 1 loop: -1)

Therefore, the question is not why we get 57 on restore, but why we don't get it on regular game play.

If anyone thinks I'm wrong, I'd be glad to hear :-)

comment:3 by ZvikaZ, 4 months ago

I was wrong, and @sluicebox' report is correct ;-)

The situation is like this:
When we enter room 320, longSong is still playing resource id 18, and prepares resource id 57 to be later played - that's the init line I've pasted.

Upon restoring, we think that 18 should be already replaced with the newer 57.

Fixed at https://github.com/scummvm/scummvm/pull/2128

comment:4 by bluegr, 6 weeks ago

Owner: set to ZvikaZ
Resolution: fixed
Status: newclosed

Thanks for your work! The relevant fix has been committed, so this can be closed now

Note: See TracTickets for help on using tickets.