diff --git a/engines/scumm/room.cpp b/engines/scumm/room.cpp index b20a3a0a99c..0b63b552d2a 100644 --- a/engines/scumm/room.cpp +++ b/engines/scumm/room.cpp @@ -150,6 +150,11 @@ void ScummEngine::startScene(int room, Actor *a, int objectNr) { _ENCD_offs = _EXCD_offs = 0; _numObjectsInRoom = 0; return; + } else if (_game.id == GID_LOOM && _game.version == 4) { + // This is specific for LOOM VGA Talkie. It forces a + // redraw of the verbs screen. The original interpreter + // does this here... + VAR(66) = 1; } setupRoomSubBlocks(); diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp index 804e7023aed..eb0a35d677e 100644 --- a/engines/scumm/script.cpp +++ b/engines/scumm/script.cpp @@ -37,12 +37,12 @@ namespace Scumm { /* Start executing script 'script' with the given parameters */ void ScummEngine::runScript(int script, bool freezeResistant, bool recursive, int *lvarptr, int cycle) { ScriptSlot *s; - //byte *scriptPtr; + uint32 scriptOffs; byte scriptType; int slot; - if (!script) + if (!script) return; if (!recursive) diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index e0ffa030a44..2b0d9bf1775 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -2874,33 +2874,6 @@ void ScummEngine_v5::o5_verbOps() { default: break; } - } else if (_game.id == GID_LOOM && _game.version == 4) { - // FIXME: hack loom notes into right spot - if ((verb >= 90) && (verb <= 97)) { // Notes - switch (verb) { - case 90: - case 91: - vs->curRect.top -= 7; - break; - case 92: - vs->curRect.top -= 6; - break; - case 93: - vs->curRect.top -= 4; - break; - case 94: - vs->curRect.top -= 3; - break; - case 95: - vs->curRect.top -= 1; - break; - case 97: - vs->curRect.top -= 5; - break; - default: - break; - } - } } else if (_game.platform == Common::kPlatformFMTowns && ConfMan.getBool("trim_fmtowns_to_200_pixels")) { if (_game.id == GID_ZAK && verb == 116) // WORKAROUND: FM-TOWNS Zak used the extra 40 pixels at the bottom to increase the inventory to 10 items diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index b7fc6f51ce3..5620369ce2f 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -2468,17 +2468,6 @@ load_game: scummLoop_handleSaveLoad(); if (_completeScreenRedraw) { - clearCharsetMask(); - _charset->_hasMask = false; - - if (_game.version > 3) { - if (_townsPlayer) - _townsPlayer->restoreAfterLoad(); - - for (int i = 0; i < _numVerbs; i++) - drawVerb(i, 0); - } - // Update volume settings syncSoundSettings(); @@ -2689,7 +2678,7 @@ void ScummEngine::scummLoop_handleSaveLoad() { } void ScummEngine_v3::scummLoop_handleSaveLoad() { - bool processIQPoints = (_game.id == GID_INDY3) && (_saveLoadFlag == 2 || _loadFromLauncher); + bool processIQPoints = (_game.id == GID_INDY3 && (_saveLoadFlag == 2 || _loadFromLauncher)); _loadFromLauncher = false; ScummEngine::scummLoop_handleSaveLoad(); @@ -2805,7 +2794,7 @@ void ScummEngine_v3::scummLoop_handleSaveLoad() { } void ScummEngine_v5::scummLoop_handleSaveLoad() { - bool processIQPoints = (_game.id == GID_INDY4) && (_saveLoadFlag == 2 || _loadFromLauncher); + bool processIQPoints = (_game.id == GID_INDY4 && (_saveLoadFlag == 2 || _loadFromLauncher)); _loadFromLauncher = false; ScummEngine::scummLoop_handleSaveLoad(); @@ -2847,15 +2836,27 @@ void ScummEngine_v5::scummLoop_handleSaveLoad() { runScript(VAR(VAR_ENTRY_SCRIPT2), 0, 0, nullptr); } } - bool redrawDistaff = (_game.id == GID_LOOM && _saveLoadFlag == 2 && VAR(150) == 2); - if (redrawDistaff) { - // Restore distaff and notes for LOOM VGA Talkie. - int args[NUM_SCRIPT_LOCAL]; - memset(args, 0, sizeof(args)); - args[0] = 2; - runScript(18, 0, 0, args); - //VAR(152) = VAR(153) = 0; + + if (_completeScreenRedraw) { + clearCharsetMask(); + _charset->_hasMask = false; + + if (_townsPlayer) + _townsPlayer->restoreAfterLoad(); + + redrawVerbs(); + + // For LOOM VGA Talkie, we restore the text glyphs on top of the note verbs + // and also restore the text description on top of the image of the selected + // object in the bottom right corner. + // These text parts are not actually connected to the verbs (which are image + // verbs only). redrawVerbs() will not restore them. They require some script + // work. The original interpreter just sets this variable after loading. + // Apparently, this is the trigger for all necessary steps to happen... + if (_game.id == GID_LOOM) + VAR(66) = 1; } + // update IQ points after loading if (processIQPoints) runScript(145, 0, 0, nullptr); @@ -2892,6 +2893,12 @@ void ScummEngine_v6::scummLoop_handleSaveLoad() { } } } + + if (_completeScreenRedraw) { + clearCharsetMask(); + _charset->_hasMask = false; + redrawVerbs(); + } } #ifdef ENABLE_SCUMM_7_8 diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp index baceee2729f..6d535bab383 100644 --- a/engines/scumm/verbs.cpp +++ b/engines/scumm/verbs.cpp @@ -1181,6 +1181,9 @@ void ScummEngine::drawVerbBitmap(int verb, int x, int y) { xstrip = x / 8; ydiff = y - vs->topline; + if (_game.version == 4) + ydiff &= ~7; + obim = getResourceAddress(rtVerb, verb); assert(obim); if (_game.features & GF_OLD_BUNDLE) {