[Scummvm-git-logs] scummvm master -> 319e50fc3555d458302cb7bebf20940430fee1ff

athrxx noreply at scummvm.org
Wed Aug 10 13:28:19 UTC 2022


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d4ad27547e SCUMM: (v5/6/EGA) - disable palManipulate in EGA dithering mode.
319e50fc35 SCUMM: (LOOM/VGA Talkie) - improve verb handling


Commit: d4ad27547e31adf87c9591d599f62ce9091240e9
    https://github.com/scummvm/scummvm/commit/d4ad27547e31adf87c9591d599f62ce9091240e9
Author: athrxx (athrxx at scummvm.org)
Date: 2022-08-10T15:27:19+02:00

Commit Message:
SCUMM: (v5/6/EGA) - disable palManipulate in EGA dithering mode.

The orginal does not have an EGA mode implementation for this. For INDY4 (which uses palManipulate) the EGA mode has been ditched completely in the full version. I have tried to make a palManipulate implementation for ScummVM, but it is just glitchy and ugly...

Changed paths:
    engines/scumm/palette.cpp


diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index 8dc27f30f5a..b8fc627cb0d 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -795,7 +795,10 @@ void ScummEngine::palManipulateInit(int resID, int start, int end, int time) {
 	// This function is actually a nullsub in Indy4 Amiga.
 	// It might very well be a nullsub in other Amiga games, but for now I
 	// limit this to Indy4 Amiga, since that is the only game I can check.
-	if (_game.platform == Common::kPlatformAmiga && _game.id == GID_INDY4)
+	// UPDATE: Disable it for EGA mode, too. The original does not handle this. For
+	// Indy4 they just disabled the EGA mode completely. I have tried to make an EGA
+	// implementation, but it looks glitchy and unpleasant.
+	if ((_game.platform == Common::kPlatformAmiga && _game.id == GID_INDY4) || _enableEGADithering)
 		return;
 
 	byte *string1 = getStringAddress(resID);
@@ -839,6 +842,9 @@ void ScummEngine::palManipulateInit(int resID, int start, int end, int time) {
 void ScummEngine_v6::palManipulateInit(int resID, int start, int end, int time) {
 	const byte *new_pal;
 
+	if (_enableEGADithering)
+		return;
+
 	new_pal = getPalettePtr(resID, _roomResource);
 
 	new_pal += start*3;
@@ -981,7 +987,7 @@ void ScummEngine::setShadowPalette(int redScale, int greenScale, int blueScale,
 }
 
 byte egaFindBestMatch(int r, int g, int b) {
-	// This mostly like the normal EGA palette, but a bit different
+	// This is almost like the normal EGA palette, but a bit different
 	static const byte matchPalette[] = {
 		0x00, 0x00, 0x00, 	0x00, 0x00, 0xAB, 	0x00, 0xAB, 0x00, 	0x00, 0xAB, 0xAB,
 		0xAB, 0x00, 0x00, 	0xAB, 0x00, 0xAB, 	0xAB, 0x57, 0x00, 	0xAB, 0xAB, 0xAB,


Commit: 319e50fc3555d458302cb7bebf20940430fee1ff
    https://github.com/scummvm/scummvm/commit/319e50fc3555d458302cb7bebf20940430fee1ff
Author: athrxx (athrxx at scummvm.org)
Date: 2022-08-10T15:27:23+02:00

Commit Message:
SCUMM: (LOOM/VGA Talkie) - improve verb handling

- get rid of weird hackery in o5_verbOps
- make sure the verbs are properly restored after loading a savegame

Changed paths:
    engines/scumm/room.cpp
    engines/scumm/script.cpp
    engines/scumm/script_v5.cpp
    engines/scumm/scumm.cpp
    engines/scumm/verbs.cpp


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) {




More information about the Scummvm-git-logs mailing list