Opened 5 months ago

Closed 4 months ago

#15212 closed defect (fixed)

SCI: PEPPER: Crash with savegame made with ScummVM's dialog

Reported by: eriktorbjorn Owned by: sluicebox
Priority: normal Component: Engine: SCI
Version: Keywords:
Cc: Game: Pepper's Adventures in Time

Description

This happens to me in Pepper's Adventures in Time (from Sierra's School House: Math). I don't know if other games are similarly afflicted. I tried a few, but couldn't reproduce it there.

Steps to reproduce:

  • Start the game and select chapter 1. Wait for the main music to begin.
  • Save the game using ScummVM's save dialog. (Either by using the game's toolbar icon, or by using ScummVM's menu, it doesn't seem to make any difference.)
  • Load this savegame.
  • Open the Restore dialog through the game's toolbar icon. (It won't happen if you open it through the ScummVM menu, apparently.) When the dialog appears, press Cancel. (It doesn't matter if you use the original dialogs or ScummVM's dialogs at this point.)

The game crashes with the following message:

ERROR: [pepper-1.000 120/0 kSetCursor @ 0679]: view resource 0 not found!

Savegames made with the original save dialog do not seem to have this problem.

Change History (4)

comment:1 by eriktorbjorn, 5 months ago

Here's what the "bt" debugger command says:

Call stack (current base: 0x0):
 0: script 0 - twisty::replay()
     obj@0001:1b1f pc=0001:01f2 sp=ST:0000 fp=ST:0000 argp:ST:0001
 1: script 994 - Game::replay()
     by 0 obj@0001:1b1f pc=0005:0461 sp=ST:0003 fp=ST:0002 argp:ST:0001
 2: script 0 - twisty::doit()
     by 1 obj@0001:1b1f pc=0001:047d sp=ST:0005 fp=ST:0005 argp:ST:0004
 3: script 994 - Game::doit()
     by 2 obj@0001:1b1f pc=0005:0514 sp=ST:000a fp=ST:0007 argp:ST:0006
 4: script 999 - export 7 (0001:1b1f, 0000:004c)
     by 3 obj@0001:1b1f pc=0004:02ca sp=ST:000d fp=ST:000d argp:ST:000a
 5: script 0 - twisty::restore()
     by 4 obj@0001:1b1f pc=0001:01db sp=ST:000f fp=ST:000f argp:ST:000e
 6: script 0 - twisty::setCursor(0000:0000, 0000:0001)
     by 5 obj@0001:1b1f pc=0001:0679 sp=ST:0028 fp=ST:0013 argp:ST:0010
 7:[6]  kSetCursor(0000:0000, 0000:0000, 0000:0000)
     by 6 obj@0000:0000 pc:none argp:ST:0028

When using a good savegame, the parameters to kSetCursorSci11() were 903, 0, 2.
When using a bad savegame in the same spot, the parameters to kSetCursorSci11() were 0, 0, 0.

That's as far as I'll get debugging this on my own.

comment:2 by sluicebox, 4 months ago

I see the problem; patchGameSaveRestoreSCI16 is broken. There's a TODO that says as much. It will take some script research to get it right. Good catch!

comment:3 by sluicebox <22204938+sluicebox@…>, 4 months ago

In ed8682df:

SCI: Fix issues with SCI16 save/restore UI patching

Game object save methods were being patched out by default, while
their restore methods weren't. This suppressed some game-specific
behavior and created a mismatch that could corrupt saves.

  • PEPPER saves at start of game no longer crash
  • KQ5 FM Towns now works with ScummVM restore UI
  • LSL6 auto save timer no longer launches ScummVM save UI
  • QFG3 no longer requires special handling

Fixes bug #15212

comment:4 by sluicebox, 4 months ago

Owner: set to sluicebox
Resolution: fixed
Status: newclosed

Fixes newly created saves

Note: See TracTickets for help on using tickets.