c_procret is equivalent to the "exit" command in Lingo, and must
clear any new stack items. The proper way to return values is with
b_return.
Fixes start sequence in Gus Goes to CyberStone Park.
Unsurprisingly SPUTM handles files via integer file
handles, instead of SeekableStream objects :-P
This means that scripts can (and will!) occasionally
send out a -1 file handle which means that:
- Write operations will result in NOP
- Read operations will result in reading the value 0
Closes#13863:
"SCUMM/HE: Blue's Treasure Hunt - Breakout
Minigame Editor crashes the program"
This game was trying to open the -1 file handle,
and therefore it crashed while trying to access
position -1 in our array of file streams :'(
Most dialogs now render correctly and the game is partly playable. Still a
bunch of work to do for inventory and menus to render correctly.
Added loading for TDS (talking head) data structures too, but they are not yet
used.
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
I wanted to do this for a very long time. This is helping me
debugging some very hard to understand remaining bugs
on some SCUMM HE games.
I tested this for several hours with several games,
including Moonbase and some Backyard games
ensuring there were no obvious regressions.
The functions that were passed to the constructor would not be called
in the order that they appear, causing the hotspot list to be initialized
incorrectly
This is the same fix as the one applied for per-scene globals in b2e6bc545a
Guard against potential cases where a scene global isn't correctly
set, and we fall back to game globals. This essentially resulted in
undefined behavior, so now we properly try to handle such cases, or
error out to detect potential game-breaking bugs
The functions that were passed to the constructor would not be called
in the order that they appear, causing the globals list to be initialized
incorrectly