[Scummvm-git-logs] scummvm master -> 62ed7735a7616c1115eee136870cb7b652aa851b

AndywinXp noreply at scummvm.org
Mon Oct 28 07:25:38 UTC 2024


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

Summary:
7d3a3532cc SCUMM: Implement gamma correction for Mac games
67b0440ad0 SCUMM: MI1 (Mac): Implement EPX scaling and a stub for the menu
1e8aea717d SCUMM: MI1 (Mac): Bring Mac menu to a non-crashing state
9f319cdd86 SCUMM: Add Mac screen implementation for remaining LEC games
2d12a2f5bd SCUMM: Add post-load fix comments
705d6ded4b SCUMM: Add preliminary support for Mac GUI for remaining v5 games
2e03c25bb1 SCUMM: Fix nullptr usage
ffaacd8099 SCUMM: Implement proper Mac cursors for MI2 and INDY4
a68ded4457 SCUMM: Fix EPX algorithm edge case
8f99ad12ae SCUMM: Fix warning in input.cpp
41cfe0f9cf SCUMM: Clean up Mac screen filtering code
0558adf4af SCUMM: Refactor Mac scaling algorithms to implement cursor handling
6b28d2c814 SCUMM: Assign Mac smoothing to config entry & implement Speech menu
469ff7e63c SCUMM: MACGUI: Add initial version of MI1 Mac About dialog
9067c96f54 SCUMM: MACGUI: Fix switch fallthrough
679d3eab25 IMAGE: PICT: Add opcodes PnPat, ShortLine, ShortLineFrom
94ffe09168 SCUMM: MACGUI: Remove most hard-coded blacks and whites from common code
61f19fa472 SCUMM: MACGUI: Remove palette handling for PICT images
9708884d0c SCUMM: MI2/INDY4: Parse Mac STRS strings
3670cd934b SCUMM: MACGUI: Remove last hard-coded colors from common code
8cf49f4efd SCUMM: MACGUI: Move 16 color constants to its own header file
387f4cfae3 SCUMM: v5 (Mac): Fix Y offset glitches during Mac GUI interactions
73c50e9546 SCUMM: MACGUI: Add About dialog for Fate of Atlantis
fa4b5734d0 SCUMM: MI1 (Mac): Stub GUI options for enabling/disabling sound
7cb1e89056 SCUMM: add sound enable menu options (WIP)
ec135b3f14 SCUMM: (MI1/Mac) - finish menu option for sound enabling/disabling
f8c0357567 SCUMM: remove unused var
9d5f734a7c SCUMM: MACGUI: Add initial work on MI2 About dialog
90b5a73825 GRAPHICS: MACGUI: Add kWMModeForceMacFonts flag
fd58a2b4c9 SCUMM: Add kWMModeForceMacFonts flag on Mac GUI
ce721e3d62 SCUMM: MACGUI: Add the remaining MI2 About screens
9d0dec6a75 SCUMM: MACGUI: Fix GUI colors, most noticeably in Fate of Atlantis
63fa812583 SCUMM: MACGUI: Initial implementation of the "rough" command
252ff4c831 SCUMM: INDY4: Admit more executable names
70ca4bd346 SCUMM: (Loom/Mac) - make sound toggle widget use ConfMan settings
c3934602bc SCUMM: (Indy3/Mac) - fix menu sound toggle options
d63e086a51 SCUMM: MACGUI: Finish up the "rough" command
f3e1a1f697 SCUMM: MACGUI: Moved some common code into runAboutDialog()
93b9e23130 SCUMM: Fix Mac PICT hardcoded black and white colors
0b02574b02 SCUMM: MACGUI: Add the monkey graphics to the MI1 About dialog
ae795675fe SCUMM: Rework Mac STRS handling
6e1879f611 SCUMM: MACGUI: Add strings table for another Fate of Atlantis version
0324de1b5b SCUMM: MACGUI: Add another Monkey Island 2 variant
4ad96f14f9 SCUMM: MACGUI: Add size information about some other Mac games
007d56d9c9 SCUMM: Fix "rough" command on MI1 Mac
9e4a4f8c77 GRAPHICS: Cleaned up and renamed unpackBitsRgn()
71bb8340f6 SCUMM: MACGUI: Add LucasArts logo to the MI1/MI2/Indy4 About dialogs
c5b62faf14 SCUMM: Fix and clean up more STRS handling
47ed8016d4 SCUMM: INDY3/LOOM: Fix artifacts caused by Mac screen Y offset
4ec15a7932 SCUMM: Move Mac STRS handling to macgui_strings.cpp
1310dd09df SCUMM: Rename MacMI1Gui to MacV5Gui and macgui_mi1.* to macgui_v5.*
4c5410cff1 SCUMM: Update macgui_v5 comment
d91e4c354f SCUMM: MACGUI: Clean up the "extra bold" About style
823942358c SCUMM: MACGUI: Improve the rendering of "Monkey Island 2"
0dff9ec14e SCUMM: MACGUI: Cheat to make "Monkey Island 2" look correct
24d41f5bb1 SCUMM: MACGUI: Fix memory leaks
da21a245d1 SCUMM: Disable some main menu (and other stuff) for _macGui games
144c0449e8 SCUMM: MACGUI: Fix uninitialized variable in Monkey Island 1
cf74d2db74 SCUMM: MACGUI: Fix invalid read at end of string parsing
6d2b4e63ff SCUMM: Remove special palette case for Macintosh black-and-white
1c3d41edf7 SCUMM: MACGUI: Move default save/load into macgui_impl.cpp
001e43d12c SCUMM: MACGUI: Fix Speech settings menu
2194bcab96 SCUMM: MACGUI: Fix cursor handling when saving/loading
16f24b9cfd SCUMM: MACGUI: Improved the fake save/load "widgets"
261b4019d5 SCUMM: MACGUI: Scribble on the fake Mac menu bar when opening dialogs
b48c875817 SCUMM: MACGUI: Minor cosmetic fixes for the menu
cc9624ec3c SCUMM: MACGUI: Fix Open dialog regression
5afeb4854e SCUMM: GFX: Remove dissolve effect from Mac versions
74c57ebc4e SCUMM: MACGUI: Make standard open/close dialogs more robust
95ad13f678 SCUMM: MACGUI: Eliminate more hard-coded widget IDs
d5b6565556 SCUMM: MACGUI: Update widget list comment for V5 options dialog
15daa77e03 SCUMM: MACGUI: Add defines for some magic numbers
f4725a7207 SCUMM: MACGUI: Rename some variables for consistency
90094b99b2 SCUMM: MACGUI: Tiny cleanup
4e6dd93969 SCUMM: MACGUI: Fix default widget for several dialogs
fe184d5ea5 SCUMM: LOOM (Mac): Use iris fade instead of dissolveEffect
28cf83aee1 SCUMM: MACGUI: Handle differences in options dialog for V5 games
ce6e1f7031 SCUMM: INDY3 (Mac): Use iris effect instead of dissolve
bdbc4ac66c SCUMM: MI1 (Mac): Correctly handle dissolve effect path
6989b2205d SCUMM: Clean up dissolveEffect() slighty for Mac versions
f831831c88 SCUMM: Fix scroll screen transition for _macScreen games
62ed7735a7 SCUMM: Remember when music is stopped, even while it's muted


Commit: 7d3a3532cc32369083c5ccdc8cec74a4768c1c26
    https://github.com/scummvm/scummvm/commit/7d3a3532cc32369083c5ccdc8cec74a4768c1c26
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Implement gamma correction for Mac games

Changed paths:
    engines/scumm/palette.cpp
    engines/scumm/scumm.h
    engines/scumm/smush/smush_player.cpp
    graphics/macega.h


diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index 9bf8afe63fc..5c73b3da888 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -238,8 +238,6 @@ void ScummEngine::resetPalette() {
 		default:
 			if ((_game.platform == Common::kPlatformAmiga) || (_game.platform == Common::kPlatformAtariST))
 				setPaletteFromTable(tableAmigaPalette, sizeof(tableAmigaPalette) / 3);
-			else if ((_game.id == GID_LOOM || _game.id == GID_INDY3) && _game.platform == Common::kPlatformMacintosh)
-				setPaletteFromTable(Graphics::macEGAPalette, sizeof(Graphics::macEGAPalette) / 3);
 			else
 				setPaletteFromTable(tableEGAPalette, sizeof(tableEGAPalette) / 3);
 		}
@@ -1649,8 +1647,8 @@ void ScummEngine::updatePalette() {
 	if (_palDirtyMax == -1)
 		return;
 
-	byte palette_colors[3 * 256];
-	byte *p = palette_colors;
+	byte paletteColors[3 * 256];
+	byte *p = paletteColors;
 	int first;
 	int num;
 
@@ -1725,7 +1723,7 @@ void ScummEngine::updatePalette() {
 #ifdef USE_RGB_COLOR
 #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
 	if (_game.platform == Common::kPlatformFMTowns) {
-		p = palette_colors;
+		p = paletteColors;
 		for (int i = first; i < first + num; ++i) {
 			_16BitPalette[i] = get16BitColor(p[0], p[1], p[2]);
 			p += 3;
@@ -1735,7 +1733,15 @@ void ScummEngine::updatePalette() {
 #endif
 #endif
 
-	_system->getPaletteManager()->setPalette(palette_colors, first, num);
+	if (_game.platform == Common::kPlatformMacintosh && _game.heversion == 0) {
+		for (int i = 0; i < ARRAYSIZE(paletteColors); i += 3) {
+			paletteColors[i] = _macGammaCorrectionLookUp[paletteColors[i]];
+			paletteColors[i + 1] = _macGammaCorrectionLookUp[paletteColors[i + 1]];
+			paletteColors[i + 2] = _macGammaCorrectionLookUp[paletteColors[i + 2]];
+		}
+	}
+
+	_system->getPaletteManager()->setPalette(paletteColors, first, num);
 }
 
 } // End of namespace Scumm
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 2c3c4ac41cb..3725d6ed1c9 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -661,6 +661,25 @@ protected:
 	virtual void setCursorHotspot(int x, int y) {}
 	virtual void setCursorFromBuffer(const byte *ptr, int width, int height, int pitch, bool preventScale = false) {}
 
+	// Gamma curve lookup, from the Macintosh Quadra/Performa monitor driver
+	byte _macGammaCorrectionLookUp[256] = {
+		0x00, 0x05, 0x09, 0x0B, 0x0E, 0x10, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1E, 0x20, 0x22, 0x24,
+		0x25, 0x27, 0x28, 0x2A, 0x2C, 0x2D, 0x2F, 0x30, 0x31, 0x33, 0x34, 0x36, 0x37, 0x38, 0x3A, 0x3B,
+		0x3C, 0x3E, 0x3F, 0x40, 0x42, 0x43, 0x44, 0x45, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4D, 0x4E, 0x4F,
+		0x50, 0x51, 0x52, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5E, 0x5F, 0x60, 0x61,
+		0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71,
+		0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, 0x80, 0x81,
+		0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8C, 0x8D, 0x8E, 0x8F,
+		0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9B, 0x9C, 0x9D,
+		0x9E, 0x9F, 0xA0, 0xA1, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB,
+		0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8,
+		0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBC, 0xBD, 0xBE, 0xBF, 0xC0, 0xC0, 0xC1, 0xC2, 0xC3, 0xC3, 0xC4,
+		0xC5, 0xC6, 0xC7, 0xC7, 0xC8, 0xC9, 0xCA, 0xCA, 0xCB, 0xCC, 0xCD, 0xCD, 0xCE, 0xCF, 0xD0, 0xD0,
+		0xD1, 0xD2, 0xD3, 0xD3, 0xD4, 0xD5, 0xD6, 0xD6, 0xD7, 0xD8, 0xD9, 0xD9, 0xDA, 0xDB, 0xDC, 0xDC,
+		0xDD, 0xDE, 0xDF, 0xDF, 0xE0, 0xE1, 0xE1, 0xE2, 0xE3, 0xE4, 0xE4, 0xE5, 0xE6, 0xE7, 0xE7, 0xE8,
+		0xE9, 0xE9, 0xEA, 0xEB, 0xEC, 0xEC, 0xED, 0xEE, 0xEE, 0xEF, 0xF0, 0xF1, 0xF1, 0xF2, 0xF3, 0xF3,
+		0xF4, 0xF5, 0xF5, 0xF6, 0xF7, 0xF8, 0xF8, 0xF9, 0xFA, 0xFA, 0xFB, 0xFC, 0xFC, 0xFD, 0xFE, 0xFF
+	};
 
 public:
 	void pauseGame();
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp
index 998c9708510..893198daf4a 100644
--- a/engines/scumm/smush/smush_player.cpp
+++ b/engines/scumm/smush/smush_player.cpp
@@ -1272,7 +1272,18 @@ void SmushPlayer::play(const char *filename, int32 speed, int32 offset, int32 st
 		_vm->parseEvents();
 		_vm->processInput();
 		if (_palDirtyMax >= _palDirtyMin) {
-			_vm->_system->getPaletteManager()->setPalette(_pal + _palDirtyMin * 3, _palDirtyMin, _palDirtyMax - _palDirtyMin + 1);
+			// Apply gamma correction for Mac versions
+			if (_vm->_game.platform == Common::kPlatformMacintosh) {
+				byte palette[768];
+				memcpy(palette, _pal, 768);
+				for (int i = 0; i < ARRAYSIZE(palette); i++) {
+					palette[i] = _vm->_macGammaCorrectionLookUp[_pal[i]];
+				}
+
+				_vm->_system->getPaletteManager()->setPalette(palette + _palDirtyMin * 3, _palDirtyMin, _palDirtyMax - _palDirtyMin + 1);
+			} else {
+				_vm->_system->getPaletteManager()->setPalette(_pal + _palDirtyMin * 3, _palDirtyMin, _palDirtyMax - _palDirtyMin + 1);
+			}
 
 			_palDirtyMax = -1;
 			_palDirtyMin = 256;
diff --git a/graphics/macega.h b/graphics/macega.h
index 9a8b6e55a1a..4b2719cfda4 100644
--- a/graphics/macega.h
+++ b/graphics/macega.h
@@ -23,30 +23,6 @@
 
 namespace Graphics {
 
-// This is the palette that Basilisk II uses by default for 16-color games.
-// It's basically the same as EGA, but a little bit brighter. While it does
-// seem like games can have their own palette (CLUT) resources, at least Loom
-// didn't seem to use it. (I could be wrong about that.)
-
-static const byte macEGAPalette[] = {
-	0x00, 0x00, 0x00,	// Black
-	0x00, 0x00, 0xBE,	// Blue
-	0x00, 0xBE, 0x00,	// Green
-	0x00, 0xBE, 0xBE,	// Cyan
-	0xBE, 0x00, 0x00,	// Red
-	0xBE, 0x00, 0xBE,	// Magenta
-	0xBE, 0x75, 0x00,	// Brown
-	0xBE, 0xBE, 0xBE,	// Light Gray
-	0x75, 0x75, 0x75,	// Dark Gray
-	0x75, 0x75, 0xFC,	// Bright Blue
-	0x75, 0xFC, 0x75,	// Bright Green
-	0x75, 0xFC, 0xFC,	// Bright Cyan
-	0xFC, 0x75, 0x75,	// Bright Red
-	0xFC, 0x75, 0xFC,	// Bright Magenta
-	0xFC, 0xFC, 0x75,	// Bright Yellow
-	0xFC, 0xFC, 0xFC	// White
-};
-
 // Each color has its own 2x2 dithering pattern. This array remaps them to the
 // color indexes for black and white. The order of the pixels is upper left,
 // upper right, lower left, lower right. I don't know if this is the standard


Commit: 67b0440ad03bd555c365272acff65bb55a5eb962
    https://github.com/scummvm/scummvm/commit/67b0440ad03bd555c365272acff65bb55a5eb962
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MI1 (Mac): Implement EPX scaling and a stub for the menu

Changed paths:
  A engines/scumm/macgui/macgui_mi1.cpp
  A engines/scumm/macgui/macgui_mi1.h
    engines/scumm/charset.cpp
    engines/scumm/gfx.cpp
    engines/scumm/gfx_gui.cpp
    engines/scumm/input.cpp
    engines/scumm/macgui/macgui.cpp
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/module.mk
    engines/scumm/script_v5.cpp
    engines/scumm/scumm.cpp
    engines/scumm/scumm.h
    engines/scumm/string.cpp


diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index 21f4ef66f71..5863f908361 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -1265,7 +1265,7 @@ void CharsetRendererClassic::printCharIntern(bool is2byte, const byte *charPtr,
 			dstPtr = vs->getPixels(_left, drawTop);
 		} else {
 			dstSurface = _vm->_textSurface;
-			dstPtr = (byte *)_vm->_textSurface.getBasePtr(_left * _vm->_textSurfaceMultiplier, (_top - _vm->_screenTop - _vm->_screenDrawOffset) * _vm->_textSurfaceMultiplier);
+			dstPtr = (byte *)_vm->_textSurface.getBasePtr(_left * _vm->_textSurfaceMultiplier, (_top - _vm->_screenTop) * _vm->_textSurfaceMultiplier);
 		}
 
 		if (_blitAlso && vs->hasTwoBuffers) {
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 5e4fdb84c5e..1964bd9ade4 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -660,7 +660,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
 	if (width <= 0 || height <= 0)
 		return;
 
-	if (_macScreen) {
+	if (_macScreen && _game.version == 3) {
 		mac_drawStripToScreen(vs, top, x, y, width, height);
 		return;
 	}
@@ -800,8 +800,87 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
 		}
 	}
 
-	// Finally blit the whole thing to the screen
-	_system->copyRectToScreen(src, pitch, x, y, width, height);
+	if (_macScreen && _game.platform == Common::kPlatformMacintosh && _game.version > 3) {
+		const byte *pixels = (const byte *)src;
+		byte *mac = (byte *)_macScreen->getBasePtr(x * 2, y * 2);
+
+		int pixelsPitch = pitch;
+		int macPitch = _macScreen->pitch;
+
+		int originalScreenWidth = 320;
+		int originalScreenHeight = 240;
+
+		// Composite the dirty rectangle into _completeScreen
+		for (int h = 0; h < height; h++) {
+			for (int w = 0; w < width; w++) {
+				// Calculate absolute coordinates in the complete screen
+				int absX = x + w;
+				int absY = y + h;
+
+				// Update the complete screen buffer
+				_completeScreenBuffer[absY * originalScreenWidth + absX] = pixels[w];
+			}
+
+			pixels += pixelsPitch;
+		}
+
+		// Reset pixels pointer for processing
+		pixels = (const byte *)src;
+
+		if (_useMacGraphicsSmoothing) {
+			// Apply the EPX/Scale2x algorithm
+			for (int h = 0; h < height; h++) {
+				for (int w = 0; w < width; w++) {
+					// Center pixel
+					byte P = pixels[w];
+
+					// Calculate absolute screen coordinates of the current pixel
+					int absX = x + w;
+					int absY = y + h;
+
+					// Top neighbor (A)
+					byte A = (absY > 0) ? _completeScreenBuffer[(absY - 1) * originalScreenWidth + absX] : P;
+
+					// Right neighbor (B)
+					byte B = (absX < originalScreenWidth - 1) ? _completeScreenBuffer[absY * originalScreenWidth + (absX + 1)] : P;
+
+					// Left neighbor (C)
+					byte C = (absX > 0) ? _completeScreenBuffer[absY * originalScreenWidth + (absX - 1)] : P;
+
+					// Bottom neighbor (D)
+					byte D = (absY < originalScreenHeight - 1) ? _completeScreenBuffer[(absY + 1) * originalScreenWidth + absX] : P;
+
+					// Actually scale the pixel
+					mac[2 * w] = (C == A && C != D && A != B) ? A : P;                // Top-left
+					mac[2 * w + 1] = (A == B && A != C && B != D) ? B : P;            // Top-right
+					mac[2 * w + macPitch] = (D == C && D != B && C != A) ? C : P;     // Bottom-left
+					mac[2 * w + macPitch + 1] = (B == D && B != A && D != C) ? D : P; // Bottom-right
+				}
+
+				pixels += pixelsPitch;
+				mac += macPitch * 2;
+			}
+		} else {
+			// Just double the resolution
+			for (int h = 0; h < height; h++) {
+				for (int w = 0; w < width; w++) {
+					mac[2 * w] = pixels[w];
+					mac[2 * w + 1] = pixels[w];
+					mac[2 * w + macPitch] = pixels[w];
+					mac[2 * w + macPitch + 1] = pixels[w];
+				}
+
+				pixels += pixelsPitch;
+
+				mac += macPitch * 2;
+			}
+		}
+
+		_system->copyRectToScreen(_macScreen->getBasePtr(x * 2, y * 2), _macScreen->pitch, x * 2, y * 2, width * 2, height * 2);
+	} else {
+		// Finally blit the whole thing to the screen
+		_system->copyRectToScreen(src, pitch, x, y, width, height);
+	}
 }
 
 const byte *ScummEngine::postProcessDOSGraphics(VirtScreen *vs, int &pitch, int &x, int &y, int &width, int &height) const {
@@ -1627,7 +1706,8 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) {
 }
 
 void ScummEngine::drawLine(int x1, int y1, int x2, int y2, int color) {
-	if (_game.platform == Common::kPlatformFMTowns && _game.version == 5) {
+	if ((_game.platform == Common::kPlatformFMTowns && _game.version == 5) ||
+		(_game.platform == Common::kPlatformMacintosh && _game.version > 3)) {
 		drawBox(x1, y1, x2, y2, color);
 		return;
 	}
@@ -1641,7 +1721,7 @@ void ScummEngine::drawLine(int x1, int y1, int x2, int y2, int color) {
 
 	VirtScreen *vs;
 
-	if ((vs = findVirtScreen(y1)) == nullptr)
+	if ((vs = findVirtScreen(y1 + _screenDrawOffset)) == nullptr)
 		return;
 
 	black = getPaletteColorFromRGB(_currentPalette, 0x00, 0x00, 0x00);
@@ -4697,7 +4777,7 @@ void ScummEngine::dissolveEffect(int width, int height) {
 			towns_drawStripToScreen(vs, x, y + vs->topline, x, y, width, height);
 		else
 #endif
-		if (_macScreen)
+		if (_macScreen && _game.version == 3)
 			mac_drawStripToScreen(vs, y, x, y + vs->topline, width, height);
 		else if (IS_ALIGNED(width, 4))
 			drawStripToScreen(vs, x, width, y, y + height);
diff --git a/engines/scumm/gfx_gui.cpp b/engines/scumm/gfx_gui.cpp
index 561f5760564..1e772b05bb4 100644
--- a/engines/scumm/gfx_gui.cpp
+++ b/engines/scumm/gfx_gui.cpp
@@ -1426,7 +1426,7 @@ void ScummEngine::saveSurfacesPreGUI() {
 					if (_tempTextSurface[x + y * _screenWidth] != 0xFD) {
 						if (x < _virtscr[kMainVirtScreen].pitch && y < _virtscr[kMainVirtScreen].h)
 							_virtscr[kMainVirtScreen].setPixel((_virtscr[kMainVirtScreen].xstart + x) % _virtscr[kMainVirtScreen].pitch,
-								y + (_virtscr[kMainVirtScreen].xstart + x) / _virtscr[kMainVirtScreen].pitch, _tempTextSurface[x + y * _screenWidth]);
+								y - _screenDrawOffset + (_virtscr[kMainVirtScreen].xstart + x) / _virtscr[kMainVirtScreen].pitch, _tempTextSurface[x + y * _screenWidth]);
 					}
 				}
 			}
@@ -2603,7 +2603,7 @@ void ScummEngine::showMainMenu() {
 		!(_game.platform == Common::kPlatformSegaCD && hasLoadedState)) {
 		restoreCursorPostMenu();
 	} else if (_saveLoadFlag == 2) {
-		_cursor.state = 0;
+		_cursor.state = (_game.id == GID_MONKEY && _game.platform == Common::kPlatformMacintosh) ? 1 : 0;
 	}
 
 	// Run the exit savescreen script, if available
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index 4da6a1803bf..d4a940d2e6f 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -244,7 +244,7 @@ void ScummEngine::parseEvent(Common::Event event) {
 				_mouse.y = _mouse.y * 4 / 7;
 			}
 
-		} else if (_textSurfaceMultiplier == 2 || _renderMode == Common::kRenderCGA_BW || _enableEGADithering) {
+		} else if ((_textSurfaceMultiplier == 2 || _game.version > 3 && _macScreen) || _renderMode == Common::kRenderCGA_BW || _enableEGADithering) {
 			_mouse.x >>= 1;
 			_mouse.y >>= 1;
 		}
@@ -977,7 +977,7 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) {
 			} else {
 				// Force the cursor OFF...
 				int8 oldCursorState = _cursor.state;
-				_cursor.state = 0;
+				_cursor.state = (_game.id == GID_MONKEY && _game.platform == Common::kPlatformMacintosh) ? 1 : 0;
 				CursorMan.showMouse(_cursor.state > 0);
 				// "Game Paused.  Press SPACE to Continue."
 				if (_game.version > 4)
diff --git a/engines/scumm/macgui/macgui.cpp b/engines/scumm/macgui/macgui.cpp
index 1efd1342b06..ac1e659653a 100644
--- a/engines/scumm/macgui/macgui.cpp
+++ b/engines/scumm/macgui/macgui.cpp
@@ -26,6 +26,7 @@
 #include "scumm/macgui/macgui_impl.h"
 #include "scumm/macgui/macgui_indy3.h"
 #include "scumm/macgui/macgui_loom.h"
+#include "scumm/macgui/macgui_mi1.h"
 
 namespace Scumm {
 
@@ -39,6 +40,12 @@ MacGui::MacGui(ScummEngine *vm, const Common::Path &resourceFile) {
 		_impl = new MacLoomGui(vm, resourceFile);
 		break;
 
+	case GID_MONKEY:
+	case GID_MONKEY2:
+	case GID_INDY4:
+		_impl = new MacMI1Gui(vm, resourceFile);
+		break;
+
 	default:
 		error("MacGui: Invalid game id %d", vm->_game.id);
 		break;
diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index dfb7034807d..b0e4887fc39 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -398,8 +398,11 @@ void MacGuiImpl::updateWindowManager() {
 	Graphics::MacMenuItem *loadMenu = menu->getSubMenuItem(gameMenu, 0);
 	Graphics::MacMenuItem *saveMenu = menu->getSubMenuItem(gameMenu, 1);
 
-	loadMenu->enabled = canLoad;
-	saveMenu->enabled = canSave;
+	if (loadMenu)
+		loadMenu->enabled = canLoad;
+
+	if (saveMenu)
+		saveMenu->enabled = canSave;
 
 	if (isActive) {
 		if (!_menuIsActive) {
diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
new file mode 100644
index 00000000000..611e7e6d4d7
--- /dev/null
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -0,0 +1,749 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/system.h"
+#include "common/config-manager.h"
+#include "common/macresman.h"
+
+#include "engines/engine.h"
+
+#include "graphics/maccursor.h"
+#include "graphics/macgui/macfontmanager.h"
+#include "graphics/macgui/macwindowmanager.h"
+#include "graphics/surface.h"
+
+#include "scumm/scumm.h"
+#include "scumm/detection.h"
+#include "scumm/macgui/macgui_impl.h"
+#include "scumm/macgui/macgui_mi1.h"
+#include "scumm/music.h"
+#include "scumm/sound.h"
+#include "scumm/verbs.h"
+
+namespace Scumm {
+
+// ===========================================================================
+// The Mac Monkey Island 1 GUI.
+// ===========================================================================
+
+MacMI1Gui::MacMI1Gui(ScummEngine *vm, const Common::Path &resourceFile) : MacGuiImpl(vm, resourceFile) {
+	readStrings();
+}
+
+MacMI1Gui::~MacMI1Gui() {
+}
+
+void MacMI1Gui::readStrings() {
+	Common::MacResManager resource;
+	resource.open(_resourceFile);
+	uint32 strsLen = resource.getResLength(MKTAG('S', 'T', 'R', 'S'), 0);
+
+	if (strsLen <= 0)
+		return;
+
+	Common::SeekableReadStream *strsStream = resource.getResource(MKTAG('S', 'T', 'R', 'S'), 0);
+	uint8 *strsBlock = (uint8 *)malloc(strsLen);
+	strsStream->read(strsBlock, strsLen);
+
+	uint8 *strsData = strsBlock;
+
+	// Most of these are debug strings. We parse the entire STRS block anyway,
+	// for any future need.
+
+	// Debug strings
+	for (int i = 0; i < 6; i++) {
+		_strsStrings.emplace_back(readCString(strsData));
+	}
+
+	_strsStrings.emplace_back(readPascalString(strsData));
+	_strsStrings.emplace_back(readPascalString(strsData));
+
+	_strsStrings.emplace_back(readCString(strsData));
+	_strsStrings.emplace_back(readCString(strsData));
+
+	// "\x14", "About Loom...<B;(-", "MacScumm", "MacScumm"
+	for (int i = 0; i < 4; i++) {
+		_strsStrings.emplace_back(readPascalString(strsData));
+	}
+
+	// "Are you sure you want to restart this game from the beginning?"
+	_strsStrings.emplace_back(readCString(strsData));
+
+	// "Are you sure you want to quit?"
+	_strsStrings.emplace_back(readCString(strsData));
+
+	// "Open Game File...", "Save Game File as..." "Game file"
+	for (int i = 0; i < 3; i++) {
+		_strsStrings.emplace_back(readPascalString(strsData));
+	}
+
+	// "This disk is full.  The game was not saved."
+	_strsStrings.emplace_back(readCString(strsData));
+
+	// "An error occured while saving.  The game was not saved.  Please try saving the game to another disk."
+	_strsStrings.emplace_back(readCString(strsData));
+
+	// "Select a color"
+	_strsStrings.emplace_back(readPascalString(strsData));
+
+	// Debug strings
+	for (int i = 0; i < 67; i++) {
+		_strsStrings.emplace_back(readCString(strsData));
+	}
+
+	// "About", "PRESENTS"
+	for (int i = 0; i < 2; i++) {
+		_strsStrings.emplace_back(readPascalString(strsData));
+	}
+
+	// "%s Interpreter version %c.%c.%c"
+	_strsStrings.emplace_back(readCString(strsData));
+
+	// All the other "About" dialog strings
+	for (int i = 0; i < 30; i++) {
+		_strsStrings.emplace_back(readPascalString(strsData));
+	}
+
+	// "ERROR #%d"
+	_strsStrings.emplace_back(readCString(strsData));
+
+	// Other debug strings...
+	for (int i = 0; i < 4; i++) {
+		_strsStrings.emplace_back(readPascalString(strsData));
+	}
+
+	for (int i = 0; i < 3; i++) {
+		_strsStrings.emplace_back(readCString(strsData));
+	}
+
+	_strsStrings.emplace_back(readPascalString(strsData));
+	_strsStrings.emplace_back(readPascalString(strsData));
+
+	// "Copyright (c) 1989 Lucasfilm Ltd. All Rights Reserved.", "rb, "wb", "wb"
+	for (int i = 0; i < 4; i++) {
+		_strsStrings.emplace_back(readCString(strsData));
+	}
+
+	// Other debug strings...
+	_strsStrings.emplace_back(readPascalString(strsData));
+
+	_strsStrings.emplace_back(readCString(strsData));
+
+	for (int i = 0; i < 5; i++) {
+		_strsStrings.emplace_back(readPascalString(strsData));
+	}
+
+	for (int i = 0; i < 7; i++) {
+		_strsStrings.emplace_back(readCString(strsData));
+	}
+
+	free(strsBlock);
+	delete strsStream;
+}
+
+const Graphics::Font *MacMI1Gui::getFontByScummId(int32 id) {
+	switch (id) {
+	case 0:
+		return getFont(kLoomFontLarge);
+
+	default:
+		error("MacMI1Gui::getFontByScummId: Invalid font id %d", id);
+	}
+}
+
+bool MacMI1Gui::getFontParams(FontId fontId, int &id, int &size, int &slant) const {
+	if (MacGuiImpl::getFontParams(fontId, id, size, slant))
+		return true;
+
+	// Loom uses only font size 13 for in-game text, but size 12 is used
+	// for system messages, e.g. the original pause dialog.
+	//
+	// Special characters:
+	//
+	// 16-23 are the note names c through c'.
+	// 60 is an upside-down note, i.e. the one used for c'.
+	// 95 is a used for the rest of the notes.
+
+	switch (fontId) {
+	case kLoomFontSmall:
+		id = _gameFontId;
+		size = 9;
+		slant = Graphics::kMacFontRegular;
+		return true;
+
+	case kLoomFontMedium:
+		id = _gameFontId;
+		size = 12;
+		slant = Graphics::kMacFontRegular;
+		return true;
+
+	case kLoomFontLarge:
+		id = _gameFontId;
+		size = 13;
+		slant = Graphics::kMacFontRegular;
+		return true;
+
+	default:
+		error("MacMI1Gui: getFontParams: Unknown font id %d", (int)fontId);
+	}
+
+	return false;
+}
+
+void MacMI1Gui::setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) {
+	_windowManager->replaceCursor(Graphics::MacGUIConstants::kMacCursorArrow);
+}
+
+bool MacMI1Gui::handleMenu(int id, Common::String &name) {
+	if (MacGuiImpl::handleMenu(id, name))
+		return true;
+
+	switch (id) {
+	case 204:	// Options
+		runOptionsDialog();
+		break;
+
+	case 205:	// Quit
+		if (runQuitDialog())
+			_vm->quitGame();
+		break;
+
+	default:
+		warning("Unknown menu command: %d", id);
+		break;
+	}
+
+	return false;
+}
+
+void MacMI1Gui::runAboutDialog() {
+	// The About window is not a a dialog resource. Its size appears to be
+	// hard-coded (416x166), and it's drawn centered. The graphics are in
+	// PICT 5000 and 5001.
+
+	int width = 416;
+	int height = 166;
+	int x = (640 - width) / 2;
+	int y = (400 - height) / 2;
+
+	Common::Rect bounds(x, y, x + width, y + height);
+	MacDialogWindow *window = createWindow(bounds);
+	Graphics::Surface *lucasFilm = loadPict(5000);
+	Graphics::Surface *loom = loadPict(5001);
+
+	const char *subVers = (const char *)_vm->getStringAddress(5);
+	Common::String version = Common::String::format(_strsStrings[91].c_str(), subVers, '5', '1', '6');
+
+	const TextLine page1[] = {
+		{ 0, 23, kStyleExtraBold, Graphics::kTextAlignCenter, _strsStrings[90].c_str() }, // "PRESENTS"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page2[] = {
+		{ 1, 59, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[92].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company.  All rights reserved."
+		{ 0, 70, kStyleRegular, Graphics::kTextAlignCenter, version.c_str() }, // "Release Version 1.2  25-JAN-91 Interpreter version 5.1.6"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page3[] = {
+		{ 1, 11, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[93].c_str() }, // "Macintosh version by"
+		{ 0, 25, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[95].c_str() }, // "Eric Johnston"
+		{ 0, 49, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[94].c_str() }, // "Macintosh scripting by"
+		{ 1, 63, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[96].c_str() }, // "Ron Baldwin"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page4[] = {
+		{ 0, 26, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[97].c_str() }, // "Original game created by"
+		{ 1, 40, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[98].c_str() }, // "Brian Moriarty"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page5[] = {
+		{ 1, 11, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[99].c_str() }, // "Produced by"
+		{ 0, 25, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[101].c_str() }, // "Gregory D. Hammond"
+		{ 0, 49, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[100].c_str() }, // "Macintosh Version Produced by"
+		{ 1, 63, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[102].c_str() }, // "David Fox"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page6[] = {
+		{ 1, 6, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[103].c_str() }, // "SCUMM Story System"
+		{ 1, 16, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[104].c_str() }, // "created by"
+		{ 97, 35, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[106].c_str() }, // "Ron Gilbert"
+		{ 1, 51, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[105].c_str() }, // "and"
+		{ 122, 65, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[107].c_str() }, // "Aric Wilmunder"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page7[] = {
+		{ 1, 16, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[108].c_str() }, // "Stumped?  Loom hint books are available!"
+		{ 76, 33, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[111].c_str() }, // "In the U.S. call"
+		{ 150, 34, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[109].c_str() }, // "1 (800) STAR-WARS"
+		{ 150, 43, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[113].c_str() }, // "that\xD5s  1 (800) 782-7927"
+		{ 80, 63, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[112].c_str() }, // "In Canada call"
+		{ 150, 64, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[110].c_str() }, // "1 (800) 828-7927"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page8[] = {
+		{ 1, 11, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[114].c_str() }, // "Need a hint NOW?  Having problems?"
+		{ 81, 25, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[117].c_str() }, // "For technical support call"
+		{ 205, 26, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[115].c_str() }, // "1 (415) 721-3333"
+		{ 137, 35, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[118].c_str() }, // "For hints call"
+
+		{ 205, 36, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[116].c_str() }, // "1 (900) 740-JEDI"
+		{ 1, 50, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[119].c_str() }, // "The charge for the hint line is 75\xA2 per minute."
+		{ 1, 60, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[120].c_str() }, // "(You must have your parents\xD5 permission to"
+		{ 1, 70, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[121].c_str() }, // "call this number if you are under 18.)"
+		TEXT_END_MARKER
+	};
+
+	struct AboutPage {
+		const TextLine *text;
+		int waitFrames;
+	};
+
+	AboutPage aboutPages[] = {
+		{ nullptr,  60 },	// ~3 seconds
+		{ page1,    40 },	// ~2 seconds
+		{ page2,   130 },	// ~6.5 seconds
+		{ page3,    80 },	// ~4 seconds
+		{ page4,    80 },
+		{ page5,    80 },
+		{ page6,    80 },
+		{ page7,   260 },	// ~13 seconds
+		{ page8,     0 }
+	};
+
+	int page = 0;
+
+	// I've based the animation speed on what it looks like when Mini vMac
+	// emulates an old black-and-white Mac at normal speed. It looks a bit
+	// different in Basilisk II, but that's probably because it emulates a
+	// much faster Mac.
+	//
+	// The animation is either either growing or shrinking, depending on
+	// if growth is positive or negative. During each scene, the animation
+	// may reach its smallest point, at which time it bounces back. When
+	// it reaches its outer limit, the scene ends.
+
+	window->show();
+
+	int scene = 0;
+	DelayStatus status = kDelayDone;
+
+	Common::Rect r(0, 0, 404, 154);
+	int growth = -2;
+	int pattern;
+	bool darkenOnly = false;
+	int waitFrames = 0;
+
+	int innerBounce = 72;
+	int targetTop = 48;
+	int targetGrowth = 2;
+
+	bool changeScene = false;
+	bool fastForward = false;
+
+	while (!_vm->shouldQuit()) {
+		if ((scene % 2) == 0) {
+			// This appears to be pixel perfect or at least nearly
+			// so for the outer layers, but breaks down slightly
+			// near the middle.
+			//
+			// Also, the original does an inexplicable skip in the
+			// first animation that I haven't bothered to
+			// implement. I don't know if it was intentional or
+			// not, but I think it looks awkward. And I wasn't able
+			// to get it quite right anyway.
+
+			pattern = (r.top / 2) % 8;
+
+			if (pattern > 4)
+				darkenOnly = false;
+
+			Graphics::drawRoundRect(r, 7, pattern, true, darkenOnly ? MacDialogWindow::plotPatternDarkenOnly : MacDialogWindow::plotPattern, window);
+
+			if (!fastForward)
+				window->markRectAsDirty(r);
+
+			if (r.top == targetTop && growth == targetGrowth) {
+				changeScene = true;
+			} else {
+				r.grow(growth);
+
+				if (growth < 0 && r.top >= innerBounce)
+					growth = -growth;
+			}
+		} else {
+			if (--waitFrames <= 0)
+				changeScene = true;
+		}
+
+		if (!fastForward) {
+			window->update();
+			status = delay(50);
+		}
+
+		if (status == kDelayInterrupted)
+			fastForward = true;
+
+		if (status == kDelayAborted)
+			break;
+
+		if (changeScene) {
+			changeScene = false;
+			scene++;
+
+			// Animations happen on even-numbered scenes. All
+			// animations start in an inwards direction.
+			//
+			// Odd-numbered scenes are the text pages where it
+			// waits for a bit before continuing. This is where
+			// fast-forwarding (by clicking) stops. Unlike Last
+			// Crusade, we can't just skip the animation because
+			// everything has to be drawn. (Well, some could
+			// probably be skipped, but I doubt it's worth the
+			// trouble to do so.)
+
+			if ((scene % 2) == 0)
+				growth = -2;
+			else {
+				fastForward = false;
+				darkenOnly = true;
+
+				if (aboutPages[page].text)
+					window->drawTexts(r, aboutPages[page].text);
+
+				waitFrames = aboutPages[page].waitFrames;
+				page++;
+			}
+
+			switch (scene) {
+			case 1:
+				window->drawSprite(lucasFilm, 134, 61);
+				break;
+
+			case 4:
+				// All subsequent text pages are larger, which
+				// we compensate by making the inner bounce
+				// happen earlier.
+
+				innerBounce -= 8;
+				targetTop -= 16;
+				break;
+
+			case 5:
+				window->drawSprite(loom, 95, 38);
+				break;
+			}
+
+			window->update(true);
+
+			if (scene >= 17)
+				break;
+		}
+	}
+
+	if (status != kDelayAborted)
+		delay();
+
+	_windowManager->popCursor();
+
+	lucasFilm->free();
+	loom->free();
+
+	delete lucasFilm;
+	delete loom;
+	delete window;
+}
+
+// A standard file picker dialog doesn't really make sense in ScummVM, so we
+// make something that just looks similar to one.
+
+bool MacMI1Gui::runOpenDialog(int &saveSlotToHandle) {
+	Common::Rect bounds(88, 28, 448, 210);
+
+	MacDialogWindow *window = createWindow(bounds);
+
+	window->addButton(Common::Rect(254, 137, 334, 157), "Open", true);
+	window->addButton(Common::Rect(254, 106, 334, 126), "Cancel", true);
+	window->addButton(Common::Rect(254, 62, 334, 82), "Desktop", false);
+	window->addButton(Common::Rect(254, 34, 334, 54), "Eject", false);
+
+	window->drawDottedHLine(253, 93, 334);
+
+	bool availSlots[100];
+	int slotIds[100];
+	Common::StringArray savegameNames;
+	prepareSaveLoad(savegameNames, availSlots, slotIds, ARRAYSIZE(availSlots));
+
+	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, "Loom", Graphics::kTextAlignLeft);
+	drawFakeDriveLabel(window, Common::Rect(242, 10, 340, 28), _hardDriveIcon, "ScummVM", Graphics::kTextAlignLeft);
+
+	window->addListBox(Common::Rect(14, 31, 232, 161), savegameNames, true);
+
+	window->setDefaultWidget(0);
+
+	// When quitting, the default action is to not open a saved game
+	bool ret = false;
+	Common::Array<int> deferredActionsIds;
+
+	while (!_vm->shouldQuit()) {
+		int clicked = window->runDialog(deferredActionsIds);
+
+		if (clicked == 0 || clicked == 3) {
+			saveSlotToHandle =
+				window->getWidgetValue(3) < ARRAYSIZE(slotIds) ?
+				slotIds[window->getWidgetValue(3)] : -1;
+			ret = true;
+			break;
+		}
+
+		if (clicked == 1)
+			break;
+	}
+
+	delete window;
+	return ret;
+}
+
+bool MacMI1Gui::runSaveDialog(int &saveSlotToHandle, Common::String &name) {
+	Common::Rect bounds(110, 27, 470, 231);
+
+	MacDialogWindow *window = createWindow(bounds);
+
+	window->addButton(Common::Rect(254, 163, 334, 183), "Save", true);
+	window->addButton(Common::Rect(254, 132, 334, 152), "Cancel", true);
+	window->addButton(Common::Rect(254, 90, 334, 110), "New", false);
+	window->addButton(Common::Rect(254, 62, 334, 82), "Desktop", false);
+	window->addButton(Common::Rect(254, 34, 334, 54), "Eject", false);
+
+	bool busySlots[100];
+	int slotIds[100];
+	Common::StringArray savegameNames;
+	prepareSaveLoad(savegameNames, busySlots, slotIds, ARRAYSIZE(busySlots));
+
+	Common::String saveGameFileAsResStr = _strsStrings[17].c_str();
+	Common::String gameFileResStr = _strsStrings[18].c_str();
+
+	int firstAvailableSlot = -1;
+	for (int i = 1; i < ARRAYSIZE(busySlots); i++) { // Skip the autosave slot
+		if (!busySlots[i]) {
+			firstAvailableSlot = i;
+			break;
+		}
+	}
+
+	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, "Loom", Graphics::kTextAlignLeft);
+	drawFakeDriveLabel(window, Common::Rect(242, 10, 340, 28), _hardDriveIcon, "ScummVM", Graphics::kTextAlignLeft);
+
+	window->addListBox(Common::Rect(14, 31, 232, 129), savegameNames, true, true);
+
+	MacGuiImpl::MacEditText *editText = window->addEditText(Common::Rect(16, 159, 229, 175), gameFileResStr, true);
+
+	Graphics::Surface *s = window->innerSurface();
+	const Graphics::Font *font = getFont(kSystemFont);
+
+	s->frameRect(Common::Rect(14, 156, 232, 178), kBlack);
+
+	window->drawDottedHLine(253, 121, 334);
+
+	font->drawString(s, saveGameFileAsResStr, 14, 138, 218, kBlack, Graphics::kTextAlignLeft, 4);
+
+	window->setDefaultWidget(0);
+	editText->selectAll();
+
+	// When quitting, the default action is to not open a saved game
+	bool ret = false;
+	Common::Array<int> deferredActionsIds;
+
+	while (!_vm->shouldQuit()) {
+		int clicked = window->runDialog(deferredActionsIds);
+
+		if (clicked == 0) {
+			ret = true;
+			name = editText->getText();
+			saveSlotToHandle = firstAvailableSlot;
+			break;
+		}
+
+		if (clicked == 1)
+			break;
+
+		if (clicked == -2) {
+			// Cycle through deferred actions
+			for (uint i = 0; i < deferredActionsIds.size(); i++) {
+				// Edit text widget
+				if (deferredActionsIds[i] == 4) {
+					MacGuiImpl::MacWidget *wid = window->getWidget(deferredActionsIds[i]);
+
+					// Disable "Save" button when text is empty
+					window->getWidget(0)->setEnabled(!wid->getText().empty());
+				}
+			}
+		}
+	}
+
+	delete window;
+	return ret;
+}
+
+bool MacMI1Gui::runOptionsDialog() {
+	// Widgets:
+	//
+	// 0 - Okay button
+	// 1 - Cancel button
+	// 2 - Sound checkbox
+	// 3 - Music checkbox
+	// 4 - Picture (text speed background)
+	// 5 - Picture (text speed handle)
+	// 6 - Scrolling checkbox
+	// 7 - Full Animation checkbox
+	// 8 - Picture (music quality background)
+	// 9 - Picture (music quality handle)
+	// 10 - "Machine Speed:  ^0" text
+	// 11 - Text speed slider (manually created)
+	// 12 - Music quality slider (manually created)
+
+	int sound = 1;
+	int music = 1;
+	if (_vm->VAR(167) == 2) {
+		sound = music = 0;
+	} else if (_vm->VAR(167) == 1) {
+		music = 0;
+	}
+
+	int scrolling = _vm->_snapScroll == 0;
+	int fullAnimation = _vm->VAR(_vm->VAR_MACHINE_SPEED) == 1 ? 0 : 1;
+	int textSpeed = _vm->_defaultTextSpeed;
+	int musicQuality = ConfMan.hasKey("mac_snd_quality") ? ConfMan.getInt("mac_snd_quality") : 0;
+	int musicQualityOption = (musicQuality == 0) ? 1 : (musicQuality - 1) % 3;
+	musicQuality = (musicQuality == 0) ? (_vm->VAR(_vm->VAR_SOUNDCARD) == 10 ? 0 : 2) : (musicQuality - 1) / 3;
+
+	MacDialogWindow *window = createDialog(1000);
+
+	window->setWidgetValue(2, sound);
+	window->setWidgetValue(3, music);
+	window->setWidgetValue(6, scrolling);
+	window->setWidgetValue(7, fullAnimation);
+
+	if (!sound)
+		window->setWidgetEnabled(3, false);
+
+	window->addPictureSlider(4, 5, true, 5, 105, 0, 9);
+	window->setWidgetValue(11, textSpeed);
+
+	window->addPictureSlider(8, 9, true, 5, 69, 0, 2, 6, 4);
+	window->setWidgetValue(12, musicQualityOption);
+
+	// Machine rating
+	window->addSubstitution(Common::String::format("%d", _vm->VAR(53)));
+
+	// When quitting, the default action is not to not apply options
+	bool ret = false;
+	Common::Array<int> deferredActionsIds;
+
+	while (!_vm->shouldQuit()) {
+		int clicked = window->runDialog(deferredActionsIds);
+
+		if (clicked == 0) {
+			ret = true;
+			break;
+		}
+
+		if (clicked == 1)
+			break;
+
+		if (clicked == 2)
+			window->setWidgetEnabled(3, window->getWidgetValue(2) != 0);
+	}
+
+	if (ret) {
+		// Update settings
+
+		// TEXT SPEED
+		_vm->_defaultTextSpeed = CLIP<int>(window->getWidgetValue(11), 0, 9);
+		ConfMan.setInt("original_gui_text_speed", _vm->_defaultTextSpeed);
+		_vm->setTalkSpeed(_vm->_defaultTextSpeed);
+
+		// SOUND&MUSIC ACTIVATION
+		// 0 - Sound&Music on
+		// 1 - Sound on, music off
+		// 2 - Sound&Music off
+		int musicVariableValue = 0;
+
+		if (window->getWidgetValue(2) == 0) {
+			musicVariableValue = 2;
+		} else if (window->getWidgetValue(2) == 1 && window->getWidgetValue(3) == 0) {
+			musicVariableValue = 1;
+		}
+
+		_vm->VAR(167) = musicVariableValue;
+
+		if (musicVariableValue != 0) {
+			if (_vm->VAR(169) != 0) {
+				_vm->_sound->stopSound(_vm->VAR(169));
+				_vm->VAR(169) = 0;
+			}
+		}
+
+		// SCROLLING ACTIVATION
+		_vm->_snapScroll = window->getWidgetValue(6) == 0;
+
+		if (_vm->VAR_CAMERA_FAST_X != 0xFF)
+			_vm->VAR(_vm->VAR_CAMERA_FAST_X) = _vm->_snapScroll;
+
+		// FULL ANIMATION ACTIVATION
+		_vm->VAR(_vm->VAR_MACHINE_SPEED) = window->getWidgetValue(7) == 1 ? 0 : 1;
+
+		// MUSIC QUALITY SELECTOR
+		musicQuality = musicQuality * 3 + 1 + window->getWidgetValue(12);
+		_vm->_musicEngine->setQuality(musicQuality);
+		ConfMan.setInt("mac_snd_quality", musicQuality);
+
+		_vm->syncSoundSettings();
+		ConfMan.flushToDisk();
+	}
+
+	delete window;
+	return ret;
+}
+
+void MacMI1Gui::resetAfterLoad() {
+	reset();
+}
+
+bool MacMI1Gui::handleEvent(Common::Event event) {
+	if (MacGuiImpl::handleEvent(event))
+		return true;
+
+	if (_vm->isPaused())
+		return false;
+
+	if (_vm->_userPut <= 0)
+		return false;
+
+	return false;
+}
+
+} // End of namespace Scumm
diff --git a/engines/scumm/macgui/macgui_mi1.h b/engines/scumm/macgui/macgui_mi1.h
new file mode 100644
index 00000000000..54cc83ba1b5
--- /dev/null
+++ b/engines/scumm/macgui/macgui_mi1.h
@@ -0,0 +1,63 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef SCUMM_MACGUI_MACGUI_MI1_H
+#define SCUMM_MACGUI_MACGUI_MI1_H
+
+#include "common/events.h"
+#include "common/rect.h"
+#include "common/str.h"
+
+namespace Scumm {
+
+class MacGuiImpl;
+
+class MacMI1Gui : public MacGuiImpl {
+public:
+	MacMI1Gui(ScummEngine *vm, const Common::Path &resourceFile);
+	~MacMI1Gui();
+
+	const Common::String name() const { return "game"; }
+
+	bool handleEvent(Common::Event event);
+
+	const Graphics::Font *getFontByScummId(int32 id);
+
+	void setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate);
+
+	void resetAfterLoad();
+	void update(int delta) {}
+
+protected:
+	bool getFontParams(FontId fontId, int &id, int &size, int &slant) const;
+
+	bool handleMenu(int id, Common::String &name);
+
+	void runAboutDialog();
+	bool runOpenDialog(int &saveSlotToHandle);
+	bool runSaveDialog(int &saveSlotToHandle, Common::String &name);
+	bool runOptionsDialog();
+
+	void readStrings() override;
+};
+
+} // End of namespace Scumm
+#endif
diff --git a/engines/scumm/module.mk b/engines/scumm/module.mk
index d5955da6515..3d3682c6820 100644
--- a/engines/scumm/module.mk
+++ b/engines/scumm/module.mk
@@ -44,6 +44,7 @@ MODULE_OBJS := \
 	macgui/macgui_impl.o \
 	macgui/macgui_indy3.o \
 	macgui/macgui_loom.o \
+	macgui/macgui_mi1.o \
 	macgui/macgui_widgets.o \
 	metaengine.o \
 	midiparser_ro.o \
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index ce445eb570d..90c04c197ee 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -853,7 +853,7 @@ void ScummEngine_v5::o5_cursorCommand() {
 		verbMouseOver(0);
 		break;
 	case 2:			// SO_CURSOR_OFF
-		_cursor.state = 0;
+		_cursor.state = (_game.id == GID_MONKEY && _game.platform == Common::kPlatformMacintosh) ? 1 : 0;
 		verbMouseOver(0);
 		break;
 	case 3:			// SO_USERPUT_ON
@@ -868,6 +868,8 @@ void ScummEngine_v5::o5_cursorCommand() {
 		break;
 	case 6:			// SO_CURSOR_SOFT_OFF
 		_cursor.state--;
+		if (_game.id == GID_MONKEY && _game.platform == Common::kPlatformMacintosh && _cursor.state == 0)
+			_cursor.state = 1;
 		verbMouseOver(0);
 		break;
 	case 7:			// SO_USERPUT_SOFT_ON
@@ -2250,7 +2252,7 @@ void ScummEngine_v5::o5_roomOps() {
 		}
 
 		// Mac version, draw the screens 20 pixels lower to account for the extra 40 pixels
-		if (_game.platform == Common::kPlatformMacintosh && _game.version == 3 && _useMacScreenCorrectHeight) {
+		if (_game.platform == Common::kPlatformMacintosh && _game.version >= 3 && _useMacScreenCorrectHeight) {
 			a += _screenDrawOffset;
 			b += _screenDrawOffset;
 		}
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 3ddeeb1ada8..e25f0e7d06f 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -376,7 +376,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 	} else if (_game.platform == Common::kPlatformNES) {
 		_screenWidth = 256;
 		_screenHeight = 240;
-	} else if (!isSteamVersion && _useMacScreenCorrectHeight && _game.platform == Common::kPlatformMacintosh && _game.version == 3) {
+	} else if (!isSteamVersion && _useMacScreenCorrectHeight && _game.platform == Common::kPlatformMacintosh && _game.version >= 3) {
 		_screenWidth = 320;
 		_screenHeight = 240;
 		_screenDrawOffset = 20;
@@ -1250,6 +1250,11 @@ Common::Error ScummEngine::init() {
 			for (int i = 0; i < ARRAYSIZE(monkeyIslandFileNames); i++) {
 				if (resource.exists(monkeyIslandFileNames[i])) {
 					macResourceFile = monkeyIslandFileNames[i];
+
+					_macScreen = new Graphics::Surface();
+					_macScreen->create(640, _useMacScreenCorrectHeight ? 480 : 400, Graphics::PixelFormat::createFormatCLUT8());
+					_macGui = new MacGui(this, macResourceFile);
+					break;
 				}
 			}
 
@@ -1287,6 +1292,11 @@ Common::Error ScummEngine::init() {
 		int screenWidth = _screenWidth * _textSurfaceMultiplier;
 		int screenHeight = _screenHeight * _textSurfaceMultiplier;
 
+		if (_macScreen && _game.platform == Common::kPlatformMacintosh && _game.version > 3) {
+			screenWidth *= 2;
+			screenHeight *= 2;
+		}
+
 		if (_game.features & GF_16BIT_COLOR
 #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
 			|| _game.platform == Common::kPlatformFMTowns
@@ -1890,7 +1900,7 @@ void ScummEngine::resetScumm() {
 	_nextTop = 0;
 
 	_currentCursor = 0;
-	_cursor.state = 0;
+	_cursor.state = (_game.id == GID_MONKEY && _game.platform == Common::kPlatformMacintosh) ? 1 : 0;
 	_userPut = 0;
 
 	_newEffect = 129;
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 3725d6ed1c9..827146fac61 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -524,6 +524,7 @@ class ScummEngine : public Engine, public Common::Serializable {
 	friend class MacGuiImpl;
 	friend class MacIndy3Gui;
 	friend class MacLoomGui;
+	friend class MacMI1Gui;
 	friend class LogicHEBasketball;
 
 public:
@@ -1616,6 +1617,8 @@ public:
 
 	Graphics::Surface *_macScreen = nullptr;
 	MacGui *_macGui = nullptr;
+	bool _useMacGraphicsSmoothing = true;
+	byte _completeScreenBuffer[320 * 240];
 
 protected:
 	byte _charsetColor = 0;
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index 7ad72adb897..9b3cf7edfc0 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -971,7 +971,7 @@ void ScummEngine::displayDialog() {
 		int s;
 
 		_string[0].xpos = a->getPos().x - _virtscr[kMainVirtScreen].xstart;
-		_string[0].ypos = a->getPos().y - a->getElevation() - _screenTop - _screenDrawOffset;
+		_string[0].ypos = a->getPos().y - a->getElevation() - _screenTop;
 
 		if (_game.version <= 5) {
 			if (VAR(VAR_V5_TALK_STRING_Y) < 0) {
@@ -1236,6 +1236,11 @@ void ScummEngine::drawString(int a, const byte *msg) {
 	VirtScreen *vs = findVirtScreen(_charset->_top);
 	bool shadowModeFlag = (vs && vs->number == kMainVirtScreen);
 
+	if (_game.version > 3 && _game.platform == Common::kPlatformMacintosh) {
+		if (vs && vs->number == kVerbVirtScreen)
+			_charset->_top -= _screenDrawOffset;
+	}
+
 	if (_game.version >= 5)
 		memcpy(_charsetColorMap, _charsetData[_charset->getCurID()], _game.id == GID_DIG ? sizeof(_charsetColorMap) : 4);
 


Commit: 1e8aea717d1d9fdf5220eb52a60f4abf748d3fb3
    https://github.com/scummvm/scummvm/commit/1e8aea717d1d9fdf5220eb52a60f4abf748d3fb3
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MI1 (Mac): Bring Mac menu to a non-crashing state

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/macgui/macgui_mi1.cpp
    engines/scumm/palette.cpp


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index b0e4887fc39..80228dfc6fb 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -73,6 +73,7 @@ Common::String MacGuiImpl::readCString(uint8 *&data) {
 		data++;
 	}
 
+	debug(8, "MacGuiImpl::readCString(): %s", result.c_str());
 	return result;
 }
 
@@ -84,6 +85,7 @@ Common::String MacGuiImpl::readPascalString(uint8 *&data) {
 		data++;
 	}
 
+	debug(8, "MacGuiImpl::readPascalString(): %s", result.c_str());
 	return result;
 }
 
@@ -206,6 +208,9 @@ void MacGuiImpl::initialize() {
 		case GID_LOOM:
 			aboutMenuDef = _strsStrings[11].c_str();
 			break;
+		case GID_MONKEY:
+			aboutMenuDef = _strsStrings[94].c_str();
+			break;
 		default:
 			aboutMenuDef = "About " + name() + "...<B;(-";
 		}
@@ -335,8 +340,12 @@ bool MacGuiImpl::handleMenu(int id, Common::String &name) {
 		return true;
 
 	case 203:	// Pause
-		if (!_vm->_messageBannerActive)
-			_vm->mac_showOldStyleBannerAndPause(_vm->getGUIString(gsPause), -1);
+		if (!_vm->_messageBannerActive) {
+			if (_vm->_game.version == 3)
+				_vm->mac_showOldStyleBannerAndPause(_vm->getGUIString(gsPause), -1);
+			else
+				_vm->showBannerAndPause(0, -1, _vm->getGUIString(gsPause));
+		}
 		return true;
 
 	// In the original, the Edit menu is active during save dialogs, though
@@ -376,7 +385,7 @@ void MacGuiImpl::updateWindowManager() {
 		// or disable saving and loading during normal gameplay.
 		saveCondition = (_vm->VAR(58) & 0x01) && !(_vm->VAR(94) & 0x10);
 		loadCondition = (_vm->VAR(58) & 0x02) && !(_vm->VAR(94) & 0x10);
-	} else {
+	} else if (_vm->_game.id == GID_LOOM) {
 		// TODO: Complete LOOM with the rest of the proper code from disasm,
 		// for now we only have the copy protection code and a best guess in place...
 		//
@@ -389,6 +398,9 @@ void MacGuiImpl::updateWindowManager() {
 			!(_vm->VAR(221) & 0x4000) &&
 			(_vm->VAR(_vm->VAR_VERB_SCRIPT) == 5) &&
 			(_vm->_userPut > 0);
+	} else {
+		saveCondition = true;
+		loadCondition = true;
 	}
 
 	bool canLoad = _vm->canLoadGameStateCurrently() && loadCondition;
@@ -609,6 +621,10 @@ MacGuiImpl::MacDialogWindow *MacGuiImpl::createDialog(int dialogId) {
 		saveGameFileAsResStr = _strsStrings[17].c_str();
 		gameFileResStr = _strsStrings[18].c_str();
 		break;
+	case GID_MONKEY:
+		saveGameFileAsResStr = _strsStrings[103].c_str();
+		gameFileResStr = _strsStrings[104].c_str();
+		break;
 	default:
 		saveGameFileAsResStr = "Save Game File as...";
 		gameFileResStr = "Game file";
@@ -857,6 +873,9 @@ bool MacGuiImpl::runQuitDialog() {
 	case GID_LOOM:
 		quitString = _strsStrings[15].c_str();
 		break;
+	case GID_MONKEY:
+		quitString = _strsStrings[96].c_str();
+		break;
 	default:
 		quitString = "Are you sure you want to quit?";
 	}
@@ -871,6 +890,9 @@ bool MacGuiImpl::runRestartDialog() {
 	case GID_LOOM:
 		restartString = _strsStrings[14].c_str();
 		break;
+	case GID_MONKEY:
+		restartString = _strsStrings[97].c_str();
+		break;
 	default:
 		restartString = "Are you sure you want to restart this game from the beginning?";
 	}
diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index 611e7e6d4d7..a348a3384ea 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -69,25 +69,28 @@ void MacMI1Gui::readStrings() {
 	// for any future need.
 
 	// Debug strings
-	for (int i = 0; i < 6; i++) {
+	for (int i = 0; i < 93; i++) {
 		_strsStrings.emplace_back(readCString(strsData));
 	}
 
-	_strsStrings.emplace_back(readPascalString(strsData));
-	_strsStrings.emplace_back(readPascalString(strsData));
-
-	_strsStrings.emplace_back(readCString(strsData));
-	_strsStrings.emplace_back(readCString(strsData));
+	// "\x14", "About Monkey Island...<B;(-"
+	for (int i = 0; i < 2; i++) {
+		_strsStrings.emplace_back(readPascalString(strsData));
+	}
 
-	// "\x14", "About Loom...<B;(-", "MacScumm", "MacScumm"
+	// "Are you sure you want to quit?", "Are you sure you want to quit?",
+	// "Are you sure you want to restart this game from the beginning?",
+	// "Are you sure you want to quit?"
 	for (int i = 0; i < 4; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
+		_strsStrings.emplace_back(readCString(strsData));
 	}
 
-	// "Are you sure you want to restart this game from the beginning?"
-	_strsStrings.emplace_back(readCString(strsData));
+	// "macPixHead is NULL", "Monkey Island"
+	for (int i = 0; i < 2; i++) {
+		_strsStrings.emplace_back(readPascalString(strsData));
+	}
 
-	// "Are you sure you want to quit?"
+	// "CopyBits error:"
 	_strsStrings.emplace_back(readCString(strsData));
 
 	// "Open Game File...", "Save Game File as..." "Game file"
@@ -101,57 +104,25 @@ void MacMI1Gui::readStrings() {
 	// "An error occured while saving.  The game was not saved.  Please try saving the game to another disk."
 	_strsStrings.emplace_back(readCString(strsData));
 
-	// "Select a color"
-	_strsStrings.emplace_back(readPascalString(strsData));
+	// "At this size, you will not be able to fit the whole game on your screen."
+	_strsStrings.emplace_back(readCString(strsData));
 
 	// Debug strings
-	for (int i = 0; i < 67; i++) {
+	for (int i = 0; i < 3; i++) {
 		_strsStrings.emplace_back(readCString(strsData));
 	}
 
-	// "About", "PRESENTS"
 	for (int i = 0; i < 2; i++) {
 		_strsStrings.emplace_back(readPascalString(strsData));
 	}
 
-	// "%s Interpreter version %c.%c.%c"
-	_strsStrings.emplace_back(readCString(strsData));
-
-	// All the other "About" dialog strings
-	for (int i = 0; i < 30; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
-
-	// "ERROR #%d"
-	_strsStrings.emplace_back(readCString(strsData));
-
-	// Other debug strings...
-	for (int i = 0; i < 4; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
-
-	for (int i = 0; i < 3; i++) {
-		_strsStrings.emplace_back(readCString(strsData));
-	}
-
-	_strsStrings.emplace_back(readPascalString(strsData));
-	_strsStrings.emplace_back(readPascalString(strsData));
-
-	// "Copyright (c) 1989 Lucasfilm Ltd. All Rights Reserved.", "rb, "wb", "wb"
-	for (int i = 0; i < 4; i++) {
-		_strsStrings.emplace_back(readCString(strsData));
-	}
-
-	// Other debug strings...
-	_strsStrings.emplace_back(readPascalString(strsData));
-
-	_strsStrings.emplace_back(readCString(strsData));
-
-	for (int i = 0; i < 5; i++) {
+	// All the "About" dialog strings
+	for (int i = 0; i < 32; i++) {
 		_strsStrings.emplace_back(readPascalString(strsData));
 	}
 
-	for (int i = 0; i < 7; i++) {
+	// Remaining debug strings
+	for (int i = 0; i < 75; i++) {
 		_strsStrings.emplace_back(readCString(strsData));
 	}
 
@@ -170,42 +141,7 @@ const Graphics::Font *MacMI1Gui::getFontByScummId(int32 id) {
 }
 
 bool MacMI1Gui::getFontParams(FontId fontId, int &id, int &size, int &slant) const {
-	if (MacGuiImpl::getFontParams(fontId, id, size, slant))
-		return true;
-
-	// Loom uses only font size 13 for in-game text, but size 12 is used
-	// for system messages, e.g. the original pause dialog.
-	//
-	// Special characters:
-	//
-	// 16-23 are the note names c through c'.
-	// 60 is an upside-down note, i.e. the one used for c'.
-	// 95 is a used for the rest of the notes.
-
-	switch (fontId) {
-	case kLoomFontSmall:
-		id = _gameFontId;
-		size = 9;
-		slant = Graphics::kMacFontRegular;
-		return true;
-
-	case kLoomFontMedium:
-		id = _gameFontId;
-		size = 12;
-		slant = Graphics::kMacFontRegular;
-		return true;
-
-	case kLoomFontLarge:
-		id = _gameFontId;
-		size = 13;
-		slant = Graphics::kMacFontRegular;
-		return true;
-
-	default:
-		error("MacMI1Gui: getFontParams: Unknown font id %d", (int)fontId);
-	}
-
-	return false;
+	return MacGuiImpl::getFontParams(fontId, id, size, slant);
 }
 
 void MacMI1Gui::setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) {
@@ -217,11 +153,14 @@ bool MacMI1Gui::handleMenu(int id, Common::String &name) {
 		return true;
 
 	switch (id) {
-	case 204:	// Options
+	case 204:   // Fix color map
+		break; // Do a no-op
+
+	case 205:   // Options
 		runOptionsDialog();
 		break;
 
-	case 205:	// Quit
+	case 206:   // Quit
 		if (runQuitDialog())
 			_vm->quitGame();
 		break;
@@ -235,246 +174,7 @@ bool MacMI1Gui::handleMenu(int id, Common::String &name) {
 }
 
 void MacMI1Gui::runAboutDialog() {
-	// The About window is not a a dialog resource. Its size appears to be
-	// hard-coded (416x166), and it's drawn centered. The graphics are in
-	// PICT 5000 and 5001.
-
-	int width = 416;
-	int height = 166;
-	int x = (640 - width) / 2;
-	int y = (400 - height) / 2;
-
-	Common::Rect bounds(x, y, x + width, y + height);
-	MacDialogWindow *window = createWindow(bounds);
-	Graphics::Surface *lucasFilm = loadPict(5000);
-	Graphics::Surface *loom = loadPict(5001);
-
-	const char *subVers = (const char *)_vm->getStringAddress(5);
-	Common::String version = Common::String::format(_strsStrings[91].c_str(), subVers, '5', '1', '6');
-
-	const TextLine page1[] = {
-		{ 0, 23, kStyleExtraBold, Graphics::kTextAlignCenter, _strsStrings[90].c_str() }, // "PRESENTS"
-		TEXT_END_MARKER
-	};
-
-	const TextLine page2[] = {
-		{ 1, 59, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[92].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company.  All rights reserved."
-		{ 0, 70, kStyleRegular, Graphics::kTextAlignCenter, version.c_str() }, // "Release Version 1.2  25-JAN-91 Interpreter version 5.1.6"
-		TEXT_END_MARKER
-	};
-
-	const TextLine page3[] = {
-		{ 1, 11, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[93].c_str() }, // "Macintosh version by"
-		{ 0, 25, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[95].c_str() }, // "Eric Johnston"
-		{ 0, 49, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[94].c_str() }, // "Macintosh scripting by"
-		{ 1, 63, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[96].c_str() }, // "Ron Baldwin"
-		TEXT_END_MARKER
-	};
-
-	const TextLine page4[] = {
-		{ 0, 26, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[97].c_str() }, // "Original game created by"
-		{ 1, 40, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[98].c_str() }, // "Brian Moriarty"
-		TEXT_END_MARKER
-	};
-
-	const TextLine page5[] = {
-		{ 1, 11, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[99].c_str() }, // "Produced by"
-		{ 0, 25, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[101].c_str() }, // "Gregory D. Hammond"
-		{ 0, 49, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[100].c_str() }, // "Macintosh Version Produced by"
-		{ 1, 63, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[102].c_str() }, // "David Fox"
-		TEXT_END_MARKER
-	};
-
-	const TextLine page6[] = {
-		{ 1, 6, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[103].c_str() }, // "SCUMM Story System"
-		{ 1, 16, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[104].c_str() }, // "created by"
-		{ 97, 35, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[106].c_str() }, // "Ron Gilbert"
-		{ 1, 51, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[105].c_str() }, // "and"
-		{ 122, 65, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[107].c_str() }, // "Aric Wilmunder"
-		TEXT_END_MARKER
-	};
-
-	const TextLine page7[] = {
-		{ 1, 16, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[108].c_str() }, // "Stumped?  Loom hint books are available!"
-		{ 76, 33, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[111].c_str() }, // "In the U.S. call"
-		{ 150, 34, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[109].c_str() }, // "1 (800) STAR-WARS"
-		{ 150, 43, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[113].c_str() }, // "that\xD5s  1 (800) 782-7927"
-		{ 80, 63, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[112].c_str() }, // "In Canada call"
-		{ 150, 64, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[110].c_str() }, // "1 (800) 828-7927"
-		TEXT_END_MARKER
-	};
-
-	const TextLine page8[] = {
-		{ 1, 11, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[114].c_str() }, // "Need a hint NOW?  Having problems?"
-		{ 81, 25, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[117].c_str() }, // "For technical support call"
-		{ 205, 26, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[115].c_str() }, // "1 (415) 721-3333"
-		{ 137, 35, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[118].c_str() }, // "For hints call"
-
-		{ 205, 36, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[116].c_str() }, // "1 (900) 740-JEDI"
-		{ 1, 50, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[119].c_str() }, // "The charge for the hint line is 75\xA2 per minute."
-		{ 1, 60, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[120].c_str() }, // "(You must have your parents\xD5 permission to"
-		{ 1, 70, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[121].c_str() }, // "call this number if you are under 18.)"
-		TEXT_END_MARKER
-	};
-
-	struct AboutPage {
-		const TextLine *text;
-		int waitFrames;
-	};
-
-	AboutPage aboutPages[] = {
-		{ nullptr,  60 },	// ~3 seconds
-		{ page1,    40 },	// ~2 seconds
-		{ page2,   130 },	// ~6.5 seconds
-		{ page3,    80 },	// ~4 seconds
-		{ page4,    80 },
-		{ page5,    80 },
-		{ page6,    80 },
-		{ page7,   260 },	// ~13 seconds
-		{ page8,     0 }
-	};
-
-	int page = 0;
-
-	// I've based the animation speed on what it looks like when Mini vMac
-	// emulates an old black-and-white Mac at normal speed. It looks a bit
-	// different in Basilisk II, but that's probably because it emulates a
-	// much faster Mac.
-	//
-	// The animation is either either growing or shrinking, depending on
-	// if growth is positive or negative. During each scene, the animation
-	// may reach its smallest point, at which time it bounces back. When
-	// it reaches its outer limit, the scene ends.
-
-	window->show();
-
-	int scene = 0;
-	DelayStatus status = kDelayDone;
-
-	Common::Rect r(0, 0, 404, 154);
-	int growth = -2;
-	int pattern;
-	bool darkenOnly = false;
-	int waitFrames = 0;
-
-	int innerBounce = 72;
-	int targetTop = 48;
-	int targetGrowth = 2;
-
-	bool changeScene = false;
-	bool fastForward = false;
-
-	while (!_vm->shouldQuit()) {
-		if ((scene % 2) == 0) {
-			// This appears to be pixel perfect or at least nearly
-			// so for the outer layers, but breaks down slightly
-			// near the middle.
-			//
-			// Also, the original does an inexplicable skip in the
-			// first animation that I haven't bothered to
-			// implement. I don't know if it was intentional or
-			// not, but I think it looks awkward. And I wasn't able
-			// to get it quite right anyway.
-
-			pattern = (r.top / 2) % 8;
-
-			if (pattern > 4)
-				darkenOnly = false;
-
-			Graphics::drawRoundRect(r, 7, pattern, true, darkenOnly ? MacDialogWindow::plotPatternDarkenOnly : MacDialogWindow::plotPattern, window);
-
-			if (!fastForward)
-				window->markRectAsDirty(r);
-
-			if (r.top == targetTop && growth == targetGrowth) {
-				changeScene = true;
-			} else {
-				r.grow(growth);
-
-				if (growth < 0 && r.top >= innerBounce)
-					growth = -growth;
-			}
-		} else {
-			if (--waitFrames <= 0)
-				changeScene = true;
-		}
-
-		if (!fastForward) {
-			window->update();
-			status = delay(50);
-		}
-
-		if (status == kDelayInterrupted)
-			fastForward = true;
-
-		if (status == kDelayAborted)
-			break;
-
-		if (changeScene) {
-			changeScene = false;
-			scene++;
-
-			// Animations happen on even-numbered scenes. All
-			// animations start in an inwards direction.
-			//
-			// Odd-numbered scenes are the text pages where it
-			// waits for a bit before continuing. This is where
-			// fast-forwarding (by clicking) stops. Unlike Last
-			// Crusade, we can't just skip the animation because
-			// everything has to be drawn. (Well, some could
-			// probably be skipped, but I doubt it's worth the
-			// trouble to do so.)
-
-			if ((scene % 2) == 0)
-				growth = -2;
-			else {
-				fastForward = false;
-				darkenOnly = true;
-
-				if (aboutPages[page].text)
-					window->drawTexts(r, aboutPages[page].text);
-
-				waitFrames = aboutPages[page].waitFrames;
-				page++;
-			}
-
-			switch (scene) {
-			case 1:
-				window->drawSprite(lucasFilm, 134, 61);
-				break;
-
-			case 4:
-				// All subsequent text pages are larger, which
-				// we compensate by making the inner bounce
-				// happen earlier.
-
-				innerBounce -= 8;
-				targetTop -= 16;
-				break;
-
-			case 5:
-				window->drawSprite(loom, 95, 38);
-				break;
-			}
-
-			window->update(true);
-
-			if (scene >= 17)
-				break;
-		}
-	}
-
-	if (status != kDelayAborted)
-		delay();
-
-	_windowManager->popCursor();
-
-	lucasFilm->free();
-	loom->free();
-
-	delete lucasFilm;
-	delete loom;
-	delete window;
+	// TODO
 }
 
 // A standard file picker dialog doesn't really make sense in ScummVM, so we
@@ -497,7 +197,7 @@ bool MacMI1Gui::runOpenDialog(int &saveSlotToHandle) {
 	Common::StringArray savegameNames;
 	prepareSaveLoad(savegameNames, availSlots, slotIds, ARRAYSIZE(availSlots));
 
-	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, "Loom", Graphics::kTextAlignLeft);
+	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, "Monkey Island", Graphics::kTextAlignLeft);
 	drawFakeDriveLabel(window, Common::Rect(242, 10, 340, 28), _hardDriveIcon, "ScummVM", Graphics::kTextAlignLeft);
 
 	window->addListBox(Common::Rect(14, 31, 232, 161), savegameNames, true);
@@ -543,8 +243,8 @@ bool MacMI1Gui::runSaveDialog(int &saveSlotToHandle, Common::String &name) {
 	Common::StringArray savegameNames;
 	prepareSaveLoad(savegameNames, busySlots, slotIds, ARRAYSIZE(busySlots));
 
-	Common::String saveGameFileAsResStr = _strsStrings[17].c_str();
-	Common::String gameFileResStr = _strsStrings[18].c_str();
+	Common::String saveGameFileAsResStr = _strsStrings[103].c_str();
+	Common::String gameFileResStr = _strsStrings[104].c_str();
 
 	int firstAvailableSlot = -1;
 	for (int i = 1; i < ARRAYSIZE(busySlots); i++) { // Skip the autosave slot
@@ -554,7 +254,7 @@ bool MacMI1Gui::runSaveDialog(int &saveSlotToHandle, Common::String &name) {
 		}
 	}
 
-	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, "Loom", Graphics::kTextAlignLeft);
+	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, "Monkey Island", Graphics::kTextAlignLeft);
 	drawFakeDriveLabel(window, Common::Rect(242, 10, 340, 28), _hardDriveIcon, "ScummVM", Graphics::kTextAlignLeft);
 
 	window->addListBox(Common::Rect(14, 31, 232, 129), savegameNames, true, true);
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index 5c73b3da888..2a999801ef5 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -1742,6 +1742,9 @@ void ScummEngine::updatePalette() {
 	}
 
 	_system->getPaletteManager()->setPalette(paletteColors, first, num);
+
+	if (_macGui)
+		_macGui->setPalette(paletteColors, 256);
 }
 
 } // End of namespace Scumm


Commit: 9f319cdd86d00fa9287342ecee1018a906e8c868
    https://github.com/scummvm/scummvm/commit/9f319cdd86d00fa9287342ecee1018a906e8c868
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Add Mac screen implementation for remaining LEC games

This adds optional EPX scaling and 640x480 resolution for
LucasArts Macintosh games other than Indy3 and Loom.

This includes:
* Monkey Island 1
* Monkey Island 2
* Indy4
* Day of the Tentacle
* Sam&Max
* Full Throttle
* The Dig

In doing this, I reverted the ugly code which previously offset
the game screen 20 pixels below (to create an internal 320x240
buffer, instead of 320x200). Instead of just offsetting mouse
coordinates and the final screen texture, I used to offset the
in-engine graphics elements. Ew.

This ensures flawless savegame compatibility between old and
new, without touching anything.

Changed paths:
    engines/scumm/charset.cpp
    engines/scumm/gfx.cpp
    engines/scumm/gfx_gui.cpp
    engines/scumm/gfx_mac.cpp
    engines/scumm/input.cpp
    engines/scumm/macgui/macgui.h
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/macgui/macgui_indy3.cpp
    engines/scumm/macgui/macgui_loom.cpp
    engines/scumm/macgui/macgui_mi1.cpp
    engines/scumm/room.cpp
    engines/scumm/saveload.cpp
    engines/scumm/script_v5.cpp
    engines/scumm/scumm.cpp
    engines/scumm/scumm.h
    engines/scumm/smush/smush_player.cpp
    engines/scumm/string.cpp


diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index 5863f908361..28cc1f74b3f 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -1276,7 +1276,7 @@ void CharsetRendererClassic::printCharIntern(bool is2byte, const byte *charPtr,
 		}
 
 		if (!ignoreCharsetMask && vs->hasTwoBuffers) {
-			drawTop = _top - _vm->_screenTop - _vm->_screenDrawOffset;
+			drawTop = _top - _vm->_screenTop;
 		}
 
 		if (is2byte && _vm->_game.platform != Common::kPlatformFMTowns)
@@ -1744,7 +1744,7 @@ void CharsetRendererMac::printChar(int chr, bool ignoreCharsetMask) {
 	// If this is the beginning of a line, assume the position will be
 	// correct without any padding.
 
-	if (_firstChar || (_top - _vm->_screenDrawOffset) != _lastTop) {
+	if (_firstChar || _top != _lastTop) {
 		_pad = false;
 	}
 
@@ -1801,7 +1801,7 @@ void CharsetRendererMac::printChar(int chr, bool ignoreCharsetMask) {
 	bool drawToTextBox = (vs->number == kTextVirtScreen && _vm->_game.id == GID_INDY3);
 
 	if (drawToTextBox)
-		_vm->_macGui->printCharToTextArea(chr, macLeft, macTop - 2 * (_vm->_screenDrawOffset), color);
+		_vm->_macGui->printCharToTextArea(chr, macLeft, macTop, color);
 	else
 		printCharInternal(chr, color, enableShadow, macLeft, macTop);
 
@@ -1881,7 +1881,7 @@ void CharsetRendererMac::printChar(int chr, bool ignoreCharsetMask) {
 		_pad = true;
 
 	_left = macLeft / 2;
-	_lastTop = _top - _vm->_screenDrawOffset;
+	_lastTop = _top;
 }
 
 byte CharsetRendererMac::getTextColor() {
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 1964bd9ade4..c57af1f889b 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -808,9 +808,9 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
 		int macPitch = _macScreen->pitch;
 
 		int originalScreenWidth = 320;
-		int originalScreenHeight = 240;
+		int originalScreenHeight = 200;
 
-		// Composite the dirty rectangle into _completeScreen
+		// Composite the dirty rectangle into _completeScreenBuffer
 		for (int h = 0; h < height; h++) {
 			for (int w = 0; w < width; w++) {
 				// Calculate absolute coordinates in the complete screen
@@ -824,7 +824,6 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
 			pixels += pixelsPitch;
 		}
 
-		// Reset pixels pointer for processing
 		pixels = (const byte *)src;
 
 		if (_useMacGraphicsSmoothing) {
@@ -851,9 +850,9 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
 					byte D = (absY < originalScreenHeight - 1) ? _completeScreenBuffer[(absY + 1) * originalScreenWidth + absX] : P;
 
 					// Actually scale the pixel
-					mac[2 * w] = (C == A && C != D && A != B) ? A : P;                // Top-left
-					mac[2 * w + 1] = (A == B && A != C && B != D) ? B : P;            // Top-right
-					mac[2 * w + macPitch] = (D == C && D != B && C != A) ? C : P;     // Bottom-left
+					mac[2 * w]                = (C == A && C != D && A != B) ? A : P; // Top-left
+					mac[2 * w + 1]            = (A == B && A != C && B != D) ? B : P; // Top-right
+					mac[2 * w + macPitch]     = (D == C && D != B && C != A) ? C : P; // Bottom-left
 					mac[2 * w + macPitch + 1] = (B == D && B != A && D != C) ? D : P; // Bottom-right
 				}
 
@@ -876,7 +875,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
 			}
 		}
 
-		_system->copyRectToScreen(_macScreen->getBasePtr(x * 2, y * 2), _macScreen->pitch, x * 2, y * 2, width * 2, height * 2);
+		_system->copyRectToScreen(_macScreen->getBasePtr(x * 2, y * 2), _macScreen->pitch, x * 2, y * 2 + _macScreenDrawOffset * 2, width * 2, height * 2);
 	} else {
 		// Finally blit the whole thing to the screen
 		_system->copyRectToScreen(src, pitch, x, y, width, height);
@@ -1315,7 +1314,7 @@ void ScummEngine::restoreBackground(Common::Rect rect, byte backColor) {
 			} else
 #endif
 			{
-				byte *mask = (byte *)_textSurface.getBasePtr(rect.left, rect.top - _screenTop - _screenDrawOffset);
+				byte *mask = (byte *)_textSurface.getBasePtr(rect.left, rect.top - _screenTop);
 				fill(mask, _textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.format.bytesPerPixel);
 			}
 		}
@@ -1342,7 +1341,7 @@ void ScummEngine::restoreBackground(Common::Rect rect, byte backColor) {
 
 void ScummEngine::restoreCharsetBg() {
 	_nextLeft = _string[0].xpos;
-	_nextTop = _string[0].ypos + _screenTop + _screenDrawOffset;
+	_nextTop = _string[0].ypos + _screenTop;
 
 	if (_charset->_hasMask || _postGUICharMask) {
 		_postGUICharMask = false;
@@ -1510,7 +1509,7 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) {
 	VirtScreen *vs;
 	byte *backbuff, *bgbuff;
 
-	if ((vs = findVirtScreen(y + _screenDrawOffset)) == nullptr)
+	if ((vs = findVirtScreen(y)) == nullptr)
 		return;
 
 	if (_game.version == 8) {
@@ -1552,8 +1551,8 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) {
 	y2++;
 
 	// Adjust for the topline of the VirtScreen
-	y -= vs->topline - _screenDrawOffset;
-	y2 -= vs->topline - _screenDrawOffset;
+	y -= vs->topline;
+	y2 -= vs->topline;
 
 	// Clip the coordinates
 	if (x < 0)
@@ -1721,7 +1720,7 @@ void ScummEngine::drawLine(int x1, int y1, int x2, int y2, int color) {
 
 	VirtScreen *vs;
 
-	if ((vs = findVirtScreen(y1 + _screenDrawOffset)) == nullptr)
+	if ((vs = findVirtScreen(y1)) == nullptr)
 		return;
 
 	black = getPaletteColorFromRGB(_currentPalette, 0x00, 0x00, 0x00);
@@ -4861,6 +4860,10 @@ void ScummEngine::scrollEffect(int dir) {
 
 	byte *src;
 	int m = _textSurfaceMultiplier;
+
+	if (m == 1 && _game.platform == Common::kPlatformMacintosh)
+		m = 2;
+
 	int vsPitch = vs->pitch;
 
 	switch (dir) {
diff --git a/engines/scumm/gfx_gui.cpp b/engines/scumm/gfx_gui.cpp
index 1e772b05bb4..1e1a5e0f8e3 100644
--- a/engines/scumm/gfx_gui.cpp
+++ b/engines/scumm/gfx_gui.cpp
@@ -1426,7 +1426,7 @@ void ScummEngine::saveSurfacesPreGUI() {
 					if (_tempTextSurface[x + y * _screenWidth] != 0xFD) {
 						if (x < _virtscr[kMainVirtScreen].pitch && y < _virtscr[kMainVirtScreen].h)
 							_virtscr[kMainVirtScreen].setPixel((_virtscr[kMainVirtScreen].xstart + x) % _virtscr[kMainVirtScreen].pitch,
-								y - _screenDrawOffset + (_virtscr[kMainVirtScreen].xstart + x) / _virtscr[kMainVirtScreen].pitch, _tempTextSurface[x + y * _screenWidth]);
+								y + (_virtscr[kMainVirtScreen].xstart + x) / _virtscr[kMainVirtScreen].pitch, _tempTextSurface[x + y * _screenWidth]);
 					}
 				}
 			}
diff --git a/engines/scumm/gfx_mac.cpp b/engines/scumm/gfx_mac.cpp
index 88c574933c7..59f3f864a9d 100644
--- a/engines/scumm/gfx_mac.cpp
+++ b/engines/scumm/gfx_mac.cpp
@@ -111,7 +111,7 @@ void ScummEngine::mac_drawStripToScreen(VirtScreen *vs, int top, int x, int y, i
 		}
 	}
 
-	_system->copyRectToScreen(_macScreen->getBasePtr(x * 2, y * 2), _macScreen->pitch, x * 2, y * 2, width * 2, height * 2);
+	_system->copyRectToScreen(_macScreen->getBasePtr(x * 2, y * 2), _macScreen->pitch, x * 2, y * 2 + _macScreenDrawOffset * 2, width * 2, height * 2);
 }
 
 void ScummEngine::mac_drawIndy3TextBox() {
@@ -121,7 +121,7 @@ void ScummEngine::mac_drawIndy3TextBox() {
 	// They are not drawn to the screen.
 
 	int x = 96;
-	int y = 32 + _screenDrawOffset * 2;
+	int y = 32;
 	int w = s->w;
 	int h = s->h - 2;
 
@@ -142,7 +142,7 @@ void ScummEngine::mac_undrawIndy3TextBox() {
 	Graphics::Surface *s = _macGui->textArea();
 
 	int x = 96;
-	int y = 32 + _screenDrawOffset * 2;
+	int y = 32;
 	int w = s->w;
 	int h = s->h - 2;
 
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index d4a940d2e6f..35e83485701 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -248,6 +248,11 @@ void ScummEngine::parseEvent(Common::Event event) {
 			_mouse.x >>= 1;
 			_mouse.y >>= 1;
 		}
+
+		if (_useMacScreenCorrectHeight && _macScreen) {
+			_mouse.y -= _macScreenDrawOffset;
+		}
+
 		break;
 	case Common::EVENT_LBUTTONUP:
 		_leftBtnPressed &= ~msDown;
diff --git a/engines/scumm/macgui/macgui.h b/engines/scumm/macgui/macgui.h
index d64bbdad912..51aeacd25c5 100644
--- a/engines/scumm/macgui/macgui.h
+++ b/engines/scumm/macgui/macgui.h
@@ -37,6 +37,8 @@ class Actor;
 class MacGuiImpl;
 
 class MacGui {
+	friend class ScummEngine;
+
 private:
 	MacGuiImpl *_impl = nullptr;
 
diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 80228dfc6fb..b30648267eb 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -593,7 +593,7 @@ MacGuiImpl::MacDialogWindow *MacGuiImpl::createWindow(Common::Rect bounds, MacDi
 	// 640x400 pixels, but that may not be a bad thing if we want to keep
 	// support for that resolution later.
 
-	bounds.translate(0, 2 * _vm->_screenDrawOffset);
+	bounds.translate(0, 2 * _vm->_macScreenDrawOffset);
 
 	return new MacDialogWindow(this, _system, _surface, bounds, style);
 }
diff --git a/engines/scumm/macgui/macgui_indy3.cpp b/engines/scumm/macgui/macgui_indy3.cpp
index d4d436e4541..efe53e168ce 100644
--- a/engines/scumm/macgui/macgui_indy3.cpp
+++ b/engines/scumm/macgui/macgui_indy3.cpp
@@ -880,7 +880,7 @@ MacIndy3Gui::MacIndy3Gui(ScummEngine *vm, const Common::Path &resourceFile) :
 	MacGuiImpl(vm, resourceFile), _visible(false) {
 
 	Common::Rect verbGuiArea(640, 112);
-	verbGuiArea.translate(0, 288 + 2 * _vm->_screenDrawOffset);
+	verbGuiArea.translate(0, 288 + _vm->_macScreenDrawOffset * 2);
 
 	_verbGuiTop = verbGuiArea.top;
 	_verbGuiSurface = _surface->getSubArea(verbGuiArea);
@@ -1711,7 +1711,7 @@ bool MacIndy3Gui::isVerbGuiAllowed() const {
 	// really seems to be all that's needed.
 
 	VirtScreen *vs = &_vm->_virtscr[kVerbVirtScreen];
-	if (vs->topline != 144 + _vm->_screenDrawOffset || vs->h != 56 + _vm->_screenDrawOffset)
+	if (vs->topline != 144 || vs->h != 56)
 		return false;
 
 	// HACK: Don't allow the GUI during fist fights. Usually this is not a
diff --git a/engines/scumm/macgui/macgui_loom.cpp b/engines/scumm/macgui/macgui_loom.cpp
index 47b6bab6542..e54784a979a 100644
--- a/engines/scumm/macgui/macgui_loom.cpp
+++ b/engines/scumm/macgui/macgui_loom.cpp
@@ -48,7 +48,7 @@ MacLoomGui::MacLoomGui(ScummEngine *vm, const Common::Path &resourceFile) : MacG
 	// The practice box can be moved, but this is its default position on
 	// a large screen, and it's not saved.
 
-	_practiceBoxPos = Common::Point(215, 376 + 2 * _vm->_screenDrawOffset);
+	_practiceBoxPos = Common::Point(215, 376 + 2 * _vm->_macScreenDrawOffset);
 	readStrings();
 }
 
@@ -1014,8 +1014,8 @@ bool MacLoomGui::handleEvent(Common::Event event) {
 			// Also, things get weird if you move the box into the
 			// menu hotzone, so don't allow that.
 
-			int maxY = _surface->h - _practiceBox->h - 2 * _vm->_screenDrawOffset;
-			int minY = 2 * _vm->_screenDrawOffset;
+			int maxY = _surface->h - _practiceBox->h - 2 * _vm->_macScreenDrawOffset;
+			int minY = 2 * _vm->_macScreenDrawOffset;
 
 			if (_vm->isUsingOriginalGUI() && minY < 23)
 				minY = 23;
diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index a348a3384ea..30dbdce1d41 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -211,10 +211,10 @@ bool MacMI1Gui::runOpenDialog(int &saveSlotToHandle) {
 	while (!_vm->shouldQuit()) {
 		int clicked = window->runDialog(deferredActionsIds);
 
-		if (clicked == 0 || clicked == 3) {
+		if (clicked == 0 || clicked == 6) {
 			saveSlotToHandle =
-				window->getWidgetValue(3) < ARRAYSIZE(slotIds) ?
-				slotIds[window->getWidgetValue(3)] : -1;
+				window->getWidgetValue(6) < ARRAYSIZE(slotIds) ?
+				slotIds[window->getWidgetValue(6)] : -1;
 			ret = true;
 			break;
 		}
@@ -431,6 +431,7 @@ bool MacMI1Gui::runOptionsDialog() {
 
 void MacMI1Gui::resetAfterLoad() {
 	reset();
+	_windowManager->replaceCursor(Graphics::MacGUIConstants::kMacCursorArrow);
 }
 
 bool MacMI1Gui::handleEvent(Common::Event event) {
diff --git a/engines/scumm/room.cpp b/engines/scumm/room.cpp
index 7a88019f4aa..5633ec0d295 100644
--- a/engines/scumm/room.cpp
+++ b/engines/scumm/room.cpp
@@ -196,7 +196,7 @@ void ScummEngine::startScene(int room, Actor *a, int objectNr) {
 		VAR(VAR_CAMERA_MAX_X) = _roomWidth - (_screenWidth / 2);
 
 	if (_game.version >= 7) {
-		VAR(VAR_CAMERA_MIN_Y) = _screenHeight / 2;
+		VAR(VAR_CAMERA_MIN_Y) = _screenHeight / 2;	
 		VAR(VAR_CAMERA_MAX_Y) = _roomHeight - (_screenHeight / 2);
 		setCameraAt(_screenWidth / 2, _screenHeight / 2);
 	} else {
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 213f97df416..b862458c87c 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -70,7 +70,7 @@ struct SaveInfoSection {
 
 #define SaveInfoSectionSize (4+4+4 + 4+4 + 4+2)
 
-#define CURRENT_VER 120
+#define CURRENT_VER 121
 #define INFOSECTION_VERSION 2
 
 #pragma mark -
@@ -753,9 +753,6 @@ bool ScummEngine::loadState(int slot, bool compat, Common::String &filename) {
 	if (_game.features & GF_OLD_BUNDLE)
 		loadCharset(0); // FIXME - HACK ?
 
-	// Save this for later
-	bool currentSessionUsesCorrection = _useMacScreenCorrectHeight;
-
 	//
 	// Now do the actual loading
 	//
@@ -875,17 +872,8 @@ bool ScummEngine::loadState(int slot, bool compat, Common::String &filename) {
 	updateDirtyScreen(kMainVirtScreen);
 	updatePalette();
 
-	if (!currentSessionUsesCorrection && _useMacScreenCorrectHeight) {
-		sb -= 20 * 2;
-		sh -= 20 * 2;
-	} else if (currentSessionUsesCorrection && !_useMacScreenCorrectHeight) {
-		sb += 20 * 2;
-		sh += 20 * 2;
-	}
-
 	initScreens(sb, sh);
 
-	_useMacScreenCorrectHeight = currentSessionUsesCorrection;
 	_completeScreenRedraw = true;
 
 	// Reset charset mask
@@ -1433,26 +1421,15 @@ void ScummEngine::saveLoadWithSerializer(Common::Serializer &s) {
 	s.syncAsByte(_cameraIsFrozen, VER(108));
 
 	// For Mac versions...
-	bool currentSessionUsesCorrection = _useMacScreenCorrectHeight;
-
-	s.syncAsUint16LE(_screenDrawOffset, VER(112));
+	s.skip(2, VER(112), VER(121)); // Old _screenDrawOffset
 	s.syncAsByte(_useMacScreenCorrectHeight, VER(112));
 
 	// If this is an older version without Mac screen
 	// offset correction, bring it up to date...
 	if (s.isLoading()) {
-		if (s.getVersion() < VER(112)) {
-			// We assume _useMacScreenCorrectHeight == false
-			camera._cur.y += _screenDrawOffset;
-			camera._last.y += _screenDrawOffset;
-		} else {
-			if (!currentSessionUsesCorrection && _useMacScreenCorrectHeight) {
-				camera._cur.y -= _screenDrawOffset;
-				camera._last.y -= _screenDrawOffset;
-			} else if (currentSessionUsesCorrection && !_useMacScreenCorrectHeight) {
-				camera._cur.y += _screenDrawOffset;
-				camera._last.y += _screenDrawOffset;
-			}
+		if (_game.version == 3 && _game.platform == Common::kPlatformMacintosh && s.getVersion() >= VER(112) && s.getVersion() < VER(121)) {
+			camera._cur.y -= 20;
+			camera._last.y -= 20;
 		}
 	}
 
@@ -1540,6 +1517,11 @@ void ScummEngine::saveLoadWithSerializer(Common::Serializer &s) {
 				_cursor.hotspotX = _cursor.hotspotY = 0;
 			}
 		}
+	} else if ((_cursor.width <= 0 || _cursor.width > 640 || _cursor.height <= 0 || _cursor.height > 480) && _game.platform == Common::kPlatformMacintosh) {
+		_cursor.width = 11;
+		_cursor.height = 16;
+		_cursor.hotspotX = 1;
+		_cursor.hotspotY = 1;
 	}
 
 	s.syncAsByte(_cursor.animate, VER(20));
@@ -1608,17 +1590,9 @@ void ScummEngine::saveLoadWithSerializer(Common::Serializer &s) {
 
 	// Other screen offset corrections for Mac games savestates...
 	if (s.isLoading()) {
-		if (s.getVersion() < VER(112)) {
-			_screenB += _screenDrawOffset;
-			_screenH += _screenDrawOffset;
-		} else {
-			if (currentSessionUsesCorrection && !_useMacScreenCorrectHeight) {
-				_screenB -= _screenDrawOffset;
-				_screenH -= _screenDrawOffset;
-			} else if (!currentSessionUsesCorrection && _useMacScreenCorrectHeight) {
-				_screenB += _screenDrawOffset;
-				_screenH += _screenDrawOffset;
-			}
+		if (_game.version == 3 && _game.platform == Common::kPlatformMacintosh && s.getVersion() >= VER(112) && s.getVersion() < VER(121)) {
+			_screenB -= 20;
+			_screenH -= 20;
 		}
 	}
 
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 90c04c197ee..b8ca033f3ec 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -2251,12 +2251,6 @@ void ScummEngine_v5::o5_roomOps() {
 			b = getVarOrDirectWord(PARAM_2);
 		}
 
-		// Mac version, draw the screens 20 pixels lower to account for the extra 40 pixels
-		if (_game.platform == Common::kPlatformMacintosh && _game.version >= 3 && _useMacScreenCorrectHeight) {
-			a += _screenDrawOffset;
-			b += _screenDrawOffset;
-		}
-
 		initScreens(a, b);
 		break;
 	case 4:		// SO_ROOM_PALETTE
@@ -2970,7 +2964,7 @@ void ScummEngine_v5::o5_verbOps() {
 			break;
 		case 5:		// SO_VERB_AT
 			vs->curRect.left = getVarOrDirectWord(PARAM_1);
-			vs->curRect.top = getVarOrDirectWord(PARAM_2) + _screenDrawOffset;
+			vs->curRect.top = getVarOrDirectWord(PARAM_2);
 			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 e25f0e7d06f..c50906eed0c 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -378,8 +378,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 		_screenHeight = 240;
 	} else if (!isSteamVersion && _useMacScreenCorrectHeight && _game.platform == Common::kPlatformMacintosh && _game.version >= 3) {
 		_screenWidth = 320;
-		_screenHeight = 240;
-		_screenDrawOffset = 20;
+		_screenHeight = 200;
 	} else {
 		_screenWidth = 320;
 		_screenHeight = 200;
@@ -1264,6 +1263,9 @@ Common::Error ScummEngine::init() {
 "instruments from. Music will be disabled."), _("OK"));
 				dialog.runModal();
 			}
+		} else {
+			_macScreen = new Graphics::Surface();
+			_macScreen->create(640, _useMacScreenCorrectHeight ? 480 : 400, Graphics::PixelFormat::createFormatCLUT8());
 		}
 
 		if (!macResourceFile.empty()) {
@@ -1279,6 +1281,8 @@ Common::Error ScummEngine::init() {
 		if (!_macScreen && _renderMode == Common::kRenderMacintoshBW)
 			_renderMode = Common::kRenderDefault;
 
+		memset(_completeScreenBuffer, 0, 320 * 200);
+
 		if (_macGui)
 			_macGui->initialize();
 	}
@@ -1289,12 +1293,16 @@ Common::Error ScummEngine::init() {
 	} else if (_renderMode == Common::kRenderCGA_BW || (_renderMode == Common::kRenderEGA && _supportsEGADithering)) {
 		initGraphics(_screenWidth * 2, _screenHeight * 2);
 	} else {
-		int screenWidth = _screenWidth * _textSurfaceMultiplier;
-		int screenHeight = _screenHeight * _textSurfaceMultiplier;
+		int screenWidth = _screenWidth;
+		int screenHeight = _screenHeight;
 
-		if (_macScreen && _game.platform == Common::kPlatformMacintosh && _game.version > 3) {
+		if (_macScreen && _game.platform == Common::kPlatformMacintosh && _game.version >= 3 && _game.heversion == 0) {
 			screenWidth *= 2;
 			screenHeight *= 2;
+			screenHeight += 2 * 2 * _macScreenDrawOffset;
+		} else {
+			screenWidth *= _textSurfaceMultiplier;
+			screenHeight *= _textSurfaceMultiplier;
 		}
 
 		if (_game.features & GF_16BIT_COLOR
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 827146fac61..2bf512588cd 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1312,7 +1312,7 @@ public:
 	// ScummVM GUI; but currently I'm not taking that responsibility, after all the
 	// work done on ensuring that old savegames translate correctly to the new setting... :-P
 	bool _useMacScreenCorrectHeight = true;
-	int _screenDrawOffset = 0;
+	int _macScreenDrawOffset = 20;
 
 	Common::RenderMode _renderMode;
 	uint8 _bytesPerPixel = 1;
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp
index 893198daf4a..0014f088ff4 100644
--- a/engines/scumm/smush/smush_player.cpp
+++ b/engines/scumm/smush/smush_player.cpp
@@ -1266,14 +1266,14 @@ void SmushPlayer::play(const char *filename, int32 speed, int32 offset, int32 st
 		_vm->scummLoop_handleSound();
 
 		if (_warpNeeded) {
-			_vm->_system->warpMouse(_warpX, _warpY);
+			_vm->_system->warpMouse(_vm->_macScreen ? _warpX * 2 : _warpX, _vm->_macScreen ? (_warpY * 2 + 2 * _vm->_macScreenDrawOffset) : _warpY);
 			_warpNeeded = false;
 		}
 		_vm->parseEvents();
 		_vm->processInput();
 		if (_palDirtyMax >= _palDirtyMin) {
 			// Apply gamma correction for Mac versions
-			if (_vm->_game.platform == Common::kPlatformMacintosh) {
+			if (_vm->_macScreen) {
 				byte palette[768];
 				memcpy(palette, _pal, 768);
 				for (int i = 0; i < ARRAYSIZE(palette); i++) {
@@ -1300,10 +1300,65 @@ void SmushPlayer::play(const char *filename, int32 speed, int32 offset, int32 st
 			if (!skipFrame) {
 				// WORKAROUND for bug #2415: "FT DEMO: assertion triggered
 				// when playing movie". Some frames there are 384 x 224
-				int w = MIN(_width, _vm->_screenWidth);
-				int h = MIN(_height, _vm->_screenHeight);
+				int frameWidth = MIN(_width, _vm->_screenWidth);
+				int frameHeight = MIN(_height, _vm->_screenHeight);
+
+				if (_vm->_macScreen) {
+					const byte *pixels = (const byte *)_dst;
+					byte *mac = (byte *)_vm->_macScreen->getPixels();
+
+					int pixelsPitch = frameWidth;
+					int macPitch = frameWidth * 2;
+					if (_vm->_useMacGraphicsSmoothing) {
+						// Apply the EPX/Scale2x algorithm on the SMUSH frame
+						for (int h = 0; h < frameHeight; h++) {
+							for (int w = 0; w < frameWidth; w++) {
+								// Center pixel
+								byte P = pixels[w];
+
+								// Top neighbor (A)
+								byte A = (h > 0) ? _dst[(h - 1) * _vm->_screenWidth + w] : P;
+
+								// Right neighbor (B)
+								byte B = (w < _vm->_screenWidth - 1) ? _dst[h * _vm->_screenWidth + (w + 1)] : P;
+
+								// Left neighbor (C)
+								byte C = (w > 0) ? _dst[h * _vm->_screenWidth + (w - 1)] : P;
+
+								// Bottom neighbor (D)
+								byte D = (h < _vm->_screenHeight - 1) ? _dst[(h + 1) * _vm->_screenWidth + w] : P;
+	
+								// Scale the pixel
+								mac[2 * w] =                (C == A && C != D && A != B) ? A : P; // Top-left
+								mac[2 * w + 1] =            (A == B && A != C && B != D) ? B : P; // Top-right
+								mac[2 * w + macPitch] =     (D == C && D != B && C != A) ? C : P; // Bottom-left
+								mac[2 * w + macPitch + 1] = (B == D && B != A && D != C) ? D : P; // Bottom-right
+							}
+
+							pixels += pixelsPitch;
+							mac += macPitch * 2;
+						}
+					} else {
+						// Just double the resolution
+						for (int h = 0; h < frameHeight; h++) {
+							for (int w = 0; w < frameWidth; w++) {
+								mac[2 * w] = pixels[w];
+								mac[2 * w + 1] = pixels[w];
+								mac[2 * w + macPitch] = pixels[w];
+								mac[2 * w + macPitch + 1] = pixels[w];
+							}
+
+							pixels += pixelsPitch;
+
+							mac += macPitch * 2;
+						}
+					}
+
+					_vm->_system->copyRectToScreen(_vm->_macScreen->getPixels(), _width * 2, 0, _vm->_macScreenDrawOffset * 2, frameWidth * 2, frameHeight * 2);
+				} else {
+					_vm->_system->copyRectToScreen(_dst, _width, 0, 0, frameWidth, frameHeight);
+				}
 
-				_vm->_system->copyRectToScreen(_dst, _width, 0, 0, w, h);
 				_vm->_system->updateScreen();
 				_updateNeeded = false;
 			}
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index 9b3cf7edfc0..c3ec348aab4 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -1005,7 +1005,7 @@ void ScummEngine::displayDialog() {
 			_string[0].xpos = _screenWidth - 80;
 	}
 
-	_charset->_top = _string[0].ypos + _screenTop + _screenDrawOffset;
+	_charset->_top = _string[0].ypos + _screenTop;
 	_charset->_startLeft = _charset->_left = _string[0].xpos;
 	_charset->_right = _string[0].right;
 	_charset->_center = _string[0].center;
@@ -1225,7 +1225,7 @@ void ScummEngine::drawString(int a, const byte *msg) {
 	if (_isRTL)
 		fakeBidiString(buf, false, sizeof(buf));
 
-	_charset->_top = _string[a].ypos + _screenTop + _screenDrawOffset;
+	_charset->_top = _string[a].ypos + _screenTop;
 	_charset->_startLeft = _charset->_left = _string[a].xpos;
 	_charset->_right = _string[a].right;
 	_charset->_center = _string[a].center;
@@ -1236,11 +1236,6 @@ void ScummEngine::drawString(int a, const byte *msg) {
 	VirtScreen *vs = findVirtScreen(_charset->_top);
 	bool shadowModeFlag = (vs && vs->number == kMainVirtScreen);
 
-	if (_game.version > 3 && _game.platform == Common::kPlatformMacintosh) {
-		if (vs && vs->number == kVerbVirtScreen)
-			_charset->_top -= _screenDrawOffset;
-	}
-
 	if (_game.version >= 5)
 		memcpy(_charsetColorMap, _charsetData[_charset->getCurID()], _game.id == GID_DIG ? sizeof(_charsetColorMap) : 4);
 


Commit: 2d12a2f5bd71db66c6f7b02c429f4045d5a53df7
    https://github.com/scummvm/scummvm/commit/2d12a2f5bd71db66c6f7b02c429f4045d5a53df7
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Add post-load fix comments

Changed paths:
    engines/scumm/saveload.cpp


diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index b862458c87c..f23e2a745c6 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -1420,12 +1420,12 @@ void ScummEngine::saveLoadWithSerializer(Common::Serializer &s) {
 	s.syncAsUint16LE(camera._movingToActor, VER(8));
 	s.syncAsByte(_cameraIsFrozen, VER(108));
 
-	// For Mac versions...
+	// Old stuff for Mac versions, see below...
 	s.skip(2, VER(112), VER(121)); // Old _screenDrawOffset
 	s.syncAsByte(_useMacScreenCorrectHeight, VER(112));
 
-	// If this is an older version without Mac screen
-	// offset correction, bring it up to date...
+	// Post-load fix for some savegame versions which offset the engine elements
+	// instead of offsetting the final screen texture and the mouse coordinates...
 	if (s.isLoading()) {
 		if (_game.version == 3 && _game.platform == Common::kPlatformMacintosh && s.getVersion() >= VER(112) && s.getVersion() < VER(121)) {
 			camera._cur.y -= 20;
@@ -1588,7 +1588,8 @@ void ScummEngine::saveLoadWithSerializer(Common::Serializer &s) {
 	s.syncAsUint16LE(_screenB, VER(8));
 	s.syncAsUint16LE(_screenH, VER(8));
 
-	// Other screen offset corrections for Mac games savestates...
+	// Post-load fix for some savegame versions which offset the engine elements
+	// instead of offsetting the final screen texture and the mouse coordinates...
 	if (s.isLoading()) {
 		if (_game.version == 3 && _game.platform == Common::kPlatformMacintosh && s.getVersion() >= VER(112) && s.getVersion() < VER(121)) {
 			_screenB -= 20;


Commit: 705d6ded4b7380172048b2fdb55c2294b61cf6a1
    https://github.com/scummvm/scummvm/commit/705d6ded4b7380172048b2fdb55c2294b61cf6a1
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Add preliminary support for Mac GUI for remaining v5 games

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index b30648267eb..35f4e1a09da 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -202,17 +202,20 @@ void MacGuiImpl::initialize() {
 		};
 
 		Common::String aboutMenuDef;
-
+		int maxMenu = -1;
 		switch (_vm->_game.id) {
 		case GID_INDY3:
 		case GID_LOOM:
 			aboutMenuDef = _strsStrings[11].c_str();
+			maxMenu = 130;
 			break;
 		case GID_MONKEY:
 			aboutMenuDef = _strsStrings[94].c_str();
+			maxMenu = 131;
 			break;
 		default:
 			aboutMenuDef = "About " + name() + "...<B;(-";
+			maxMenu = 132;
 		}
 
 		if (_vm->_game.id == GID_LOOM) {
@@ -229,7 +232,7 @@ void MacGuiImpl::initialize() {
 
 		menu->setCommandsCallback(menuCallback, this);
 
-		for (int i = 129; i <= 130; i++) {
+		for (int i = 129; i <= maxMenu; i++) {
 			Common::SeekableReadStream *res = resource.getResource(MKTAG('M', 'E', 'N', 'U'), i);
 
 			if (!res)
@@ -239,6 +242,16 @@ void MacGuiImpl::initialize() {
 			Common::String name = menuDef->operator[](0);
 			Common::String string = menuDef->operator[](1);
 			int id = menu->addMenuItem(nullptr, name);
+
+			if ((_vm->_game.id == GID_MONKEY || _vm->_game.id == GID_MONKEY2) && id == 3) {
+				string += ";(-;Smooth Graphics";
+			}
+
+			// Floppy version
+			if (_vm->_game.id == GID_INDY4 && !string.contains("Smooth Graphics") && id == 3) {
+				string += ";(-;Smooth Graphics";
+			}
+
 			menu->createSubMenuFromString(id, string.c_str(), 0);
 
 			delete menuDef;
@@ -357,6 +370,22 @@ bool MacGuiImpl::handleMenu(int id, Common::String &name) {
 	case 303:	// Paste
 	case 304:	// Clear
 		return true;
+
+	// Window menu
+	case 402: // Tiny
+	case 403: // Medium
+	case 404: // Large
+		return true;
+
+	case 405: // Graphics Smoothing
+		_vm->_useMacGraphicsSmoothing = !_vm->_useMacGraphicsSmoothing;
+
+		// Allow the engine to update the graphics mode
+		_vm->markRectAsDirty(kBannerVirtScreen, 0, 320, 0, 200);
+		_vm->markRectAsDirty(kTextVirtScreen, 0, 320, 0, 200);
+		_vm->markRectAsDirty(kVerbVirtScreen, 0, 320, 0, 200);
+		_vm->markRectAsDirty(kMainVirtScreen, 0, 320, 0, 200);
+		return true;
 	}
 
 	return false;
@@ -429,6 +458,25 @@ void MacGuiImpl::updateWindowManager() {
 		}
 	}
 
+	if (_vm->_game.version > 3) {
+		Graphics::MacMenuItem *windowMenu = menu->getMenuItem("Window");
+		Graphics::MacMenuItem *hideDesktopMenu = menu->getSubMenuItem(windowMenu, 0);
+		Graphics::MacMenuItem *hideBarMenu = menu->getSubMenuItem(windowMenu, 1);
+
+		hideDesktopMenu->enabled = false;
+		hideBarMenu->enabled = false;
+
+		// "Fix color map"
+		menu->getSubMenuItem(gameMenu, 5)->enabled = false;
+
+		// Window mode
+		menu->getSubMenuItem(windowMenu, 3)->enabled = false;
+		menu->getSubMenuItem(windowMenu, 4)->enabled = false;
+		menu->getSubMenuItem(windowMenu, 5)->enabled = false;
+
+		menu->getSubMenuItem(windowMenu, 7)->checked = _vm->_useMacGraphicsSmoothing;
+	}
+
 	_menuIsActive = isActive;
 	_windowManager->draw();
 }
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index c50906eed0c..ba5cb843463 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1199,17 +1199,13 @@ Common::Error ScummEngine::init() {
 					macResourceFile = indyFileNames[i];
 
 					_textSurfaceMultiplier = 2;
-					_macScreen = new Graphics::Surface();
-					_macScreen->create(640, _useMacScreenCorrectHeight ? 480 : 400, Graphics::PixelFormat::createFormatCLUT8());
-
 					_macGui = new MacGui(this, macResourceFile);
 					break;
 				}
 			}
 
 			if (macResourceFile.empty()) {
-				return Common::Error(Common::kReadingFailed, _(
-"This game requires the 'Indy' Macintosh executable for its fonts."));
+				return Common::Error(Common::kReadingFailed, _("This game requires the 'Indy' Macintosh executable for its fonts."));
 			}
 
 		} else if (_game.id == GID_LOOM) {
@@ -1225,16 +1221,13 @@ Common::Error ScummEngine::init() {
 					macResourceFile = loomFileNames[i];
 
 					_textSurfaceMultiplier = 2;
-					_macScreen = new Graphics::Surface();
-					_macScreen->create(640, _useMacScreenCorrectHeight ? 480 : 400, Graphics::PixelFormat::createFormatCLUT8());
 					_macGui = new MacGui(this, macResourceFile);
 					break;
 				}
 			}
 
 			if (macResourceFile.empty()) {
-				return Common::Error(Common::kReadingFailed, _(
-"This game requires the 'Loom' Macintosh executable for its music and fonts."));
+				return Common::Error(Common::kReadingFailed, _("This game requires the 'Loom' Macintosh executable for its music and fonts."));
 			}
 		} else if (_game.id == GID_MONKEY) {
 			// Try both with and without underscore in the
@@ -1249,23 +1242,62 @@ Common::Error ScummEngine::init() {
 			for (int i = 0; i < ARRAYSIZE(monkeyIslandFileNames); i++) {
 				if (resource.exists(monkeyIslandFileNames[i])) {
 					macResourceFile = monkeyIslandFileNames[i];
+					break;
+				}
+			}
 
-					_macScreen = new Graphics::Surface();
-					_macScreen->create(640, _useMacScreenCorrectHeight ? 480 : 400, Graphics::PixelFormat::createFormatCLUT8());
-					_macGui = new MacGui(this, macResourceFile);
+			if (macResourceFile.empty()) {
+				GUI::MessageDialog dialog(_("Could not find the 'Monkey Island' Macintosh executable to read resources\n"
+											"and instruments from. Music and Mac GUI will be disabled."), _("OK"));
+				dialog.runModal();
+			} else {
+				_macGui = new MacGui(this, macResourceFile);
+			}
+		} else if (_game.id == GID_INDY4 && _language != Common::JA_JPN) {
+			static const char *indy4FileNames[] = {
+				"Fate of Atlantis",
+				"Fate_of_Atlantis",
+				"Fate of Atlantis 1.1",
+				"Fate_of_Atlantis_1.1",
+				"Indy Fate",
+				"Indy_Fate"
+			};
+
+			for (int i = 0; i < ARRAYSIZE(indy4FileNames); i++) {
+				if (resource.exists(indy4FileNames[i])) {
+					macResourceFile = indy4FileNames[i];
 					break;
 				}
 			}
 
 			if (macResourceFile.empty()) {
-				GUI::MessageDialog dialog(_(
-"Could not find the 'Monkey Island' Macintosh executable to read the\n"
-"instruments from. Music will be disabled."), _("OK"));
+				GUI::MessageDialog dialog(_("Could not find the 'Fate of Atlantis' Macintosh executable.\n"
+											"Mac GUI will not be shown."),
+										_("OK"));
 				dialog.runModal();
+			} else {
+				_macGui = new MacGui(this, macResourceFile);
+			}
+		} else if (_game.id == GID_MONKEY2) {
+			static const char *monkeyIsland2FileNames[] = {
+				"LeChuck's Revenge",
+				"LeChuck's_Revenge"};
+
+			for (int i = 0; i < ARRAYSIZE(monkeyIsland2FileNames); i++) {
+				if (resource.exists(monkeyIsland2FileNames[i])) {
+					macResourceFile = monkeyIsland2FileNames[i];
+					break;
+				}
+			}
+
+			if (macResourceFile.empty()) {
+				GUI::MessageDialog dialog(_("Could not find the 'LeChuck's Revenge' Macintosh executable.\n"
+											"Mac GUI will not be shown."),
+										  _("OK"));
+				dialog.runModal();
+			} else {
+				_macGui = new MacGui(this, macResourceFile);
 			}
-		} else {
-			_macScreen = new Graphics::Surface();
-			_macScreen->create(640, _useMacScreenCorrectHeight ? 480 : 400, Graphics::PixelFormat::createFormatCLUT8());
 		}
 
 		if (!macResourceFile.empty()) {
@@ -1278,6 +1310,9 @@ Common::Error ScummEngine::init() {
 			resource.close();
 		}
 
+		_macScreen = new Graphics::Surface();
+		_macScreen->create(640, _useMacScreenCorrectHeight ? 480 : 400, Graphics::PixelFormat::createFormatCLUT8());
+
 		if (!_macScreen && _renderMode == Common::kRenderMacintoshBW)
 			_renderMode = Common::kRenderDefault;
 


Commit: 2e03c25bb1051b052bdb600025d1ac923d3d87b5
    https://github.com/scummvm/scummvm/commit/2e03c25bb1051b052bdb600025d1ac923d3d87b5
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Fix nullptr usage

Changed paths:
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index ba5cb843463..ce3037d3072 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1181,6 +1181,9 @@ Common::Error ScummEngine::init() {
 	if (_game.platform == Common::kPlatformMacintosh) {
 		Common::MacResManager resource;
 
+		_macScreen = new Graphics::Surface();
+		_macScreen->create(640, _useMacScreenCorrectHeight ? 480 : 400, Graphics::PixelFormat::createFormatCLUT8());
+
 		// \xAA is a trademark glyph in Mac OS Roman. We try that, but
 		// also the Windows version, the UTF-8 version, and just plain
 		// without in case the file system can't handle exotic
@@ -1310,9 +1313,6 @@ Common::Error ScummEngine::init() {
 			resource.close();
 		}
 
-		_macScreen = new Graphics::Surface();
-		_macScreen->create(640, _useMacScreenCorrectHeight ? 480 : 400, Graphics::PixelFormat::createFormatCLUT8());
-
 		if (!_macScreen && _renderMode == Common::kRenderMacintoshBW)
 			_renderMode = Common::kRenderDefault;
 


Commit: ffaacd8099f28641b106051d35a8e0817954f100
    https://github.com/scummvm/scummvm/commit/ffaacd8099f28641b106051d35a8e0817954f100
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Implement proper Mac cursors for MI2 and INDY4

Changed paths:
    engines/scumm/macgui/macgui_mi1.cpp


diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index 30dbdce1d41..763195fb511 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -145,7 +145,29 @@ bool MacMI1Gui::getFontParams(FontId fontId, int &id, int &size, int &slant) con
 }
 
 void MacMI1Gui::setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) {
-	_windowManager->replaceCursor(Graphics::MacGUIConstants::kMacCursorArrow);
+	if (_vm->_game.id == GID_MONKEY) {
+		_windowManager->replaceCursor(Graphics::MacGUIConstants::kMacCursorArrow);
+	} else {
+		Common::MacResManager resource;
+		Graphics::MacCursor macCursor;
+
+		resource.open(_resourceFile);
+
+		Common::SeekableReadStream *curs = resource.getResource(MKTAG('C', 'U', 'R', 'S'), 128);
+
+		if (macCursor.readFromStream(*curs)) {
+			width = macCursor.getWidth();
+			height = macCursor.getHeight();
+			hotspotX = macCursor.getHotspotX();
+			hotspotY = macCursor.getHotspotY();
+			animate = 0;
+
+			_windowManager->replaceCursor(Graphics::MacGUIConstants::kMacCursorCustom, &macCursor);
+		}
+
+		delete curs;
+		resource.close();
+	}
 }
 
 bool MacMI1Gui::handleMenu(int id, Common::String &name) {


Commit: a68ded44578d9c40db764aedfd9ab7902e2b464d
    https://github.com/scummvm/scummvm/commit/a68ded44578d9c40db764aedfd9ab7902e2b464d
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Fix EPX algorithm edge case

Changed paths:
    engines/scumm/gfx.cpp


diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index c57af1f889b..0e74acee16d 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -827,15 +827,50 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
 		pixels = (const byte *)src;
 
 		if (_useMacGraphicsSmoothing) {
-			// Apply the EPX/Scale2x algorithm
-			for (int h = 0; h < height; h++) {
-				for (int w = 0; w < width; w++) {
-					// Center pixel
-					byte P = pixels[w];
+			// This is a piecewise version of EPX/Scale2x.
+			//
+			// Just like the original, it applies EPX not on the entire screen but just on the
+			// interested "dirty" rectangle areas. This is easy: with each new rectangle we iteratively
+			// piece together a representation of the entire 320x200 screen buffer (_completeScreenBuffer),
+			// and for each pixel to scale, we look for its neighbors in that buffer, so that neighbors
+			// outside the rectangle area will be accounted for correctly.
+			//
+			// So to summarize, the algorithm is applied iteratively on the rectangle areas in the queue,
+			// in isolation. Unfortunately this can cause an interesting edge case:
+			// consider a black screen, and two big adjacent white rectangles with the same dimensions
+			// being drawn, the first one on the left and the second one on its right:
+			//
+			// 1. The first one gets drawn, and because of the EPX filter it exhibits rounded corners
+			//    (e.g. the lower right corner);
+			// 
+			// 2. The second one gets drawn next to the other but has no rounded corners on its left side,
+			//    because the cumulative 320x200 screen buffer being pieced together already has the
+			//    previously drawn rectangle in it;
+			//
+			// We end up with two white rectangles and a line of a couple black pixels e.g. down in the middle.
+			// 
+			// How do we solve that? I don't know how the original executable did this, but what works great
+			// here is to just expand the considered area one pixel outwards on every rectangle dimension,
+			// so that the algorithm can update previously drawn edges, preventing the issue explained above.
+
+			// Rectangle expansion
+			int x1 = (x > 0) ? x - 1 : 0;
+			int y1 = (y > 0) ? y - 1 : 0;
+			int x2 = (x + width < originalScreenWidth) ? x + width + 1 : originalScreenWidth;
+			int y2 = (y + height < originalScreenHeight) ? y + height + 1 : originalScreenHeight;
+
+			// Adjust output buffer accordingly
+			byte *macBufExp = (byte *)_macScreen->getBasePtr(x1 * 2, y1 * 2);
 
+			// Apply the EPX/Scale2x algorithm
+			for (int h = y1; h < y2; h++) {
+				for (int w = x1; w < x2; w++) {
 					// Calculate absolute screen coordinates of the current pixel
-					int absX = x + w;
-					int absY = y + h;
+					int absX = w;
+					int absY = h;
+
+					// Center pixel
+					byte P = _completeScreenBuffer[absY * originalScreenWidth + absX];
 
 					// Top neighbor (A)
 					byte A = (absY > 0) ? _completeScreenBuffer[(absY - 1) * originalScreenWidth + absX] : P;
@@ -849,16 +884,23 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
 					// Bottom neighbor (D)
 					byte D = (absY < originalScreenHeight - 1) ? _completeScreenBuffer[(absY + 1) * originalScreenWidth + absX] : P;
 
+					// Save the absolute X and Y position coordinates for the expanded rectangle
+					int macExpAbsX = (w - x1) * 2;
+					int macExpAbsY = (h - y1) * 2;
+
 					// Actually scale the pixel
-					mac[2 * w]                = (C == A && C != D && A != B) ? A : P; // Top-left
-					mac[2 * w + 1]            = (A == B && A != C && B != D) ? B : P; // Top-right
-					mac[2 * w + macPitch]     = (D == C && D != B && C != A) ? C : P; // Bottom-left
-					mac[2 * w + macPitch + 1] = (B == D && B != A && D != C) ? D : P; // Bottom-right
+					if (macExpAbsX >= 0 && macExpAbsX + 1 < (x2 - x1) * 2 && macExpAbsY >= 0 && macExpAbsY + 1 < (y2 - y1) * 2) {
+						macBufExp[macExpAbsX] = (C == A && C != D && A != B) ? A : P;                // Top-left
+						macBufExp[macExpAbsX + 1] = (A == B && A != C && B != D) ? B : P;            // Top-right
+						macBufExp[macExpAbsX + macPitch] = (D == C && D != B && C != A) ? C : P;     // Bottom-left
+						macBufExp[macExpAbsX + macPitch + 1] = (B == D && B != A && D != C) ? D : P; // Bottom-right
+					}
 				}
 
-				pixels += pixelsPitch;
-				mac += macPitch * 2;
+				macBufExp += macPitch * 2;
 			}
+
+			_system->copyRectToScreen(_macScreen->getBasePtr(x1 * 2, y1 * 2), _macScreen->pitch, x1 * 2, y1 * 2 + _macScreenDrawOffset * 2, (x2 - x1) * 2, (y2 - y1) * 2);
 		} else {
 			// Just double the resolution
 			for (int h = 0; h < height; h++) {
@@ -873,9 +915,9 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
 
 				mac += macPitch * 2;
 			}
-		}
 
-		_system->copyRectToScreen(_macScreen->getBasePtr(x * 2, y * 2), _macScreen->pitch, x * 2, y * 2 + _macScreenDrawOffset * 2, width * 2, height * 2);
+			_system->copyRectToScreen(_macScreen->getBasePtr(x * 2, y * 2), _macScreen->pitch, x * 2, y * 2 + _macScreenDrawOffset * 2, width * 2, height * 2);
+		}	
 	} else {
 		// Finally blit the whole thing to the screen
 		_system->copyRectToScreen(src, pitch, x, y, width, height);


Commit: 8f99ad12aed9087cb86ddb4d0f67858e114d8249
    https://github.com/scummvm/scummvm/commit/8f99ad12aed9087cb86ddb4d0f67858e114d8249
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Fix warning in input.cpp

Changed paths:
    engines/scumm/input.cpp


diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index 35e83485701..3c3f6de0561 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -244,7 +244,7 @@ void ScummEngine::parseEvent(Common::Event event) {
 				_mouse.y = _mouse.y * 4 / 7;
 			}
 
-		} else if ((_textSurfaceMultiplier == 2 || _game.version > 3 && _macScreen) || _renderMode == Common::kRenderCGA_BW || _enableEGADithering) {
+		} else if ((_textSurfaceMultiplier == 2 || _macScreen) || _renderMode == Common::kRenderCGA_BW || _enableEGADithering) {
 			_mouse.x >>= 1;
 			_mouse.y >>= 1;
 		}


Commit: 41cfe0f9cf285665b328e4df0e018970b9f2a415
    https://github.com/scummvm/scummvm/commit/41cfe0f9cf285665b328e4df0e018970b9f2a415
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Clean up Mac screen filtering code

Changed paths:
    engines/scumm/gfx.cpp
    engines/scumm/gfx_mac.cpp
    engines/scumm/scumm.h
    engines/scumm/smush/smush_player.cpp


diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 0e74acee16d..0faf8321e2b 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -801,123 +801,10 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
 	}
 
 	if (_macScreen && _game.platform == Common::kPlatformMacintosh && _game.version > 3) {
-		const byte *pixels = (const byte *)src;
-		byte *mac = (byte *)_macScreen->getBasePtr(x * 2, y * 2);
-
-		int pixelsPitch = pitch;
-		int macPitch = _macScreen->pitch;
-
-		int originalScreenWidth = 320;
-		int originalScreenHeight = 200;
-
-		// Composite the dirty rectangle into _completeScreenBuffer
-		for (int h = 0; h < height; h++) {
-			for (int w = 0; w < width; w++) {
-				// Calculate absolute coordinates in the complete screen
-				int absX = x + w;
-				int absY = y + h;
-
-				// Update the complete screen buffer
-				_completeScreenBuffer[absY * originalScreenWidth + absX] = pixels[w];
-			}
-
-			pixels += pixelsPitch;
-		}
-
-		pixels = (const byte *)src;
-
-		if (_useMacGraphicsSmoothing) {
-			// This is a piecewise version of EPX/Scale2x.
-			//
-			// Just like the original, it applies EPX not on the entire screen but just on the
-			// interested "dirty" rectangle areas. This is easy: with each new rectangle we iteratively
-			// piece together a representation of the entire 320x200 screen buffer (_completeScreenBuffer),
-			// and for each pixel to scale, we look for its neighbors in that buffer, so that neighbors
-			// outside the rectangle area will be accounted for correctly.
-			//
-			// So to summarize, the algorithm is applied iteratively on the rectangle areas in the queue,
-			// in isolation. Unfortunately this can cause an interesting edge case:
-			// consider a black screen, and two big adjacent white rectangles with the same dimensions
-			// being drawn, the first one on the left and the second one on its right:
-			//
-			// 1. The first one gets drawn, and because of the EPX filter it exhibits rounded corners
-			//    (e.g. the lower right corner);
-			// 
-			// 2. The second one gets drawn next to the other but has no rounded corners on its left side,
-			//    because the cumulative 320x200 screen buffer being pieced together already has the
-			//    previously drawn rectangle in it;
-			//
-			// We end up with two white rectangles and a line of a couple black pixels e.g. down in the middle.
-			// 
-			// How do we solve that? I don't know how the original executable did this, but what works great
-			// here is to just expand the considered area one pixel outwards on every rectangle dimension,
-			// so that the algorithm can update previously drawn edges, preventing the issue explained above.
-
-			// Rectangle expansion
-			int x1 = (x > 0) ? x - 1 : 0;
-			int y1 = (y > 0) ? y - 1 : 0;
-			int x2 = (x + width < originalScreenWidth) ? x + width + 1 : originalScreenWidth;
-			int y2 = (y + height < originalScreenHeight) ? y + height + 1 : originalScreenHeight;
-
-			// Adjust output buffer accordingly
-			byte *macBufExp = (byte *)_macScreen->getBasePtr(x1 * 2, y1 * 2);
-
-			// Apply the EPX/Scale2x algorithm
-			for (int h = y1; h < y2; h++) {
-				for (int w = x1; w < x2; w++) {
-					// Calculate absolute screen coordinates of the current pixel
-					int absX = w;
-					int absY = h;
-
-					// Center pixel
-					byte P = _completeScreenBuffer[absY * originalScreenWidth + absX];
-
-					// Top neighbor (A)
-					byte A = (absY > 0) ? _completeScreenBuffer[(absY - 1) * originalScreenWidth + absX] : P;
-
-					// Right neighbor (B)
-					byte B = (absX < originalScreenWidth - 1) ? _completeScreenBuffer[absY * originalScreenWidth + (absX + 1)] : P;
-
-					// Left neighbor (C)
-					byte C = (absX > 0) ? _completeScreenBuffer[absY * originalScreenWidth + (absX - 1)] : P;
-
-					// Bottom neighbor (D)
-					byte D = (absY < originalScreenHeight - 1) ? _completeScreenBuffer[(absY + 1) * originalScreenWidth + absX] : P;
-
-					// Save the absolute X and Y position coordinates for the expanded rectangle
-					int macExpAbsX = (w - x1) * 2;
-					int macExpAbsY = (h - y1) * 2;
-
-					// Actually scale the pixel
-					if (macExpAbsX >= 0 && macExpAbsX + 1 < (x2 - x1) * 2 && macExpAbsY >= 0 && macExpAbsY + 1 < (y2 - y1) * 2) {
-						macBufExp[macExpAbsX] = (C == A && C != D && A != B) ? A : P;                // Top-left
-						macBufExp[macExpAbsX + 1] = (A == B && A != C && B != D) ? B : P;            // Top-right
-						macBufExp[macExpAbsX + macPitch] = (D == C && D != B && C != A) ? C : P;     // Bottom-left
-						macBufExp[macExpAbsX + macPitch + 1] = (B == D && B != A && D != C) ? D : P; // Bottom-right
-					}
-				}
-
-				macBufExp += macPitch * 2;
-			}
-
-			_system->copyRectToScreen(_macScreen->getBasePtr(x1 * 2, y1 * 2), _macScreen->pitch, x1 * 2, y1 * 2 + _macScreenDrawOffset * 2, (x2 - x1) * 2, (y2 - y1) * 2);
-		} else {
-			// Just double the resolution
-			for (int h = 0; h < height; h++) {
-				for (int w = 0; w < width; w++) {
-					mac[2 * w] = pixels[w];
-					mac[2 * w + 1] = pixels[w];
-					mac[2 * w + macPitch] = pixels[w];
-					mac[2 * w + macPitch + 1] = pixels[w];
-				}
-
-				pixels += pixelsPitch;
-
-				mac += macPitch * 2;
-			}
-
-			_system->copyRectToScreen(_macScreen->getBasePtr(x * 2, y * 2), _macScreen->pitch, x * 2, y * 2 + _macScreenDrawOffset * 2, width * 2, height * 2);
-		}	
+		// Instead of using mac_drawStripToScreen(), we draw the entire already processed
+		// video buffer to screen with the following routine, because for newer games we
+		// need the text overlay to be already stamped on top of the buffer.
+		mac_drawBufferToScreen((const byte *)src, pitch, x, y, width, height);
 	} else {
 		// Finally blit the whole thing to the screen
 		_system->copyRectToScreen(src, pitch, x, y, width, height);
diff --git a/engines/scumm/gfx_mac.cpp b/engines/scumm/gfx_mac.cpp
index 59f3f864a9d..f64d627e09b 100644
--- a/engines/scumm/gfx_mac.cpp
+++ b/engines/scumm/gfx_mac.cpp
@@ -160,6 +160,138 @@ void ScummEngine::mac_undrawIndy3CreditsText() {
 	restoreCharsetBg();
 }
 
+void ScummEngine::mac_drawBufferToScreen(const byte *buffer, int pitch, int x, int y, int width, int height) {
+	// Composite the dirty rectangle into _completeScreenBuffer
+	mac_updateCompositeBuffer(buffer, pitch, x, y, width, height);
+
+	if (_useMacGraphicsSmoothing) {
+		// Apply the EPX scaling algorithm to produce a 640x480 image...
+		mac_applyEPXAndBlit(buffer, pitch, x, y, width, height);
+	} else {
+		// ...otherwise just double the resolution.
+		mac_applyDoubleResolutionAndBlit(buffer, pitch, x, y, width, height);
+	}
+}
+
+void ScummEngine::mac_updateCompositeBuffer(const byte *buffer, int pitch, int x, int y, int width, int height) {
+	const byte *pixels = buffer;
+
+	assert(width <= _screenWidth && height <= _screenHeight);
+
+	for (int h = 0; h < height; h++) {
+		for (int w = 0; w < width; w++) {
+			// Calculate absolute coordinates
+			int absX = x + w;
+			int absY = y + h;
+
+			// Update the complete screen buffer
+			_completeScreenBuffer[absY * _screenWidth + absX] = pixels[w];
+		}
+
+		pixels += pitch;
+	}
+}
+
+void ScummEngine::mac_applyDoubleResolutionAndBlit(const byte *buffer, int pitch, int x, int y, int width, int height) {
+	byte *mac = (byte *)_macScreen->getBasePtr(x * 2, y * 2);
+	const byte *pixels = buffer;
+	int macPitch = _macScreen->pitch;
+
+	for (int h = 0; h < height; h++) {
+		for (int w = 0; w < width; w++) {
+			mac[2 * w] = pixels[w];
+			mac[2 * w + 1] = pixels[w];
+			mac[2 * w + macPitch] = pixels[w];
+			mac[2 * w + macPitch + 1] = pixels[w];
+		}
+
+		pixels += pitch;
+
+		mac += macPitch * 2;
+	}
+
+	_system->copyRectToScreen(_macScreen->getBasePtr(x * 2, y * 2), _macScreen->pitch, x * 2, y * 2 + _macScreenDrawOffset * 2, width * 2, height * 2);
+}
+
+void ScummEngine::mac_applyEPXAndBlit(const byte *buffer, int pitch, int x, int y, int width, int height) {
+	// This is a piecewise version of EPX/Scale2x.
+	//
+	// Just like the original, it applies EPX not on the entire screen but just on the
+	// interested "dirty" rectangle areas. This is easy: with each new rectangle we iteratively
+	// piece together a representation of the entire 320x200 screen buffer (_completeScreenBuffer),
+	// and for each pixel to scale, we look for its neighbors in that buffer, so that neighbors
+	// outside the rectangle area will be accounted for correctly.
+	//
+	// So to summarize, the algorithm is applied iteratively on the rectangle areas in the queue,
+	// in isolation. Unfortunately this can cause an interesting edge case:
+	// consider a black screen, and two big adjacent white rectangles with the same dimensions
+	// being drawn, the first one on the left and the second one on its right:
+	//
+	// 1. The first one gets drawn, and because of the EPX filter it exhibits rounded corners
+	//    (e.g. the lower right corner);
+	//
+	// 2. The second one gets drawn next to the other but has no rounded corners on its left side,
+	//    because the cumulative 320x200 screen buffer being pieced together already has the
+	//    previously drawn rectangle in it;
+	//
+	// We end up with two white rectangles and a line of a couple black pixels e.g. down in the middle.
+	//
+	// How do we solve that? We expand the considered area one pixel outwards on every rectangle dimension,
+	// so that the algorithm can update previously drawn edges, preventing the issue explained above.
+	//
+	// I have later found out that this is the same strategy employed on Aaron Giles' 2002 re-releases,
+	// which supposedly use most of the same EPX code from the Macintosh interpreters.
+
+	// Rectangle expansion
+	int x1 = (x > 0) ? x - 1 : 0;
+	int y1 = (y > 0) ? y - 1 : 0;
+	int x2 = (x + width < _screenWidth) ? x + width + 1 : _screenWidth;
+	int y2 = (y + height < _screenHeight) ? y + height + 1 : _screenHeight;
+
+	// Adjust output buffer accordingly
+	byte *targetScreenBuf = (byte *)_macScreen->getBasePtr(x1 * 2, y1 * 2);
+
+	// Apply the EPX/Scale2x algorithm
+	for (int h = y1; h < y2; h++) {
+		for (int w = x1; w < x2; w++) {
+			// Calculate absolute screen coordinates of the current pixel
+			int absX = w;
+			int absY = h;
+
+			// Center pixel
+			byte P = _completeScreenBuffer[absY * _screenWidth + absX];
+
+			// Top neighbor (A)
+			byte A = (absY > 0) ? _completeScreenBuffer[(absY - 1) * _screenWidth + absX] : P;
+
+			// Right neighbor (B)
+			byte B = (absX < _screenWidth - 1) ? _completeScreenBuffer[absY * _screenWidth + (absX + 1)] : P;
+
+			// Left neighbor (C)
+			byte C = (absX > 0) ? _completeScreenBuffer[absY * _screenWidth + (absX - 1)] : P;
+
+			// Bottom neighbor (D)
+			byte D = (absY < _screenHeight - 1) ? _completeScreenBuffer[(absY + 1) * _screenWidth + absX] : P;
+
+			// Keep track of the coordinates for the expanded rectangle
+			int expandedAbsX = (w - x1) * 2;
+			int expandedAbsY = (h - y1) * 2;
+
+			// Actually scale the pixel
+			if (expandedAbsX >= 0 && expandedAbsX + 1 < (x2 - x1) * 2 && expandedAbsY >= 0 && expandedAbsY + 1 < (y2 - y1) * 2) {
+				targetScreenBuf[expandedAbsX] = (C == A && C != D && A != B) ? A : P;                          // Top-left
+				targetScreenBuf[expandedAbsX + 1] = (A == B && A != C && B != D) ? B : P;                      // Top-right
+				targetScreenBuf[expandedAbsX + _macScreen->pitch] = (D == C && D != B && C != A) ? C : P;      // Bottom-left
+				targetScreenBuf[expandedAbsX + _macScreen->pitch + 1] = (B == D && B != A && D != C) ? D : P;  // Bottom-right
+			}
+		}
+
+		targetScreenBuf += _macScreen->pitch * 2;
+	}
+
+	_system->copyRectToScreen(_macScreen->getBasePtr(x1 * 2, y1 * 2), _macScreen->pitch, x1 * 2, y1 * 2 + _macScreenDrawOffset * 2, (x2 - x1) * 2, (y2 - y1) * 2);
+}
+
 Common::KeyState ScummEngine::mac_showOldStyleBannerAndPause(const char *msg, int32 waitTime) {
 	char bannerMsg[512];
 
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 2bf512588cd..94f37f4c995 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1446,6 +1446,10 @@ protected:
 	void mac_drawIndy3TextBox();
 	void mac_undrawIndy3TextBox();
 	void mac_undrawIndy3CreditsText();
+	void mac_drawBufferToScreen(const byte *buffer, int pitch, int x, int y, int width, int height);
+	void mac_updateCompositeBuffer(const byte *buffer, int pitch, int x, int y, int width, int height);
+	void mac_applyDoubleResolutionAndBlit(const byte *buffer, int pitch, int x, int y, int width, int height);
+	void mac_applyEPXAndBlit(const byte *buffer, int pitch, int x, int y, int width, int height);
 	Common::KeyState mac_showOldStyleBannerAndPause(const char *msg, int32 waitTime);
 
 	const byte *postProcessDOSGraphics(VirtScreen *vs, int &pitch, int &x, int &y, int &width, int &height) const;
@@ -1618,7 +1622,7 @@ public:
 	Graphics::Surface *_macScreen = nullptr;
 	MacGui *_macGui = nullptr;
 	bool _useMacGraphicsSmoothing = true;
-	byte _completeScreenBuffer[320 * 240];
+	byte _completeScreenBuffer[320 * 200];
 
 protected:
 	byte _charsetColor = 0;
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp
index 0014f088ff4..2e54d0fe816 100644
--- a/engines/scumm/smush/smush_player.cpp
+++ b/engines/scumm/smush/smush_player.cpp
@@ -1304,57 +1304,7 @@ void SmushPlayer::play(const char *filename, int32 speed, int32 offset, int32 st
 				int frameHeight = MIN(_height, _vm->_screenHeight);
 
 				if (_vm->_macScreen) {
-					const byte *pixels = (const byte *)_dst;
-					byte *mac = (byte *)_vm->_macScreen->getPixels();
-
-					int pixelsPitch = frameWidth;
-					int macPitch = frameWidth * 2;
-					if (_vm->_useMacGraphicsSmoothing) {
-						// Apply the EPX/Scale2x algorithm on the SMUSH frame
-						for (int h = 0; h < frameHeight; h++) {
-							for (int w = 0; w < frameWidth; w++) {
-								// Center pixel
-								byte P = pixels[w];
-
-								// Top neighbor (A)
-								byte A = (h > 0) ? _dst[(h - 1) * _vm->_screenWidth + w] : P;
-
-								// Right neighbor (B)
-								byte B = (w < _vm->_screenWidth - 1) ? _dst[h * _vm->_screenWidth + (w + 1)] : P;
-
-								// Left neighbor (C)
-								byte C = (w > 0) ? _dst[h * _vm->_screenWidth + (w - 1)] : P;
-
-								// Bottom neighbor (D)
-								byte D = (h < _vm->_screenHeight - 1) ? _dst[(h + 1) * _vm->_screenWidth + w] : P;
-	
-								// Scale the pixel
-								mac[2 * w] =                (C == A && C != D && A != B) ? A : P; // Top-left
-								mac[2 * w + 1] =            (A == B && A != C && B != D) ? B : P; // Top-right
-								mac[2 * w + macPitch] =     (D == C && D != B && C != A) ? C : P; // Bottom-left
-								mac[2 * w + macPitch + 1] = (B == D && B != A && D != C) ? D : P; // Bottom-right
-							}
-
-							pixels += pixelsPitch;
-							mac += macPitch * 2;
-						}
-					} else {
-						// Just double the resolution
-						for (int h = 0; h < frameHeight; h++) {
-							for (int w = 0; w < frameWidth; w++) {
-								mac[2 * w] = pixels[w];
-								mac[2 * w + 1] = pixels[w];
-								mac[2 * w + macPitch] = pixels[w];
-								mac[2 * w + macPitch + 1] = pixels[w];
-							}
-
-							pixels += pixelsPitch;
-
-							mac += macPitch * 2;
-						}
-					}
-
-					_vm->_system->copyRectToScreen(_vm->_macScreen->getPixels(), _width * 2, 0, _vm->_macScreenDrawOffset * 2, frameWidth * 2, frameHeight * 2);
+					_vm->mac_drawBufferToScreen(_dst, frameWidth, 0, 0, frameWidth, frameHeight);
 				} else {
 					_vm->_system->copyRectToScreen(_dst, _width, 0, 0, frameWidth, frameHeight);
 				}


Commit: 0558adf4afb501d56a1e6a5021050f3d5c0092ae
    https://github.com/scummvm/scummvm/commit/0558adf4afb501d56a1e6a5021050f3d5c0092ae
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Refactor Mac scaling algorithms to implement cursor handling

Changed paths:
    engines/scumm/cursor.cpp
    engines/scumm/gfx_mac.cpp
    engines/scumm/scumm.h


diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 136d6bbb37c..c534bad7183 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -274,17 +274,26 @@ void ScummEngine_v6::setCursorTransparency(int a) {
 
 void ScummEngine::updateCursor() {
 	int transColor = (_game.heversion >= 80) ? 5 : 255;
+	byte *cursor = _grabbedCursor;
+	int width = _cursor.width;
+	int height = _cursor.height;
+	int hotspotX = _cursor.hotspotX;
+	int hotspotY = _cursor.hotspotY;
+
+	if (_macScreen && _game.version == 6 && _game.heversion == 0)
+		mac_scaleCursor(cursor, hotspotX, hotspotY, width, height);
+
 #ifdef USE_RGB_COLOR
 	Graphics::PixelFormat format = _system->getScreenFormat();
-	CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
-							_cursor.hotspotX, _cursor.hotspotY,
-							(_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
+	CursorMan.replaceCursor(cursor, width, height,
+							hotspotX, hotspotY,
+							(_game.platform == Common::kPlatformNES ? cursor[63] : transColor),
 							(_game.heversion == 70 ? true : false),
 							&format);
 #else
-	CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
-							_cursor.hotspotX, _cursor.hotspotY,
-							(_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
+	CursorMan.replaceCursor(cursor, width, height,
+							hotspotX, hotspotY,
+							(_game.platform == Common::kPlatformNES ? cursor[63] : transColor),
 							(_game.heversion == 70 ? true : false));
 #endif
 }
@@ -407,16 +416,25 @@ void ScummEngine_v7::updateCursor() {
 		transColor = isSmushActive() ? 0x01 : 0xFF;
 	}
 
+	byte *cursor = _grabbedCursor;
+	int width = _cursor.width;
+	int height = _cursor.height;
+	int hotspotX = _cursor.hotspotX;
+	int hotspotY = _cursor.hotspotY;
+
+	if (_macScreen)
+		mac_scaleCursor(cursor, hotspotX, hotspotY, width, height);
+
 #ifdef USE_RGB_COLOR
 	Graphics::PixelFormat format = _system->getScreenFormat();
-	CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
-							_cursor.hotspotX, _cursor.hotspotY,
+	CursorMan.replaceCursor(cursor, width, height,
+							hotspotX, hotspotY,
 							transColor,
 							false,
 							&format);
 #else
-	CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
-							_cursor.hotspotX, _cursor.hotspotY,
+	CursorMan.replaceCursor(cursor, width, height,
+							hotspotX, hotspotY,
 							transColor,
 							false);
 #endif
diff --git a/engines/scumm/gfx_mac.cpp b/engines/scumm/gfx_mac.cpp
index f64d627e09b..b6312e5232f 100644
--- a/engines/scumm/gfx_mac.cpp
+++ b/engines/scumm/gfx_mac.cpp
@@ -166,10 +166,10 @@ void ScummEngine::mac_drawBufferToScreen(const byte *buffer, int pitch, int x, i
 
 	if (_useMacGraphicsSmoothing) {
 		// Apply the EPX scaling algorithm to produce a 640x480 image...
-		mac_applyEPXAndBlit(buffer, pitch, x, y, width, height);
+		mac_blitEPXImage(buffer, pitch, x, y, width, height);
 	} else {
 		// ...otherwise just double the resolution.
-		mac_applyDoubleResolutionAndBlit(buffer, pitch, x, y, width, height);
+		mac_blitDoubleResImage(buffer, pitch, x, y, width, height);
 	}
 }
 
@@ -192,28 +192,32 @@ void ScummEngine::mac_updateCompositeBuffer(const byte *buffer, int pitch, int x
 	}
 }
 
-void ScummEngine::mac_applyDoubleResolutionAndBlit(const byte *buffer, int pitch, int x, int y, int width, int height) {
+void ScummEngine::mac_blitDoubleResImage(const byte *buffer, int pitch, int x, int y, int width, int height) {
 	byte *mac = (byte *)_macScreen->getBasePtr(x * 2, y * 2);
-	const byte *pixels = buffer;
-	int macPitch = _macScreen->pitch;
+
+	mac_applyDoubleResToBuffer(buffer, mac, width, height, pitch, _macScreen->pitch);
+
+	_system->copyRectToScreen(_macScreen->getBasePtr(x * 2, y * 2), _macScreen->pitch, x * 2, y * 2 + _macScreenDrawOffset * 2, width * 2, height * 2);
+}
+
+void ScummEngine::mac_applyDoubleResToBuffer(const byte *inputBuffer, byte *outputBuffer, int width, int height, int inputPitch, int outputPitch) {
+	const byte *pixels = inputBuffer;
+	byte *outPixels = outputBuffer;
 
 	for (int h = 0; h < height; h++) {
 		for (int w = 0; w < width; w++) {
-			mac[2 * w] = pixels[w];
-			mac[2 * w + 1] = pixels[w];
-			mac[2 * w + macPitch] = pixels[w];
-			mac[2 * w + macPitch + 1] = pixels[w];
+			outPixels[2 * w] = pixels[w];
+			outPixels[2 * w + 1] = pixels[w];
+			outPixels[2 * w + outputPitch] = pixels[w];
+			outPixels[2 * w + outputPitch + 1] = pixels[w];
 		}
 
-		pixels += pitch;
-
-		mac += macPitch * 2;
+		pixels += inputPitch;
+		outPixels += outputPitch * 2;
 	}
-
-	_system->copyRectToScreen(_macScreen->getBasePtr(x * 2, y * 2), _macScreen->pitch, x * 2, y * 2 + _macScreenDrawOffset * 2, width * 2, height * 2);
 }
 
-void ScummEngine::mac_applyEPXAndBlit(const byte *buffer, int pitch, int x, int y, int width, int height) {
+void ScummEngine::mac_blitEPXImage(const byte *buffer, int pitch, int x, int y, int width, int height) {
 	// This is a piecewise version of EPX/Scale2x.
 	//
 	// Just like the original, it applies EPX not on the entire screen but just on the
@@ -252,44 +256,88 @@ void ScummEngine::mac_applyEPXAndBlit(const byte *buffer, int pitch, int x, int
 	byte *targetScreenBuf = (byte *)_macScreen->getBasePtr(x1 * 2, y1 * 2);
 
 	// Apply the EPX/Scale2x algorithm
-	for (int h = y1; h < y2; h++) {
-		for (int w = x1; w < x2; w++) {
+	mac_applyEPXToBuffer(_completeScreenBuffer, targetScreenBuf, x2 - x1, y2 - y1, _screenWidth, _macScreen->pitch, x1, y1, _screenWidth, _screenHeight);
+
+	_system->copyRectToScreen(_macScreen->getBasePtr(x1 * 2, y1 * 2), _macScreen->pitch, x1 * 2, y1 * 2 + _macScreenDrawOffset * 2, (x2 - x1) * 2, (y2 - y1) * 2);
+}
+
+void ScummEngine::mac_applyEPXToBuffer(const byte *inputBuffer, byte *outputBuffer, int width, int height, int inputPitch, int outputPitch, int xOffset, int yOffset, int bufferWidth, int bufferHeight) {
+	// The EPX/Scale2x algorithm scales a single pixel to
+	// four pixels based on the original pixel's neighbors.
+	//
+	//                +---+---+
+	//    A           | 1 | 2 |
+	//  C P B   -->   +---+---+
+	//    D           | 3 | 4 |
+	//                +---+---+
+	// 
+	// Let P be the pixel, and A,B,C,D its neighbors,
+	// then the new 1,2,3,4 pixels are defined as follows:
+	// 
+	// 1=P; 2=P; 3=P; 4=P;
+	// 
+	// IF C==A => 1=A
+	// IF A==B => 2=B
+	// IF D==C => 3=C
+	// IF B==D => 4=D
+	// 
+	// IF of A, B, C, D, three or more are identical: 1=2=3=4=P
+
+	for (int h = 0; h < height; h++) {
+		for (int w = 0; w < width; w++) {
 			// Calculate absolute screen coordinates of the current pixel
-			int absX = w;
-			int absY = h;
+			int absX = w + xOffset;
+			int absY = h + yOffset;
+
+			if (absX < 0 || absX >= bufferWidth || absY < 0 || absY >= bufferHeight)
+				continue; // Skip out-of-bounds pixels
 
 			// Center pixel
-			byte P = _completeScreenBuffer[absY * _screenWidth + absX];
+			byte P = inputBuffer[absY * inputPitch + absX];
 
 			// Top neighbor (A)
-			byte A = (absY > 0) ? _completeScreenBuffer[(absY - 1) * _screenWidth + absX] : P;
+			byte A = (absY > 0) ? inputBuffer[(absY - 1) * inputPitch + absX] : P;
 
 			// Right neighbor (B)
-			byte B = (absX < _screenWidth - 1) ? _completeScreenBuffer[absY * _screenWidth + (absX + 1)] : P;
+			byte B = (absX < bufferWidth - 1) ? inputBuffer[absY * inputPitch + (absX + 1)] : P;
 
 			// Left neighbor (C)
-			byte C = (absX > 0) ? _completeScreenBuffer[absY * _screenWidth + (absX - 1)] : P;
+			byte C = (absX > 0) ? inputBuffer[absY * inputPitch + (absX - 1)] : P;
 
 			// Bottom neighbor (D)
-			byte D = (absY < _screenHeight - 1) ? _completeScreenBuffer[(absY + 1) * _screenWidth + absX] : P;
+			byte D = (absY < bufferHeight - 1) ? inputBuffer[(absY + 1) * inputPitch + absX] : P;
 
-			// Keep track of the coordinates for the expanded rectangle
-			int expandedAbsX = (w - x1) * 2;
-			int expandedAbsY = (h - y1) * 2;
+			int expW = w * 2;
+			int expH = h * 2;
 
 			// Actually scale the pixel
-			if (expandedAbsX >= 0 && expandedAbsX + 1 < (x2 - x1) * 2 && expandedAbsY >= 0 && expandedAbsY + 1 < (y2 - y1) * 2) {
-				targetScreenBuf[expandedAbsX] = (C == A && C != D && A != B) ? A : P;                          // Top-left
-				targetScreenBuf[expandedAbsX + 1] = (A == B && A != C && B != D) ? B : P;                      // Top-right
-				targetScreenBuf[expandedAbsX + _macScreen->pitch] = (D == C && D != B && C != A) ? C : P;      // Bottom-left
-				targetScreenBuf[expandedAbsX + _macScreen->pitch + 1] = (B == D && B != A && D != C) ? D : P;  // Bottom-right
+			if (expW >= 0 && expW + 1 < width * 2 && expH >= 0 && expH + 1 < height * 2) {
+				outputBuffer[expH * outputPitch + expW]           = (C == A && C != D && A != B) ? A : P; // Top-left
+				outputBuffer[expH * outputPitch + expW + 1]       = (A == B && A != C && B != D) ? B : P; // Top-right
+				outputBuffer[(expH + 1) * outputPitch + expW]     = (D == C && D != B && C != A) ? C : P; // Bottom-left
+				outputBuffer[(expH + 1) * outputPitch + expW + 1] = (B == D && B != A && D != C) ? D : P; // Bottom-right
 			}
 		}
+	}
+}
+
+void ScummEngine::mac_scaleCursor(byte *&outCursor, int &outHotspotX, int &outHotspotY, int &outWidth, int &outHeight) {
+	int newWidth = _cursor.width * 2;
+	int newHeight = _cursor.height * 2;
+
+	memset(_macGrabbedCursor, 0, ARRAYSIZE(_macGrabbedCursor));
 
-		targetScreenBuf += _macScreen->pitch * 2;
+	if (_useMacGraphicsSmoothing) {
+		mac_applyEPXToBuffer(_grabbedCursor, _macGrabbedCursor, _cursor.width, _cursor.height, _cursor.width, newWidth, 0, 0, _cursor.width, _cursor.height);
+	} else {
+		mac_applyDoubleResToBuffer(_grabbedCursor, _macGrabbedCursor, _cursor.width, _cursor.height, _cursor.width, newWidth);
 	}
 
-	_system->copyRectToScreen(_macScreen->getBasePtr(x1 * 2, y1 * 2), _macScreen->pitch, x1 * 2, y1 * 2 + _macScreenDrawOffset * 2, (x2 - x1) * 2, (y2 - y1) * 2);
+	outWidth = newWidth;
+	outHeight = newHeight;
+	outCursor = _macGrabbedCursor;
+	outHotspotX = _cursor.hotspotX * 2;
+	outHotspotY = _cursor.hotspotY * 2;
 }
 
 Common::KeyState ScummEngine::mac_showOldStyleBannerAndPause(const char *msg, int32 waitTime) {
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 94f37f4c995..d11dd3eedd0 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1341,6 +1341,7 @@ protected:
 	// HACK Double the array size to handle 16-bit images.
 	// this should be dynamically allocated based on game depth instead.
 	byte _grabbedCursor[16384];
+	byte _macGrabbedCursor[16384 * 4]; // Double resolution cursor
 	byte _currentCursor = 0;
 
 	byte _newEffect = 0, _switchRoomEffect2 = 0, _switchRoomEffect = 0;
@@ -1448,8 +1449,12 @@ protected:
 	void mac_undrawIndy3CreditsText();
 	void mac_drawBufferToScreen(const byte *buffer, int pitch, int x, int y, int width, int height);
 	void mac_updateCompositeBuffer(const byte *buffer, int pitch, int x, int y, int width, int height);
-	void mac_applyDoubleResolutionAndBlit(const byte *buffer, int pitch, int x, int y, int width, int height);
-	void mac_applyEPXAndBlit(const byte *buffer, int pitch, int x, int y, int width, int height);
+	void mac_blitDoubleResImage(const byte *buffer, int pitch, int x, int y, int width, int height);
+	void mac_applyDoubleResToBuffer(const byte *inputBuffer, byte *outputBuffer, int width, int height, int inputPitch, int outputPitch);
+	void mac_blitEPXImage(const byte *buffer, int pitch, int x, int y, int width, int height);
+	void mac_applyEPXToBuffer(const byte *inputBuffer, byte *outputBuffer, int width, int height, int inputPitch, int outputPitch, int xOffset, int yOffset, int bufferWidth, int bufferHeight);
+	void mac_scaleCursor(byte *&outCursor, int &outHotspotX, int &outHotspotY, int &outWidth, int &outHeight);
+
 	Common::KeyState mac_showOldStyleBannerAndPause(const char *msg, int32 waitTime);
 
 	const byte *postProcessDOSGraphics(VirtScreen *vs, int &pitch, int &x, int &y, int &width, int &height) const;


Commit: 6b28d2c8140f2574c74829961050ead938cc2f1a
    https://github.com/scummvm/scummvm/commit/6b28d2c8140f2574c74829961050ead938cc2f1a
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Assign Mac smoothing to config entry & implement Speech menu

Changed paths:
    engines/scumm/gfx_mac.cpp
    engines/scumm/input.cpp
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/macgui/macgui_mi1.cpp
    engines/scumm/scumm.cpp
    engines/scumm/scumm.h


diff --git a/engines/scumm/gfx_mac.cpp b/engines/scumm/gfx_mac.cpp
index b6312e5232f..ba9939069fb 100644
--- a/engines/scumm/gfx_mac.cpp
+++ b/engines/scumm/gfx_mac.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "common/config-manager.h"
 #include "common/system.h"
 
 #include "graphics/macega.h"
@@ -340,6 +341,22 @@ void ScummEngine::mac_scaleCursor(byte *&outCursor, int &outHotspotX, int &outHo
 	outHotspotY = _cursor.hotspotY * 2;
 }
 
+void ScummEngine::mac_toggleSmoothing() {
+	_useMacGraphicsSmoothing = !_useMacGraphicsSmoothing;
+
+	ConfMan.setBool("mac_graphics_smoothing", _useMacGraphicsSmoothing);
+	ConfMan.flushToDisk();
+
+	// Allow the engine to update the graphics mode
+	markRectAsDirty(kBannerVirtScreen, 0, 320, 0, 200);
+	markRectAsDirty(kTextVirtScreen, 0, 320, 0, 200);
+	markRectAsDirty(kVerbVirtScreen, 0, 320, 0, 200);
+	markRectAsDirty(kMainVirtScreen, 0, 320, 0, 200);
+
+	if (_game.version > 5)
+		updateCursor();
+}
+
 Common::KeyState ScummEngine::mac_showOldStyleBannerAndPause(const char *msg, int32 waitTime) {
 	char bannerMsg[512];
 
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index 3c3f6de0561..d164316e689 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -941,6 +941,7 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) {
 	bool isSegaCD = _game.platform == Common::kPlatformSegaCD;
 	bool isNES = _game.platform == Common::kPlatformNES;
 	bool inSaveRoom = false;
+	bool canToggleSmoothing = _macScreen && _game.version > 3 && _game.heversion == 0;
 
 	// The following check is used by v3 games which have writable savegame names
 	// and also support some key combinations which in our case are mapped to SHIFT-<letter>
@@ -1409,6 +1410,8 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) {
 		if (VAR_CHARINC != 0xFF)
 			VAR(VAR_CHARINC) = 9 - _defaultTextSpeed;
 
+	} else if (canToggleSmoothing && (lastKeyHit.keycode == Common::KEYCODE_g && lastKeyHit.hasFlags(Common::KBD_ALT))) {
+		mac_toggleSmoothing();
 	} else {
 
 		if (lastKeyHit.keycode >= Common::KEYCODE_F1 &&
diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 35f4e1a09da..03811d8cda7 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -244,12 +244,12 @@ void MacGuiImpl::initialize() {
 			int id = menu->addMenuItem(nullptr, name);
 
 			if ((_vm->_game.id == GID_MONKEY || _vm->_game.id == GID_MONKEY2) && id == 3) {
-				string += ";(-;Smooth Graphics";
+				string += ";(-;Smooth Graphics/G";
 			}
 
 			// Floppy version
 			if (_vm->_game.id == GID_INDY4 && !string.contains("Smooth Graphics") && id == 3) {
-				string += ";(-;Smooth Graphics";
+				string += ";(-;Smooth Graphics/G";
 			}
 
 			menu->createSubMenuFromString(id, string.c_str(), 0);
@@ -378,13 +378,22 @@ bool MacGuiImpl::handleMenu(int id, Common::String &name) {
 		return true;
 
 	case 405: // Graphics Smoothing
-		_vm->_useMacGraphicsSmoothing = !_vm->_useMacGraphicsSmoothing;
+		_vm->mac_toggleSmoothing();
 
-		// Allow the engine to update the graphics mode
-		_vm->markRectAsDirty(kBannerVirtScreen, 0, 320, 0, 200);
-		_vm->markRectAsDirty(kTextVirtScreen, 0, 320, 0, 200);
-		_vm->markRectAsDirty(kVerbVirtScreen, 0, 320, 0, 200);
-		_vm->markRectAsDirty(kMainVirtScreen, 0, 320, 0, 200);
+	case 500: // Voice Only
+		_vm->_voiceMode = 0;
+		_vm->_v5VoiceMode = 0;
+		_vm->syncSoundSettings();
+		return true;
+	case 501: // Text Only
+		_vm->_voiceMode = 2;
+		_vm->_v5VoiceMode = 2;
+		_vm->syncSoundSettings();
+		return true;
+	case 502: // Voice and Text
+		_vm->_voiceMode = 1;
+		_vm->_v5VoiceMode = 1;
+		_vm->syncSoundSettings();
 		return true;
 	}
 
@@ -475,6 +484,28 @@ void MacGuiImpl::updateWindowManager() {
 		menu->getSubMenuItem(windowMenu, 5)->enabled = false;
 
 		menu->getSubMenuItem(windowMenu, 7)->checked = _vm->_useMacGraphicsSmoothing;
+
+		Graphics::MacMenuItem *speechMenu = menu->getMenuItem("Speech");
+
+		if (speechMenu) {
+			menu->getSubMenuItem(speechMenu, 0)->checked = false; // Voice Only
+			menu->getSubMenuItem(speechMenu, 1)->checked = false; // Text Only
+			menu->getSubMenuItem(speechMenu, 2)->checked = false; // Voice and Text
+
+			switch (_vm->_voiceMode) {
+			case 0: // Voice Only
+				menu->getSubMenuItem(speechMenu, 0)->checked = true;
+				break;
+			case 1: // Voice and Text
+				menu->getSubMenuItem(speechMenu, 2)->checked = true;
+				break;
+			case 2: // Text Only
+				menu->getSubMenuItem(speechMenu, 1)->checked = true;
+				break;
+			default:
+				warning("MacGuiImpl::updateWindowManager(): Invalid voice mode");
+			}
+		}
 	}
 
 	_menuIsActive = isActive;
diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index 763195fb511..c42c884115b 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -147,7 +147,7 @@ bool MacMI1Gui::getFontParams(FontId fontId, int &id, int &size, int &slant) con
 void MacMI1Gui::setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) {
 	if (_vm->_game.id == GID_MONKEY) {
 		_windowManager->replaceCursor(Graphics::MacGUIConstants::kMacCursorArrow);
-	} else {
+	} else if (_vm->_game.version == 5) {
 		Common::MacResManager resource;
 		Graphics::MacCursor macCursor;
 
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index ce3037d3072..7c98e8b3354 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -193,6 +193,13 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 		}
 	}
 
+	if (_game.platform == Common::kPlatformMacintosh) {
+		ConfMan.registerDefault("mac_graphics_smoothing", true);
+		if (ConfMan.hasKey("mac_graphics_smoothing", _targetName)) {
+			_useMacGraphicsSmoothing = ConfMan.getBool("mac_graphics_smoothing");
+		}
+	}
+
 	setTimerAndShakeFrequency();
 
 	camera.reset();
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index d11dd3eedd0..d83361cd0a5 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1454,6 +1454,7 @@ protected:
 	void mac_blitEPXImage(const byte *buffer, int pitch, int x, int y, int width, int height);
 	void mac_applyEPXToBuffer(const byte *inputBuffer, byte *outputBuffer, int width, int height, int inputPitch, int outputPitch, int xOffset, int yOffset, int bufferWidth, int bufferHeight);
 	void mac_scaleCursor(byte *&outCursor, int &outHotspotX, int &outHotspotY, int &outWidth, int &outHeight);
+	void mac_toggleSmoothing();
 
 	Common::KeyState mac_showOldStyleBannerAndPause(const char *msg, int32 waitTime);
 


Commit: 469ff7e63ceb7e99f3c66798203e73368984d36f
    https://github.com/scummvm/scummvm/commit/469ff7e63ceb7e99f3c66798203e73368984d36f
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Add initial version of MI1 Mac About dialog

Our PICT loader currently can't handle the graphics resources, but all
the texts and timing should be in place.

Changed paths:
    engines/scumm/macgui/macgui_dialogwindow.cpp
    engines/scumm/macgui/macgui_impl.h
    engines/scumm/macgui/macgui_mi1.cpp
    engines/scumm/macgui/macgui_mi1.h


diff --git a/engines/scumm/macgui/macgui_dialogwindow.cpp b/engines/scumm/macgui/macgui_dialogwindow.cpp
index 276d19f5e4d..a17a584183e 100644
--- a/engines/scumm/macgui/macgui_dialogwindow.cpp
+++ b/engines/scumm/macgui/macgui_dialogwindow.cpp
@@ -346,11 +346,18 @@ void MacGuiImpl::MacDialogWindow::drawDottedHLine(int x0, int y, int x1) {
 		s->setPixel(x, y, color[x & 1]);
 }
 
-void MacGuiImpl::MacDialogWindow::fillPattern(Common::Rect r, uint16 pattern) {
+void MacGuiImpl::MacDialogWindow::fillPattern(Common::Rect r, uint16 pattern, bool fillBlack, bool fillWhite) {
 	for (int y = r.top; y < r.bottom; y++) {
 		for (int x = r.left; x < r.right; x++) {
 			int bit = 0x8000 >> (4 * (y % 4) + (x % 4));
-			_innerSurface.setPixel(x, y, (pattern & bit) ? kBlack : kWhite);
+
+			if (pattern & bit) {
+				if (fillBlack)
+					_innerSurface.setPixel(x, y, kBlack);
+			} else {
+				if (fillWhite)
+					_innerSurface.setPixel(x, y, kWhite);
+			}
 		}
 	}
 
@@ -709,6 +716,12 @@ void MacGuiImpl::MacDialogWindow::drawTexts(Common::Rect r, const TextLine *line
 			f1 = _gui->getFont(kAboutFontHeaderOutside);
 			f2 = _gui->getFont(kAboutFontHeaderInside);
 			break;
+		case kStyleHeaderSimple1:
+			f1 = _gui->getFont(kAboutFontHeaderSimple1);
+			break;
+		case kStyleHeaderSimple2:
+			f1 = _gui->getFont(kAboutFontHeaderSimple2);
+			break;
 		case kStyleBold:
 			f1 = _gui->getFont(kAboutFontBold);
 			break;
diff --git a/engines/scumm/macgui/macgui_impl.h b/engines/scumm/macgui/macgui_impl.h
index e437ade61b8..695fba0abca 100644
--- a/engines/scumm/macgui/macgui_impl.h
+++ b/engines/scumm/macgui/macgui_impl.h
@@ -106,6 +106,8 @@ protected:
 		kAboutFontExtraBold,
 		kAboutFontHeaderInside,
 		kAboutFontHeaderOutside,
+		kAboutFontHeaderSimple1,
+		kAboutFontHeaderSimple2,
 
 		kIndy3FontSmall,
 		kIndy3FontMedium,
@@ -120,6 +122,8 @@ protected:
 
 	enum TextStyle {
 		kStyleHeader,
+		kStyleHeaderSimple1,
+		kStyleHeaderSimple2,
 		kStyleBold,
 		kStyleExtraBold,
 		kStyleRegular
@@ -654,7 +658,7 @@ public:
 		static void plotPatternDarkenOnly(int x, int y, int pattern, void *data);
 
 		void drawDottedHLine(int x0, int y, int x1);
-		void fillPattern(Common::Rect r, uint16 pattern);
+		void fillPattern(Common::Rect r, uint16 pattern, bool fillBlack = true, bool fillWhite = true);
 		void drawSprite(const Graphics::Surface *sprite, int x, int y);
 		void drawSprite(const Graphics::Surface *sprite, int x, int y, Common::Rect clipRect);
 		void drawTexts(Common::Rect r, const TextLine *lines);
diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index c42c884115b..0fd94e097d6 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -141,7 +141,30 @@ const Graphics::Font *MacMI1Gui::getFontByScummId(int32 id) {
 }
 
 bool MacMI1Gui::getFontParams(FontId fontId, int &id, int &size, int &slant) const {
-	return MacGuiImpl::getFontParams(fontId, id, size, slant);
+	switch (fontId) {
+	case kAboutFontRegular:
+		id = Graphics::kMacFontGeneva;
+		size = 9;
+		slant = Graphics::kMacFontRegular;
+		return true;
+	case kAboutFontBold:
+		id = Graphics::kMacFontGeneva;
+		size = 9;
+		slant = Graphics::kMacFontBold;
+		return true;
+	case kAboutFontHeaderSimple1:
+		id = Graphics::kMacFontGeneva;
+		size = 12;
+		slant = Graphics::kMacFontBold | Graphics::kMacFontItalic | Graphics::kMacFontOutline;
+		return true;
+	case kAboutFontHeaderSimple2:
+		id = Graphics::kMacFontChicago;
+		size = 12;
+		slant = Graphics::kMacFontBold | Graphics::kMacFontItalic | Graphics::kMacFontOutline;
+		return true;
+	default:
+		return MacGuiImpl::getFontParams(fontId, id, size, slant);
+	}
 }
 
 void MacMI1Gui::setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) {
@@ -196,7 +219,267 @@ bool MacMI1Gui::handleMenu(int id, Common::String &name) {
 }
 
 void MacMI1Gui::runAboutDialog() {
-	// TODO
+	switch (_vm->_game.id) {
+	case GID_MONKEY:
+		runAboutDialogMI1();
+		break;
+	case GID_MONKEY2:
+		runAboutDialogMI2();
+		break;
+	case GID_INDY4:
+		runAboutDialogIndy4();
+		break;
+	default:
+		break;
+	}
+}
+
+void MacMI1Gui::runAboutDialogMI1() {
+	int width = 416;
+	int height = 166;
+	int x = (640 - width) / 2;
+	int y = (400 - height) / 2;
+
+	Common::Rect bounds(x, y, x + width, y + height);
+	MacDialogWindow *window = createWindow(bounds);
+//	Graphics::Surface *lucasArts = loadPict(5000);
+//	Graphics::Surface *monkeys = loadPict(5001);
+
+	Graphics::Surface *s = window->innerSurface();
+
+	const TextLine page3[] = {
+		{ 0, 68, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[114].c_str() }, // "PRESENTS"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page12[] = {
+		{ 0, 0, kStyleHeaderSimple1, Graphics::kTextAlignLeft, _strsStrings[115].c_str() }, // "The Secret"
+		{ 87, 13, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[117].c_str() }, // "of"
+		{ 40, 26, kStyleHeaderSimple1, Graphics::kTextAlignLeft, _strsStrings[116].c_str() }, // "Monkey Island(TM)"
+		{ 178, 120, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[118].c_str() }, // "TM & (C) 1990 LucasArts Entertainment Company."
+		{ 312, 133, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[119].c_str() }, // "All rights reserved."
+		TEXT_END_MARKER
+	};
+
+	const TextLine page13[] = {
+		{ 0, 47, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[120].c_str() }, // "Macintosh version by"
+		{ 50, 62, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[121].c_str() }, // "Eric Johnston"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page14[] = {
+		{ 85, 32, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[122].c_str() }, // "Created by"
+		{ 60, 47, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[124].c_str() }, // "Ron Gilbert"
+		{ 39, 70, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[123].c_str() }, // "Macintosh Version Produced by"
+		{ 47, 85, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[125].c_str() }, // "Brenna Holden"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page15[] = {
+		{ 59, 27, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[126].c_str() }, // "SCUMM Story System"
+		{ 85, 37, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[127].c_str() }, // "created by"
+		{ 35, 57, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[129].c_str() }, // "Ron Gilbert"
+		{ 102, 72, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[128].c_str() }, // "and"
+		{ 59, 87, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[130].c_str() }, // "Aric Wilmunder"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page16[] = {
+		{ 29, 37, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[131].c_str() }, // "Stumped? Hint books are available"
+		{ 15, 55, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[134].c_str() }, // "In the U.S. call"
+		{ 89, 55, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[132].c_str() }, // "1 (800) STAR-WARS"
+		{ 89, 65, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[136].c_str() }, // "that's 1 (800)782-7927"
+		{ 19, 85, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[135].c_str() }, // "In Canada call"
+		{ 89, 85, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[133].c_str() }, // "1 (800) 828-7927"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page17[] = {
+		{ 27, 32, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[137].c_str() }, // "Need a hint NOW?  Having problems?"
+		{ 6, 47, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[140].c_str() }, // "For technical support call"
+		{ 130, 47, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[138].c_str() }, // "1 (415) 721-3333"
+		{ 62, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[141].c_str() }, // "For hints call"
+		{ 130, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[139].c_str() }, // "1 (900) 740-JEDI"
+		{ 5, 72, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[142].c_str() }, // "The charge for the hint line is 75\xA2 per minute."
+		{ 10, 82, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[143].c_str() }, // "(You must have your parents' permission to"
+		{ 25, 92, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[144].c_str() }, // "call this number if you are under 18.)"
+		TEXT_END_MARKER
+	};
+
+	struct AboutPage {
+		const TextLine *text;
+		int drawArea;
+		uint32 delayMs;
+	};
+
+	AboutPage aboutPages[] = {
+		{ nullptr, 0,  3600 },
+		{ nullptr, 0,   100 },
+		{ nullptr, 0,   100 },
+		{ page3,   0,  2100 },
+		{ nullptr, 0,   300 },
+		{ nullptr, 0,   400 },
+		{ nullptr, 0,   400 },
+		{ nullptr, 0,   300 },
+		{ nullptr, 0,   400 },
+		{ nullptr, 0,   100 },
+		{ nullptr, 0,   100 },
+		{ nullptr, 0,   600 },
+		{ page12,  1,  7000 },
+		{ page13,  2,  4300 },
+		{ page14,  2,  4200 },
+		{ page15,  2,  4200 },
+		{ page16,  2, 14000 },
+		{ page17,  2,     0 }
+	};
+
+	Common::Rect drawAreas[] = {
+		Common::Rect(2, 2, s->w - 2, s->h - 2),
+		Common::Rect(0, 7, s->w, s->h - 2),
+		Common::Rect(176, 10, 394, 144)
+	};
+
+	// We probably can't trust our ellipse drawing function to get pixel
+	// perfect shadows, so at least for now we define our own. Note that
+	// all of the shadows have an even height. The bottom half is just a
+	// mirror of the top half.
+
+	Common::Pair<int, int> shadow1[] = {
+		Common::Pair<int, int>(0, 10)
+	};
+
+	Common::Pair<int, int> shadow2[] = {
+		Common::Pair<int, int>(4, 21),
+		Common::Pair<int, int>(0, 30)
+	};
+
+	Common::Pair<int, int> shadow3[] = {
+		Common::Pair<int, int>(13, 34),
+		Common::Pair<int, int>(4, 52),
+		Common::Pair<int, int>(0, 60),
+	};
+
+	Common::Pair<int, int> shadow4[] = {
+		Common::Pair<int, int>(25, 50),
+		Common::Pair<int, int>(10, 80),
+		Common::Pair<int, int>(3, 94),
+		Common::Pair<int, int>(0, 100)
+	};
+
+	Common::Pair<int, int> shadow5[] = {
+		Common::Pair<int, int>(41, 67),
+		Common::Pair<int, int>(21, 108),
+		Common::Pair<int, int>(10, 130),
+		Common::Pair<int, int>(3, 144),
+		Common::Pair<int, int>(0, 150)
+	};
+
+	bool allowMegaSkip = false;
+	bool megaSkip = false;
+	int page = 0;
+
+	window->show();
+
+	while (!_vm->shouldQuit() && page < ARRAYSIZE(aboutPages)) {
+		Common::Rect &drawArea = drawAreas[aboutPages[page].drawArea];
+
+		switch (page) {
+		case 0:
+			s->fillRect(drawArea, kBlack);
+			break;
+		case 1:
+			window->fillPattern(drawArea, 0xD7D7, false, true);
+			break;
+		case 2:
+			s->fillRect(drawArea, kWhite);
+			break;
+		case 4:
+			allowMegaSkip = true;
+			s->fillRect(drawArea, kWhite);
+			drawShadow(s, 77, 141, 2 * ARRAYSIZE(shadow1), shadow1);
+			break;
+		case 5:
+			drawShadow(s, 67, 140, 2 * ARRAYSIZE(shadow2), shadow2);
+			break;
+		case 6:
+			drawShadow(s, 52, 139, 2 * ARRAYSIZE(shadow3), shadow3);
+			break;
+		case 7:
+			drawShadow(s, 32, 138, 2 * ARRAYSIZE(shadow4), shadow4);
+			break;
+		case 8:
+			drawShadow(s, 7, 137, 2 * ARRAYSIZE(shadow5), shadow5);
+			break;
+		case 9:
+			// Monkeys
+			break;
+		case 10:
+			// Monkeys
+			break;
+		case 11:
+			// Monkeys (shadow still barely visible)
+			allowMegaSkip = megaSkip = false;
+			break;
+		case 13:
+			s->fillRect(Common::Rect(178, 127, s->w, s->h), kWhite);
+			window->markRectAsDirty(Common::Rect(178, 127, s->w, s->h));
+			break;
+		default:
+			break;
+		}
+
+		if (aboutPages[page].text) {
+			if (aboutPages[page].drawArea == 2) {
+				window->drawTextBox(drawArea, aboutPages[page].text);
+			} else {
+				s->fillRect(drawArea, kWhite);
+				window->drawTexts(drawArea, aboutPages[page].text);
+			}
+		}
+
+		if (aboutPages[page].drawArea != 2)
+			window->markRectAsDirty(drawArea);
+
+		window->update();
+
+		uint32 ms = megaSkip ? 100 : aboutPages[page].delayMs;
+
+		if (delay(ms) == kDelayInterrupted && allowMegaSkip)
+			megaSkip = true;
+
+		page++;
+	}
+
+//	delete lucasArts;
+//	delete monkeys;
+	delete window;
+}
+
+void MacMI1Gui::drawShadow(Graphics::Surface *s, int x, int y, int h, Common::Pair<int, int> *drawData) {
+	int y1 = y;
+	int y2 = y + h - 1;
+
+	for (int i = 0; i < h / 2; i++) {
+		int x1 = x + drawData[i].first;
+		for (int j = 0; j < drawData[i].second; j++) {
+			if ((x1 + y1) & 1) {
+				s->setPixel(x1, y1, kWhite);
+				s->setPixel(x1, y2, kBlack);
+			} else {
+				s->setPixel(x1, y1, kBlack);
+				s->setPixel(x1, y2, kWhite);
+			}
+			x1++;
+		}
+		y1++;
+		y2--;
+	}
+}
+
+void MacMI1Gui::runAboutDialogMI2() {
+}
+
+void MacMI1Gui::runAboutDialogIndy4() {
 }
 
 // A standard file picker dialog doesn't really make sense in ScummVM, so we
diff --git a/engines/scumm/macgui/macgui_mi1.h b/engines/scumm/macgui/macgui_mi1.h
index 54cc83ba1b5..f29a18e9ff2 100644
--- a/engines/scumm/macgui/macgui_mi1.h
+++ b/engines/scumm/macgui/macgui_mi1.h
@@ -57,6 +57,13 @@ protected:
 	bool runOptionsDialog();
 
 	void readStrings() override;
+
+private:
+	void runAboutDialogMI1();
+	void runAboutDialogMI2();
+	void runAboutDialogIndy4();
+
+	void drawShadow(Graphics::Surface *s, int x, int y, int h, Common::Pair<int, int> *drawData);
 };
 
 } // End of namespace Scumm


Commit: 9067c96f5445841857b2b6d871e924923bd54462
    https://github.com/scummvm/scummvm/commit/9067c96f5445841857b2b6d871e924923bd54462
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Fix switch fallthrough

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 03811d8cda7..fc9aee3abfc 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -379,6 +379,7 @@ bool MacGuiImpl::handleMenu(int id, Common::String &name) {
 
 	case 405: // Graphics Smoothing
 		_vm->mac_toggleSmoothing();
+		return true;
 
 	case 500: // Voice Only
 		_vm->_voiceMode = 0;


Commit: 679d3eab255ee433c69f6be095b6cf6a76cb66f2
    https://github.com/scummvm/scummvm/commit/679d3eab255ee433c69f6be095b6cf6a76cb66f2
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
IMAGE: PICT: Add opcodes PnPat, ShortLine, ShortLineFrom

Changed paths:
    image/pict.cpp
    image/pict.h


diff --git a/image/pict.cpp b/image/pict.cpp
index 9d72ee89182..feb7493e612 100644
--- a/image/pict.cpp
+++ b/image/pict.cpp
@@ -63,10 +63,13 @@ void PICTDecoder::setupOpcodesCommon() {
 	OPCODE(0x0003, o_txFont, "TxFont");
 	OPCODE(0x0004, o_txFace, "TxFace");
 	OPCODE(0x0007, o_pnSize, "PnSize");
+	OPCODE(0x0009, o_pnPat, "PnPat");
 	OPCODE(0x000D, o_txSize, "TxSize");
 	OPCODE(0x0010, o_txRatio, "TxRatio");
 	OPCODE(0x0011, o_versionOp, "VersionOp");
 	OPCODE(0x001E, o_nop, "DefHilite");
+	OPCODE(0x0022, o_shortLine, "ShortLine");
+	OPCODE(0x0023, o_shortLineFrom, "ShortLineFrom");
 	OPCODE(0x0028, o_longText, "LongText");
 	OPCODE(0x0091, o_bitsRgn, "BitsRgn");
 	OPCODE(0x0099, o_packBitsRgn, "PackBitsRgn");
@@ -132,6 +135,12 @@ void PICTDecoder::o_pnSize(Common::SeekableReadStream &stream) {
 	stream.readUint16BE();
 }
 
+void PICTDecoder::o_pnPat(Common::SeekableReadStream &stream) {
+	for (int i = 0; i < 8; i++) {
+		_penPattern[i] = stream.readByte();
+	}
+}
+
 void PICTDecoder::o_txSize(Common::SeekableReadStream &stream) {
 	// Ignore
 	stream.readUint16BE();
@@ -157,6 +166,48 @@ void PICTDecoder::o_versionOp1(Common::SeekableReadStream& stream) {
 	_version = 1;
 }
 
+void PICTDecoder::o_shortLine(Common::SeekableReadStream &stream) {
+	// Read the pen location (pnLoc)
+	int16 pnLocX = stream.readSint16BE();
+	int16 pnLocY = stream.readSint16BE();
+
+	// Update the current pen position
+	_currentPenPosition.x = pnLocX;
+	_currentPenPosition.y = pnLocY;
+
+	// Read the relative coordinates for the end of the line (dh, dv)
+	int8 dh = stream.readByte(); // Delta horizontal
+	int8 dv = stream.readByte(); // Delta vertical
+
+	// Calculate the end position of the line
+	int16 endX = pnLocX + dh;
+	int16 endY = pnLocY + dv;
+
+	// Draw the line from the current pen location to the new position
+	//drawLine(pnLocX, pnLocY, endX, endY);
+
+	// Update the pen position
+	_currentPenPosition.x = endX;
+	_currentPenPosition.y = endY;
+}
+
+void PICTDecoder::o_shortLineFrom(Common::SeekableReadStream &stream) {
+	// Read the relative coordinates (dh, dv)
+	int8 dh = stream.readByte(); // Delta horizontal
+	int8 dv = stream.readByte(); // Delta vertical
+
+	// Calculate the new pen position
+	int16 newX = _currentPenPosition.x + dh;
+	int16 newY = _currentPenPosition.y + dv;
+
+	// Draw the line from the current pen position to the new position
+	//drawLine(_currentPenPosition.x, _currentPenPosition.y, newX, newY);
+
+	// Update the pen position
+	_currentPenPosition.x = newX;
+	_currentPenPosition.y = newY;
+}
+
 void PICTDecoder::o_longText(Common::SeekableReadStream &stream) {
 	// Ignore
 	stream.readUint16BE();
diff --git a/image/pict.h b/image/pict.h
index 1a3c86bde12..29b8cb9c8cd 100644
--- a/image/pict.h
+++ b/image/pict.h
@@ -91,6 +91,8 @@ private:
 	Common::Rect _imageRect;
 	byte _palette[256 * 3];
 	uint16 _paletteColorCount;
+	byte _penPattern[8];
+	Common::Point _currentPenPosition;
 	Graphics::Surface *_outputSurface;
 	bool _continueParsing;
 	int _version;
@@ -122,9 +124,12 @@ private:
 	DECLARE_OPCODE(o_txFont);
 	DECLARE_OPCODE(o_txFace);
 	DECLARE_OPCODE(o_pnSize);
+	DECLARE_OPCODE(o_pnPat);
 	DECLARE_OPCODE(o_txSize);
 	DECLARE_OPCODE(o_txRatio);
 	DECLARE_OPCODE(o_versionOp);
+	DECLARE_OPCODE(o_shortLine);
+	DECLARE_OPCODE(o_shortLineFrom);
 	DECLARE_OPCODE(o_longText);
 	DECLARE_OPCODE(o_bitsRgn);
 	DECLARE_OPCODE(o_packBitsRgn);


Commit: 94ffe0916813f64d13e40a57d18060e48137fc8a
    https://github.com/scummvm/scummvm/commit/94ffe0916813f64d13e40a57d18060e48137fc8a
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Remove most hard-coded blacks and whites from common code

Only 16 color games will be allowed to refer to the hard-coded colors.
This is a first step towards eliminating them from the code that's also
used by 256 color games.

Changed paths:
    engines/scumm/macgui/macgui_dialogwindow.cpp
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/macgui/macgui_impl.h
    engines/scumm/macgui/macgui_mi1.cpp
    engines/scumm/macgui/macgui_widgets.cpp


diff --git a/engines/scumm/macgui/macgui_dialogwindow.cpp b/engines/scumm/macgui/macgui_dialogwindow.cpp
index a17a584183e..289e16e6175 100644
--- a/engines/scumm/macgui/macgui_dialogwindow.cpp
+++ b/engines/scumm/macgui/macgui_dialogwindow.cpp
@@ -40,6 +40,9 @@ namespace Scumm {
 // ---------------------------------------------------------------------------
 
 MacGuiImpl::MacDialogWindow::MacDialogWindow(MacGuiImpl *gui, OSystem *system, Graphics::Surface *from, Common::Rect bounds, MacDialogWindowStyle style) : _gui(gui), _system(system), _from(from), _bounds(bounds) {
+	_black = _gui->getBlack();
+	_white = _gui->getWhite();
+
 	_pauseToken = _gui->_vm->pauseEngine();
 
 	// Remember if the screen was shaking. We don't use the SCUMM engine's
@@ -65,7 +68,7 @@ MacGuiImpl::MacDialogWindow::MacDialogWindow(MacGuiImpl *gui, OSystem *system, G
 	Common::Rect r = Common::Rect(s->w, s->h);
 
 	r.grow(-1);
-	s->fillRect(r, kWhite);
+	s->fillRect(r, _white);
 
 	if (style == kStyleNormal) {
 		int growths[] = { 1, -3, -1 };
@@ -73,23 +76,23 @@ MacGuiImpl::MacDialogWindow::MacDialogWindow(MacGuiImpl *gui, OSystem *system, G
 		for (int i = 0; i < ARRAYSIZE(growths); i++) {
 			r.grow(growths[i]);
 
-			s->hLine(r.left, r.top, r.right - 1, kBlack);
-			s->hLine(r.left, r.bottom - 1, r.right - 1, kBlack);
-			s->vLine(r.left, r.top + 1, r.bottom - 2, kBlack);
-			s->vLine(r.right - 1, r.top + 1, r.bottom - 2, kBlack);
+			s->hLine(r.left, r.top, r.right - 1, _black);
+			s->hLine(r.left, r.bottom - 1, r.right - 1, _black);
+			s->vLine(r.left, r.top + 1, r.bottom - 2, _black);
+			s->vLine(r.right - 1, r.top + 1, r.bottom - 2, _black);
 		}
 	} else if (style == kStyleRounded) {
 		r.grow(1);
 
 		for (int i = 0; i < 2; i++) {
-			s->hLine(r.left + 2, r.top, r.right - 3, kBlack);
-			s->hLine(r.left + 2, r.bottom - 1, r.right - 3, kBlack);
-			s->vLine(r.left, r.top + 2, r.bottom - 3, kBlack);
-			s->vLine(r.right - 1, r.top + 2, r.bottom - 3, kBlack);
-			s->setPixel(r.left + 1, r.top + 1, kBlack);
-			s->setPixel(r.left + 1, r.bottom - 2, kBlack);
-			s->setPixel(r.right - 2, r.top + 1, kBlack);
-			s->setPixel(r.right - 2, r.bottom - 2, kBlack);
+			s->hLine(r.left + 2, r.top, r.right - 3, _black);
+			s->hLine(r.left + 2, r.bottom - 1, r.right - 3, _black);
+			s->vLine(r.left, r.top + 2, r.bottom - 3, _black);
+			s->vLine(r.right - 1, r.top + 2, r.bottom - 3, _black);
+			s->setPixel(r.left + 1, r.top + 1, _black);
+			s->setPixel(r.left + 1, r.bottom - 2, _black);
+			s->setPixel(r.right - 2, r.top + 1, _black);
+			s->setPixel(r.right - 2, r.bottom - 2, _black);
 			r.grow(-2);
 		}
 	}
@@ -256,7 +259,7 @@ void MacGuiImpl::MacDialogWindow::drawBeamCursor() {
 		else if (color > kCustomColor && color <= kCustomColor + 15)
 			color = kCustomColor + 15 - color;
 		else
-			color = kBlack;
+			color = _black;
 
 		_beamCursor->setPixel(beam[i], beam[i + 1], color);
 	}
@@ -332,11 +335,11 @@ void MacGuiImpl::MacDialogWindow::update(bool fullRedraw) {
 void MacGuiImpl::MacDialogWindow::drawDottedHLine(int x0, int y, int x1) {
 	Graphics::Surface *s = innerSurface();
 
-	Color color[2];
+	uint32 color[2];
 
 	if (_gui->_vm->_renderMode == Common::kRenderMacintoshBW) {
-		color[0] = kBlack;
-		color[1] = kWhite;
+		color[0] = _black;
+		color[1] = _white;
 	} else {
 		color[0] = kDarkGray;
 		color[1] = kLightGray;
@@ -353,10 +356,10 @@ void MacGuiImpl::MacDialogWindow::fillPattern(Common::Rect r, uint16 pattern, bo
 
 			if (pattern & bit) {
 				if (fillBlack)
-					_innerSurface.setPixel(x, y, kBlack);
+					_innerSurface.setPixel(x, y, _black);
 			} else {
 				if (fillWhite)
-					_innerSurface.setPixel(x, y, kWhite);
+					_innerSurface.setPixel(x, y, _white);
 			}
 		}
 	}
@@ -684,9 +687,9 @@ void MacGuiImpl::MacDialogWindow::plotPattern(int x, int y, int pattern, void *d
 	Graphics::Surface *s = window->innerSurface();
 	int bit = 0x8000 >> (4 * (y % 4) + (x % 4));
 	if (patterns[pattern] & bit)
-		s->setPixel(x, y, kBlack);
+		s->setPixel(x, y, window->_gui->getBlack());
 	else
-		s->setPixel(x, y, kWhite);
+		s->setPixel(x, y, window->_gui->getWhite());
 }
 
 void MacGuiImpl::MacDialogWindow::plotPatternDarkenOnly(int x, int y, int pattern, void *data) {
@@ -698,7 +701,7 @@ void MacGuiImpl::MacDialogWindow::plotPatternDarkenOnly(int x, int y, int patter
 	Graphics::Surface *s = window->innerSurface();
 	int bit = 0x8000 >> (4 * (y % 4) + (x % 4));
 	if (patterns[pattern] & bit)
-		s->setPixel(x, y, kBlack);
+		s->setPixel(x, y, window->_gui->getBlack());
 }
 
 void MacGuiImpl::MacDialogWindow::drawTexts(Common::Rect r, const TextLine *lines) {
@@ -740,22 +743,22 @@ void MacGuiImpl::MacDialogWindow::drawTexts(Common::Rect r, const TextLine *line
 		int width = r.right - x;
 
 		if (lines[i].style == kStyleHeader) {
-			f1->drawString(s, msg, x - 1, y + 1, width, kBlack, align);
-			f2->drawString(s, msg, x + 1, y + 1, width, kBlack, align);
-			f1->drawString(s, msg, x - 2, y, width, kBlack, align);
-			f2->drawString(s, msg, x, y, width, kWhite, align);
+			f1->drawString(s, msg, x - 1, y + 1, width, _black, align);
+			f2->drawString(s, msg, x + 1, y + 1, width, _black, align);
+			f1->drawString(s, msg, x - 2, y, width, _black, align);
+			f2->drawString(s, msg, x, y, width, _white, align);
 		} else {
-			f1->drawString(s, msg, x, y, width, kBlack, align);
+			f1->drawString(s, msg, x, y, width, _black, align);
 
 			if (lines[i].style == kStyleExtraBold)
-				f1->drawString(s, msg, x + 1, y, width, kBlack, align);
+				f1->drawString(s, msg, x + 1, y, width, _black, align);
 		}
 	}
 }
 
 void MacGuiImpl::MacDialogWindow::drawTextBox(Common::Rect r, const TextLine *lines, int arc) {
-	Graphics::drawRoundRect(r, arc, kWhite, true, plotPixel, this);
-	Graphics::drawRoundRect(r, arc, kBlack, false, plotPixel, this);
+	Graphics::drawRoundRect(r, arc, _white, true, plotPixel, this);
+	Graphics::drawRoundRect(r, arc, _black, false, plotPixel, this);
 	markRectAsDirty(r);
 
 	drawTexts(r, lines);
diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index fc9aee3abfc..11f4a854a3d 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -65,6 +65,14 @@ MacGuiImpl::~MacGuiImpl() {
 	delete _windowManager;
 }
 
+uint32 MacGuiImpl::getBlack() const {
+	return _windowManager->_colorBlack;
+}
+
+uint32 MacGuiImpl::getWhite() const {
+	return _windowManager->_colorWhite;
+}
+
 Common::String MacGuiImpl::readCString(uint8 *&data) {
 	Common::String result(reinterpret_cast<const char *>(data));
 	data += result.size() + 1;
@@ -402,6 +410,8 @@ bool MacGuiImpl::handleMenu(int id, Common::String &name) {
 }
 
 void MacGuiImpl::updateWindowManager() {
+
+
 	Graphics::MacMenu *menu = _windowManager->getMenu();
 
 	if (!menu)
@@ -688,6 +698,8 @@ Common::String MacGuiImpl::getDialogString(Common::SeekableReadStream *res, int
 }
 
 MacGuiImpl::MacDialogWindow *MacGuiImpl::createDialog(int dialogId) {
+	uint32 black = getBlack();
+
 	Common::MacResManager resource;
 	Common::SeekableReadStream *res;
 
@@ -775,7 +787,7 @@ MacGuiImpl::MacDialogWindow *MacGuiImpl::createDialog(int dialogId) {
 				// Skip drive label box and listbox
 				bool doNotDraw = (isOpenDialog && (i == 6 || i == 7)) || ((isOpenDialog || isSaveDialog) && i == 3);
 				if (!doNotDraw) {
-					window->innerSurface()->frameRect(r, kBlack);
+					window->innerSurface()->frameRect(r, black);
 				} else if (_vm->_game.id == GID_INDY3 && i == 3) {
 					drawFakeDriveLabel(window, Common::Rect(r.left + 9, r.top, r.right, r.bottom), _hardDriveIcon, "ScummVM", Graphics::kTextAlignLeft);
 				}
@@ -816,7 +828,7 @@ MacGuiImpl::MacDialogWindow *MacGuiImpl::createDialog(int dialogId) {
 				MacGuiImpl::MacEditText *editText = window->addEditText(r, gameFileResStr, enabled);
 				editText->selectAll();
 
-				window->innerSurface()->frameRect(Common::Rect(r.left - 2, r.top - 3, r.right + 3, r.bottom + 3), kBlack);
+				window->innerSurface()->frameRect(Common::Rect(r.left - 2, r.top - 3, r.right + 3, r.bottom + 3), black);
 				res->skip(len);
 				break;
 			}
@@ -909,6 +921,8 @@ bool MacGuiImpl::runOkCancelDialog(Common::String text) {
 }
 
 void MacGuiImpl::drawFakePathList(MacDialogWindow *window, Common::Rect r, byte *icon, const char *text, Graphics::TextAlign alignment) {
+	uint32 black = getBlack();
+
 	// Draw the text...
 	window->addStaticText(Common::Rect(r.left + 22, r.top + 2, r.right - 21, r.bottom - 1), text, true, alignment);
 
@@ -927,11 +941,11 @@ void MacGuiImpl::drawFakePathList(MacDialogWindow *window, Common::Rect r, byte
 	delete arrowSurf;
 
 	// Draw the black frame...
-	window->innerSurface()->frameRect(r, kBlack);
+	window->innerSurface()->frameRect(r, black);
 
 	// Draw the shadows...
-	window->innerSurface()->hLine(r.left + 3, r.bottom, r.right, kBlack);
-	window->innerSurface()->vLine(r.right, r.top + 3, r.bottom, kBlack);
+	window->innerSurface()->hLine(r.left + 3, r.bottom, r.right, black);
+	window->innerSurface()->vLine(r.right, r.top + 3, r.bottom, black);
 }
 
 void MacGuiImpl::drawFakeDriveLabel(MacDialogWindow *window, Common::Rect r, byte *icon, const char *text, Graphics::TextAlign alignment) {
@@ -990,7 +1004,7 @@ void MacGuiImpl::drawBanner(char *message) {
 	const Graphics::Font *font = getFont(_vm->_game.id == GID_INDY3 ? kIndy3FontMedium : kLoomFontMedium);
 
 	Graphics::Surface *s = _bannerWindow->innerSurface();
-	font->drawString(s, (char *)message, 0, 0, s->w, kBlack, Graphics::kTextAlignCenter);
+	font->drawString(s, (char *)message, 0, 0, s->w, getBlack(), Graphics::kTextAlignCenter);
 
 	_bannerWindow->show();
 }
@@ -1002,7 +1016,7 @@ void MacGuiImpl::undrawBanner() {
 	}
 }
 
-void MacGuiImpl::drawBitmap(Graphics::Surface *s, Common::Rect r, const uint16 *bitmap, Color color) const {
+void MacGuiImpl::drawBitmap(Graphics::Surface *s, Common::Rect r, const uint16 *bitmap, uint32 color) const {
 	assert(r.width() <= 16);
 
 	for (int y = 0; y < r.height(); y++) {
diff --git a/engines/scumm/macgui/macgui_impl.h b/engines/scumm/macgui/macgui_impl.h
index 695fba0abca..0e3edb1ae10 100644
--- a/engines/scumm/macgui/macgui_impl.h
+++ b/engines/scumm/macgui/macgui_impl.h
@@ -73,6 +73,9 @@ protected:
 		kDelayAborted
 	};
 
+	// Colors used by the 16 color Mac games. Nothing that is ever drawn by
+	// 256 color games should use these!
+
 	enum Color {
 		kBlack = 0,
 		kBlue = 1,
@@ -243,6 +246,9 @@ public:
 	class MacWidget : public MacGuiObject {
 	protected:
 		MacGuiImpl::MacDialogWindow *_window;
+		uint32 _black;
+		uint32 _white;
+
 		int _id = -1;
 
 		bool _fullRedraw = false;
@@ -250,8 +256,8 @@ public:
 		Common::String _text;
 		int _value = 0;
 
-		int drawText(Common::String text, int x, int y, int w, Color fg = kBlack, Color bg = kWhite, Graphics::TextAlign align = Graphics::kTextAlignLeft, bool wordWrap = false, int deltax = 0) const;
-		void drawBitmap(Common::Rect r, const uint16 *bitmap, Color color) const;
+		int drawText(Common::String text, int x, int y, int w, uint32 fg = 0, uint32 bg = 0, Graphics::TextAlign align = Graphics::kTextAlignLeft, bool wordWrap = false, int deltax = 0) const;
+		void drawBitmap(Common::Rect r, const uint16 *bitmap, uint32 color) const;
 
 	public:
 		MacWidget(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, Common::String text, bool enabled);
@@ -329,8 +335,8 @@ public:
 
 	class MacStaticText : public MacWidget {
 	private:
-		Color _fg = kBlack;
-		Color _bg = kWhite;
+		uint32 _fg;
+		uint32 _bg;
 		Graphics::TextAlign _alignment = Graphics::kTextAlignLeft;
 		bool _wordWrap = false;
 
@@ -340,6 +346,8 @@ public:
 			Common::Rect bounds, Common::String text,
 			bool enabled, Graphics::TextAlign alignment = Graphics::kTextAlignLeft) : MacWidget(window, bounds, text, true) {
 			_alignment = alignment;
+			_fg = _black;
+			_bg = _white;
 		}
 
 		void getFocus() {}
@@ -354,7 +362,7 @@ public:
 			}
 		}
 
-		void setColor(Color fg, Color bg) {
+		void setColor(uint32 fg, uint32 bg) {
 			if (fg != _fg || bg != _bg) {
 				_fg = fg;
 				_bg = bg;
@@ -559,6 +567,9 @@ public:
 
 	class MacDialogWindow {
 	private:
+		uint32 _black;
+		uint32 _white;
+
 		bool _shakeWasEnabled;
 
 		Common::Rect _bounds;
@@ -672,6 +683,8 @@ public:
 	bool _forceMenuClosed = false;
 
 	Graphics::Surface *surface() { return _surface; }
+	uint32 getBlack() const;
+	uint32 getWhite() const;
 
 	virtual const Common::String name() const = 0;
 
@@ -712,7 +725,7 @@ public:
 	void drawBanner(char *message);
 	void undrawBanner();
 
-	void drawBitmap(Graphics::Surface *s, Common::Rect r, const uint16 *bitmap, Color color) const;
+	void drawBitmap(Graphics::Surface *s, Common::Rect r, const uint16 *bitmap, uint32 color) const;
 };
 
 } // End of namespace Scumm
diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index 0fd94e097d6..600362a4496 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -378,6 +378,9 @@ void MacMI1Gui::runAboutDialogMI1() {
 	bool megaSkip = false;
 	int page = 0;
 
+	uint32 black = getBlack();
+	uint32 white = getWhite();
+
 	window->show();
 
 	while (!_vm->shouldQuit() && page < ARRAYSIZE(aboutPages)) {
@@ -385,17 +388,17 @@ void MacMI1Gui::runAboutDialogMI1() {
 
 		switch (page) {
 		case 0:
-			s->fillRect(drawArea, kBlack);
+			s->fillRect(drawArea, black);
 			break;
 		case 1:
 			window->fillPattern(drawArea, 0xD7D7, false, true);
 			break;
 		case 2:
-			s->fillRect(drawArea, kWhite);
+			s->fillRect(drawArea, white);
 			break;
 		case 4:
 			allowMegaSkip = true;
-			s->fillRect(drawArea, kWhite);
+			s->fillRect(drawArea, white);
 			drawShadow(s, 77, 141, 2 * ARRAYSIZE(shadow1), shadow1);
 			break;
 		case 5:
@@ -421,7 +424,7 @@ void MacMI1Gui::runAboutDialogMI1() {
 			allowMegaSkip = megaSkip = false;
 			break;
 		case 13:
-			s->fillRect(Common::Rect(178, 127, s->w, s->h), kWhite);
+			s->fillRect(Common::Rect(178, 127, s->w, s->h), white);
 			window->markRectAsDirty(Common::Rect(178, 127, s->w, s->h));
 			break;
 		default:
@@ -432,7 +435,7 @@ void MacMI1Gui::runAboutDialogMI1() {
 			if (aboutPages[page].drawArea == 2) {
 				window->drawTextBox(drawArea, aboutPages[page].text);
 			} else {
-				s->fillRect(drawArea, kWhite);
+				s->fillRect(drawArea, white);
 				window->drawTexts(drawArea, aboutPages[page].text);
 			}
 		}
@@ -459,15 +462,18 @@ void MacMI1Gui::drawShadow(Graphics::Surface *s, int x, int y, int h, Common::Pa
 	int y1 = y;
 	int y2 = y + h - 1;
 
+	uint32 black = getBlack();
+	uint32 white = getWhite();
+
 	for (int i = 0; i < h / 2; i++) {
 		int x1 = x + drawData[i].first;
 		for (int j = 0; j < drawData[i].second; j++) {
 			if ((x1 + y1) & 1) {
-				s->setPixel(x1, y1, kWhite);
-				s->setPixel(x1, y2, kBlack);
+				s->setPixel(x1, y1, white);
+				s->setPixel(x1, y2, black);
 			} else {
-				s->setPixel(x1, y1, kBlack);
-				s->setPixel(x1, y2, kWhite);
+				s->setPixel(x1, y1, black);
+				s->setPixel(x1, y2, white);
 			}
 			x1++;
 		}
@@ -533,6 +539,8 @@ bool MacMI1Gui::runOpenDialog(int &saveSlotToHandle) {
 }
 
 bool MacMI1Gui::runSaveDialog(int &saveSlotToHandle, Common::String &name) {
+	uint32 black = getBlack();
+
 	Common::Rect bounds(110, 27, 470, 231);
 
 	MacDialogWindow *window = createWindow(bounds);
@@ -569,11 +577,11 @@ bool MacMI1Gui::runSaveDialog(int &saveSlotToHandle, Common::String &name) {
 	Graphics::Surface *s = window->innerSurface();
 	const Graphics::Font *font = getFont(kSystemFont);
 
-	s->frameRect(Common::Rect(14, 156, 232, 178), kBlack);
+	s->frameRect(Common::Rect(14, 156, 232, 178), black);
 
 	window->drawDottedHLine(253, 121, 334);
 
-	font->drawString(s, saveGameFileAsResStr, 14, 138, 218, kBlack, Graphics::kTextAlignLeft, 4);
+	font->drawString(s, saveGameFileAsResStr, 14, 138, 218, black, Graphics::kTextAlignLeft, 4);
 
 	window->setDefaultWidget(0);
 	editText->selectAll();
diff --git a/engines/scumm/macgui/macgui_widgets.cpp b/engines/scumm/macgui/macgui_widgets.cpp
index e4914c079d6..391949f38e5 100644
--- a/engines/scumm/macgui/macgui_widgets.cpp
+++ b/engines/scumm/macgui/macgui_widgets.cpp
@@ -39,6 +39,9 @@ namespace Scumm {
 // ---------------------------------------------------------------------------
 
 MacGuiImpl::MacWidget::MacWidget(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, Common::String text, bool enabled) : MacGuiObject(bounds, enabled), _window(window), _text(text) {
+	_black = _window->_gui->getBlack();
+	_white = _window->_gui->getWhite();
+
 	// Widgets are clipped to the inner surface of the dialog. If a widget
 	// is clipped out of existence, make it invisible to avoid crashes.
 
@@ -76,14 +79,19 @@ void MacGuiImpl::MacWidget::setValue(int value) {
 	setRedraw();
 }
 
-void MacGuiImpl::MacWidget::drawBitmap(Common::Rect r, const uint16 *bitmap, Color color) const {
+void MacGuiImpl::MacWidget::drawBitmap(Common::Rect r, const uint16 *bitmap, uint32 color) const {
 	_window->_gui->drawBitmap(_window->innerSurface(), r, bitmap, color);
 }
 
-int MacGuiImpl::MacWidget::drawText(Common::String text, int x, int y, int w, Color fg, Color bg, Graphics::TextAlign align, bool wordWrap, int deltax) const {
+int MacGuiImpl::MacWidget::drawText(Common::String text, int x, int y, int w, uint32 fg, uint32 bg, Graphics::TextAlign align, bool wordWrap, int deltax) const {
 	if (text.empty())
 		return 0;
 
+	if (fg == 0 && bg == 0) {
+		fg = _black;
+		bg = _white;
+	}
+
 	const Graphics::Font *font = _window->_gui->getFont(kSystemFont);
 
 	// Apply text substitutions
@@ -154,14 +162,14 @@ void MacGuiImpl::MacButton::draw(bool drawFocused) {
 	CornerLine frameCorner[] = { { 5, 1 }, { 3, 3 }, { 2, 4 }, { 1, 5 }, { 1, 3 }, { 0, 4 }, { 0, -1 } };
 
 	Graphics::Surface *s = _window->innerSurface();
-	Color fg, bg;
+	uint32 fg, bg;
 
 	if (drawFocused || (_window->getFocusedWidget() == this && _bounds.contains(_window->getMousePos()))) {
-		fg = kWhite;
-		bg = kBlack;
+		fg = _white;
+		bg = _black;
 	} else {
-		fg = kBlack;
-		bg = kWhite;
+		fg = _black;
+		bg = _white;
 	}
 
 	int x0 = _bounds.left;
@@ -181,10 +189,10 @@ void MacGuiImpl::MacButton::draw(bool drawFocused) {
 		cornerSize = 2;
 	}
 
-	s->hLine(x0 + cornerSize, y0, x1 - cornerSize, kBlack);
-	s->hLine(x0 + cornerSize, y1, x1 - cornerSize, kBlack);
-	s->vLine(x0, y0 + cornerSize, y1 - cornerSize, kBlack);
-	s->vLine(x1, y0 + cornerSize, y1 - cornerSize, kBlack);
+	s->hLine(x0 + cornerSize, y0, x1 - cornerSize, _black);
+	s->hLine(x0 + cornerSize, y1, x1 - cornerSize, _black);
+	s->vLine(x0, y0 + cornerSize, y1 - cornerSize, _black);
+	s->vLine(x1, y0 + cornerSize, y1 - cornerSize, _black);
 
 	// The way the corners are rounded, we can fill this entire rectangle
 	// in one go.
@@ -235,12 +243,12 @@ void MacGuiImpl::MacButton::hLine(int x0, int y0, int x1, bool enabled) {
 
 		for (int x = x0; x <= x1; x++) {
 			if (((x + y0) % 2) == 0)
-				s->setPixel(x, y0, kBlack);
+				s->setPixel(x, y0, _black);
 			else
-				s->setPixel(x, y0, kWhite);
+				s->setPixel(x, y0, _white);
 		}
 	} else
-		s->hLine(x0, y0, x1, kBlack);
+		s->hLine(x0, y0, x1, _black);
 }
 
 void MacGuiImpl::MacButton::vLine(int x0, int y0, int y1, bool enabled) {
@@ -252,12 +260,12 @@ void MacGuiImpl::MacButton::vLine(int x0, int y0, int y1, bool enabled) {
 
 		for (int y = y0; y <= y1; y++) {
 			if (((x0 + y) % 2) == 0)
-				s->setPixel(x0, y, kBlack);
+				s->setPixel(x0, y, _black);
 			else
-				s->setPixel(x0, y, kWhite);
+				s->setPixel(x0, y, _white);
 		}
 	} else
-		s->vLine(x0, y0, y1, kBlack);
+		s->vLine(x0, y0, y1, _black);
 }
 
 void MacGuiImpl::MacButton::drawCorners(Common::Rect r, CornerLine *corner, bool enabled) {
@@ -307,10 +315,11 @@ void MacGuiImpl::MacCheckbox::draw(bool drawFocused) {
 	debug(1, "MacGuiImpl::MacCheckbox: Drawing checkbox %d (_fullRedraw = %d, drawFocused = %d, _value = %d)", _id, _fullRedraw, drawFocused, _value);
 
 	Graphics::Surface *s = _window->innerSurface();
+
 	Common::Rect box(_hitBounds.left + 2, _hitBounds.top + 2, _hitBounds.left + 14, _hitBounds.top + 14);
 
 	if (_fullRedraw) {
-		_window->innerSurface()->fillRect(_bounds, kWhite);
+		_window->innerSurface()->fillRect(_bounds, _white);
 
 		int x = _hitBounds.left + 18;
 		int y = _hitBounds.top;
@@ -320,17 +329,17 @@ void MacGuiImpl::MacCheckbox::draw(bool drawFocused) {
 	} else
 		_window->markRectAsDirty(box);
 
-	s->fillRect(box, kBlack);
+	s->fillRect(box, _black);
 	if (drawFocused || (_window->getFocusedWidget() == this && _hitBounds.contains(_window->getMousePos()))) {
 		box.grow(-2);
 	} else {
 		box.grow(-1);
 	}
-	s->fillRect(box, kWhite);
+	s->fillRect(box, _white);
 
 	if (_value && _enabled) {
-		s->drawLine(box.left, box.top, box.right - 1, box.bottom - 1, kBlack);
-		s->drawLine(box.left, box.bottom - 1, box.right - 1, box.top, kBlack);
+		s->drawLine(box.left, box.top, box.right - 1, box.bottom - 1, _black);
+		s->drawLine(box.left, box.bottom - 1, box.right - 1, box.top, _black);
 	}
 
 	_redraw = false;
@@ -503,7 +512,7 @@ void MacGuiImpl::MacEditText::draw(bool drawFocused) {
 	if (_redraw || _fullRedraw) {
 		Graphics::Surface *s = _window->innerSurface();
 
-		s->fillRect(_bounds, kWhite);
+		s->fillRect(_bounds, _white);
 
 		int selectStart = -1;
 		int selectEnd = -1;
@@ -526,7 +535,7 @@ void MacGuiImpl::MacEditText::draw(bool drawFocused) {
 		bool lastCharSelected = false;
 
 		for (int i = 0; i < (int)_text.size() && x < _textSurface.w; i++) {
-			Color color = kBlack;
+			uint32 color = _black;
 			int charWidth = _font->getCharWidth((byte)_text[i]);
 
 			if (x + charWidth >= 0) {
@@ -535,8 +544,8 @@ void MacGuiImpl::MacEditText::draw(bool drawFocused) {
 						firstCharSelected = true;
 					lastCharSelected = true;
 
-					_textSurface.fillRect(Common::Rect(x, 0, x + charWidth, _textSurface.h), kBlack);
-					color = kWhite;
+					_textSurface.fillRect(Common::Rect(x, 0, x + charWidth, _textSurface.h), _black);
+					color = _white;
 				} else
 					lastCharSelected = false;
 
@@ -548,10 +557,10 @@ void MacGuiImpl::MacEditText::draw(bool drawFocused) {
 		}
 
 		if (firstCharSelected)
-			_window->innerSurface()->fillRect(Common::Rect(_bounds.left + 1, _bounds.top, _bounds.left + 2, _bounds.bottom), kBlack);
+			_window->innerSurface()->fillRect(Common::Rect(_bounds.left + 1, _bounds.top, _bounds.left + 2, _bounds.bottom), _black);
 
 		if (lastCharSelected && _bounds.left + x + 1 < _bounds.right)
-			_window->innerSurface()->fillRect(Common::Rect(_bounds.left + x + 1, _bounds.top, _bounds.right, _bounds.bottom), kBlack);
+			_window->innerSurface()->fillRect(Common::Rect(_bounds.left + x + 1, _bounds.top, _bounds.right, _bounds.bottom), _black);
 
 		_window->markRectAsDirty(_bounds);
 	}
@@ -572,14 +581,14 @@ void MacGuiImpl::MacEditText::draw(bool drawFocused) {
 				// Erase the old caret. Not needed if the whole
 				// widget was just redrawn.
 
-				_textSurface.vLine(_caretX, 0, _bounds.bottom - 1, kWhite);
+				_textSurface.vLine(_caretX, 0, _bounds.bottom - 1, _white);
 				if (!_redraw && !_fullRedraw)
 					_window->markRectAsDirty(Common::Rect(_bounds.left + _caretX + 1, _bounds.top, _bounds.left + _caretX + 2, _bounds.bottom));
 			}
 
 			// Draw the new caret
 
-			_textSurface.vLine(caretX, 0, _bounds.bottom - 1, _caretVisible ? kBlack : kWhite);
+			_textSurface.vLine(caretX, 0, _bounds.bottom - 1, _caretVisible ? _black : _white);
 
 			if (!_redraw && !_fullRedraw)
 				_window->markRectAsDirty(Common::Rect(_bounds.left + caretX + 1, _bounds.top, _bounds.left + caretX + 2, _bounds.bottom));
@@ -901,9 +910,9 @@ Common::Rect MacGuiImpl::MacSlider::getHandleRect(int value) {
 }
 
 void MacGuiImpl::MacSlider::fill(Common::Rect r, bool inverted) {
-	Color pattern[2][4] = {
-		{ kWhite, kWhite, kBlack, kWhite },
-		{ kBlack, kWhite, kWhite, kWhite }
+	uint32 pattern[2][4] = {
+		{ _white, _white, _black, _white },
+		{ _black, _white, _white, _white }
 	};
 
 	Graphics::Surface *s = _window->innerSurface();
@@ -915,10 +924,10 @@ void MacGuiImpl::MacSlider::fill(Common::Rect r, bool inverted) {
 				// slider handle while dragging. I think this matches the
 				// original behavior, though I'm not quite sure.
 
-				bool srcPixel = s->getPixel(x, y) == kBlack;
-				bool dstPixel = pattern[y % 2][x % 4] == kWhite;
+				bool srcPixel = s->getPixel(x, y) == _black;
+				bool dstPixel = pattern[y % 2][x % 4] == _white;
 
-				Color color = (srcPixel ^ dstPixel) ? kBlack : kWhite;
+				uint32 color = (srcPixel ^ dstPixel) ? _black : _white;
 
 				s->setPixel(x, y, color);
 			} else
@@ -940,9 +949,9 @@ void MacGuiImpl::MacSlider::draw(bool drawFocused) {
 
 		Graphics::Surface *s = _window->innerSurface();
 
-		s->frameRect(_bounds, kBlack);
-		s->hLine(_bounds.left + 1, _bounds.top + 15, _bounds.right - 2, kBlack);
-		s->hLine(_bounds.left + 1, _bounds.bottom - 16, _bounds.right - 2, kBlack);
+		s->frameRect(_bounds, _black);
+		s->hLine(_bounds.left + 1, _bounds.top + 15, _bounds.right - 2, _black);
+		s->hLine(_bounds.left + 1, _bounds.bottom - 16, _bounds.right - 2, _black);
 
 		drawUpArrow(false);
 		drawDownArrow(false);
@@ -955,7 +964,7 @@ void MacGuiImpl::MacSlider::draw(bool drawFocused) {
 			Common::Rect handleRect = getHandleRect(_value);
 			drawHandle(handleRect);
 		} else
-			s->fillRect(fillRect, kWhite);
+			s->fillRect(fillRect, _white);
 
 		_window->markRectAsDirty(_bounds);
 	}
@@ -1005,8 +1014,8 @@ void MacGuiImpl::MacSlider::drawArrow(Common::Rect r, const uint16 *bitmap, bool
 
 	r.grow(-1);
 
-	s->fillRect(r, kWhite);
-	drawBitmap(Common::Rect(r.left + 1, r.top + 2, r.right - 1, r.top + 12), bitmap, kBlack);
+	s->fillRect(r, _white);
+	drawBitmap(Common::Rect(r.left + 1, r.top + 2, r.right - 1, r.top + 12), bitmap, _black);
 
 	if (markAsDirty)
 		_window->markRectAsDirty(r);
@@ -1023,9 +1032,9 @@ void MacGuiImpl::MacSlider::drawHandle(Common::Rect r) {
 
 	Graphics::Surface *s = _window->innerSurface();
 
-	s->frameRect(r, kBlack);
+	s->frameRect(r, _black);
 	r.grow(-1);
-	s->fillRect(r, kWhite);
+	s->fillRect(r, _white);
 }
 
 void MacGuiImpl::MacSlider::redrawHandle(int oldValue, int newValue) {
@@ -1408,9 +1417,9 @@ void MacGuiImpl::MacListBox::updateTexts() {
 		_textWidgets[i]->setText(_texts[i + offset]);
 
 		if (_textWidgets[i]->isEnabled() && (int)i + offset == _value)
-			_textWidgets[i]->setColor(kWhite, kBlack);
+			_textWidgets[i]->setColor(_white, _black);
 		else
-			_textWidgets[i]->setColor(kBlack, kWhite);
+			_textWidgets[i]->setColor(_black, _white);
 	}
 }
 
@@ -1427,9 +1436,9 @@ void MacGuiImpl::MacListBox::draw(bool drawFocused) {
 
 	Graphics::Surface *s = _window->innerSurface();
 
-	s->hLine(_bounds.left, _bounds.top, _bounds.right - 17, kBlack);
-	s->hLine(_bounds.left, _bounds.bottom - 1, _bounds.right - 17, kBlack);
-	s->vLine(_bounds.left, _bounds.top + 1, _bounds.bottom - 2, kBlack);
+	s->hLine(_bounds.left, _bounds.top, _bounds.right - 17, _black);
+	s->hLine(_bounds.left, _bounds.bottom - 1, _bounds.right - 17, _black);
+	s->vLine(_bounds.left, _bounds.top + 1, _bounds.bottom - 2, _black);
 
 	_redraw = false;
 	_fullRedraw = false;


Commit: 61f19fa472ec0934aa29548b686f70b0719f371c
    https://github.com/scummvm/scummvm/commit/61f19fa472ec0934aa29548b686f70b0719f371c
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Remove palette handling for PICT images

We used to be able to use an unused area of the palette for the PICT
image's own palette. That will of course be quite impossible when
supporting 256 color games, so map the colors to the closest available
ones instead. That seems to be what the original interpreter did anyway.

Changed paths:
    engines/scumm/macgui/macgui_dialogwindow.cpp
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/macgui/macgui_impl.h


diff --git a/engines/scumm/macgui/macgui_dialogwindow.cpp b/engines/scumm/macgui/macgui_dialogwindow.cpp
index 289e16e6175..7b2622fd12c 100644
--- a/engines/scumm/macgui/macgui_dialogwindow.cpp
+++ b/engines/scumm/macgui/macgui_dialogwindow.cpp
@@ -249,18 +249,7 @@ void MacGuiImpl::MacDialogWindow::drawBeamCursor() {
 	for (int i = 0; i < ARRAYSIZE(beam); i += 2) {
 		uint32 color = _beamCursor->getPixel(beam[i], beam[i + 1]);
 
-		// From looking at a couple of colors, it seems this is how
-		// the colors are inverted for 0-15. I'm just going to assume
-		// that the same method will work reasonably well for the
-		// custom colors. If there's anything else, just make it black.
-
-		if (color <= 15)
-			color = 15 - color;
-		else if (color > kCustomColor && color <= kCustomColor + 15)
-			color = kCustomColor + 15 - color;
-		else
-			color = _black;
-
+		color = _gui->_windowManager->inverter(color);
 		_beamCursor->setPixel(beam[i], beam[i + 1], color);
 	}
 
diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 11f4a854a3d..07c0760f068 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -614,47 +614,28 @@ Graphics::Surface *MacGuiImpl::loadPict(int id) {
 		s = new Graphics::Surface();
 		s->create(s1->w, s1->h, Graphics::PixelFormat::createFormatCLUT8());
 
-		// The palette doesn't match the game's palette at all, so remap
-		// the colors to the custom area of the palette. It's assumed that
-		// only one such picture will be loaded at a time.
-		//
-		// But we still match black and white to 0 and 15 to make sure they
-		// mach exactly.
+		byte paletteMap[256];
 
-		int black = -1;
-		int white = -1;
 
 		for (int i = 0; i < pict.getPaletteColorCount(); i++) {
 			int r = palette[3 * i];
 			int g = palette[3 * i + 1];
 			int b = palette[3 * i + 2];
 
-			if (r == 0 && g == 0 && b == 0)
-				black = i;
-			else if (r == 255 && g == 255 && b == 255)
-				white = i;
+			uint32 c = _windowManager->findBestColor(r, g, b);
+			paletteMap[i] = c;
 		}
 
 		if (!pict.getPaletteColorCount()) {
-			black = 0xff;
-			white = 0x00;
+			paletteMap[255] = getBlack();
+			paletteMap[0] = getWhite();
 		}
 
 		if (palette) {
-			_system->getPaletteManager()->setPalette(palette, kCustomColor, pict.getPaletteColorCount());
-
 			for (int y = 0; y < s->h; y++) {
 				for (int x = 0; x < s->w; x++) {
 					int color = s1->getPixel(x, y);
-
-					if (color == black)
-						color = kBlack;
-					else if (color == white)
-						color = kWhite;
-					else
-						color = kCustomColor + color;
-
-					s->setPixel(x, y, color);
+					s->setPixel(x, y, paletteMap[color]);
 				}
 			}
 		} else
diff --git a/engines/scumm/macgui/macgui_impl.h b/engines/scumm/macgui/macgui_impl.h
index 0e3edb1ae10..9f0531738f5 100644
--- a/engines/scumm/macgui/macgui_impl.h
+++ b/engines/scumm/macgui/macgui_impl.h
@@ -94,9 +94,6 @@ protected:
 		kBrightYellow = 14,
 		kWhite = 15,
 
-		// Reserved for custom colors, loaded from PICT resources.
-		kCustomColor = 100,
-
 		kBackground = 254,	// Gray or checkerboard
 		kTransparency = 255
 	};


Commit: 9708884d0c81dbeee53b88a2a560ff1e4ac3c23b
    https://github.com/scummvm/scummvm/commit/9708884d0c81dbeee53b88a2a560ff1e4ac3c23b
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MI2/INDY4: Parse Mac STRS strings

Changed paths:
    engines/scumm/macgui/macgui_mi1.cpp


diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index 600362a4496..1f980f2d47d 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -68,63 +68,206 @@ void MacMI1Gui::readStrings() {
 	// Most of these are debug strings. We parse the entire STRS block anyway,
 	// for any future need.
 
-	// Debug strings
-	for (int i = 0; i < 93; i++) {
+	if (_vm->_game.id == GID_MONKEY) {
+		// Debug strings
+		for (int i = 0; i < 93; i++) {
+			_strsStrings.emplace_back(readCString(strsData));
+		}
+
+		// "\x14", "About Monkey Island...<B;(-"
+		for (int i = 0; i < 2; i++) {
+			_strsStrings.emplace_back(readPascalString(strsData));
+		}
+
+		// "Are you sure you want to quit?", "Are you sure you want to quit?",
+		// "Are you sure you want to restart this game from the beginning?",
+		// "Are you sure you want to quit?"
+		for (int i = 0; i < 4; i++) {
+			_strsStrings.emplace_back(readCString(strsData));
+		}
+
+		// "macPixHead is NULL", "Monkey Island"
+		for (int i = 0; i < 2; i++) {
+			_strsStrings.emplace_back(readPascalString(strsData));
+		}
+
+		// "CopyBits error:"
 		_strsStrings.emplace_back(readCString(strsData));
-	}
 
-	// "\x14", "About Monkey Island...<B;(-"
-	for (int i = 0; i < 2; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
+		// "Open Game File...", "Save Game File as..." "Game file"
+		for (int i = 0; i < 3; i++) {
+			_strsStrings.emplace_back(readPascalString(strsData));
+		}
 
-	// "Are you sure you want to quit?", "Are you sure you want to quit?",
-	// "Are you sure you want to restart this game from the beginning?",
-	// "Are you sure you want to quit?"
-	for (int i = 0; i < 4; i++) {
+		// "This disk is full.  The game was not saved."
 		_strsStrings.emplace_back(readCString(strsData));
-	}
 
-	// "macPixHead is NULL", "Monkey Island"
-	for (int i = 0; i < 2; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
+		// "An error occured while saving.  The game was not saved.  Please try saving the game to another disk."
+		_strsStrings.emplace_back(readCString(strsData));
 
-	// "CopyBits error:"
-	_strsStrings.emplace_back(readCString(strsData));
+		// "At this size, you will not be able to fit the whole game on your screen."
+		_strsStrings.emplace_back(readCString(strsData));
 
-	// "Open Game File...", "Save Game File as..." "Game file"
-	for (int i = 0; i < 3; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
+		// Debug strings
+		for (int i = 0; i < 3; i++) {
+			_strsStrings.emplace_back(readCString(strsData));
+		}
+
+		for (int i = 0; i < 2; i++) {
+			_strsStrings.emplace_back(readPascalString(strsData));
+		}
 
-	// "This disk is full.  The game was not saved."
-	_strsStrings.emplace_back(readCString(strsData));
+		// All the "About" dialog strings
+		for (int i = 0; i < 32; i++) {
+			_strsStrings.emplace_back(readPascalString(strsData));
+		}
+
+		// Remaining debug strings
+		for (int i = 0; i < 75; i++) {
+			_strsStrings.emplace_back(readCString(strsData));
+		}
+	} else if (_vm->_game.id == GID_MONKEY2) {
+		// Debug strings
+		for (int i = 0; i < 93; i++) {
+			_strsStrings.emplace_back(readCString(strsData));
+		}
+
+		// "\x14", "About Monkey Island 2...<B;(-"
+		for (int i = 0; i < 2; i++) {
+			_strsStrings.emplace_back(readPascalString(strsData));
+		}
 
-	// "An error occured while saving.  The game was not saved.  Please try saving the game to another disk."
-	_strsStrings.emplace_back(readCString(strsData));
+		// "Are you sure you want to quit?",
+		// "Warning: The 'rough' command will make your Mac screen look dangerously like a PC.  (eek!)",
+		// "Are you sure you want to quit?",
+		// "Are you sure you want to restart this game from the beginning?",
+		// "Are you sure you want to quit?"
+		for (int i = 0; i < 5; i++) {
+			_strsStrings.emplace_back(readCString(strsData));
+		}
 
-	// "At this size, you will not be able to fit the whole game on your screen."
-	_strsStrings.emplace_back(readCString(strsData));
+		// " macPixHead is NULL", "Monkey Island 2"
+		for (int i = 0; i < 2; i++) {
+			_strsStrings.emplace_back(readPascalString(strsData));
+		}
 
-	// Debug strings
-	for (int i = 0; i < 3; i++) {
+		// "CopyBits error:"
 		_strsStrings.emplace_back(readCString(strsData));
-	}
 
-	for (int i = 0; i < 2; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
+		// "Open Game File...", "Monkey2 temp", "Monkey2 temp", "Save Game File as...", "Game file"
+		for (int i = 0; i < 5; i++) {
+			_strsStrings.emplace_back(readPascalString(strsData));
+		}
 
-	// All the "About" dialog strings
-	for (int i = 0; i < 32; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
+		// "This disk is full.  The game was not saved."
+		_strsStrings.emplace_back(readCString(strsData));
 
-	// Remaining debug strings
-	for (int i = 0; i < 75; i++) {
+		// "An error occured while saving.  The game was not saved.  Please try saving the game to another disk."
 		_strsStrings.emplace_back(readCString(strsData));
-	}
+
+		// "At this size, you will not be able to fit the whole game on your screen."
+		_strsStrings.emplace_back(readCString(strsData));
+
+		// Debug strings
+		for (int i = 0; i < 3; i++) {
+			_strsStrings.emplace_back(readCString(strsData));
+		}
+
+		for (int i = 0; i < 2; i++) {
+			_strsStrings.emplace_back(readPascalString(strsData));
+		}
+
+		// All the "About" dialog strings
+		for (int i = 0; i < 40; i++) {
+			_strsStrings.emplace_back(readPascalString(strsData));
+		}
+
+		// More debug strings...
+		for (int i = 0; i < 95; i++) {
+			_strsStrings.emplace_back(readCString(strsData));
+		}
+	} else if (_vm->_game.id == GID_INDY4) {
+		bool isFloppyVersion = _vm->_game.variant && !strcmp(_vm->_game.variant, "Floppy");
+
+		// Debug strings
+		for (int i = 0; i < (isFloppyVersion ? 93 : 144); i++) {
+			_strsStrings.emplace_back(readCString(strsData));
+		}
+
+		if (!isFloppyVersion) {
+			_strsStrings.emplace_back(readPascalString(strsData));
+
+			for (int i = 0; i < 2; i++) {
+				_strsStrings.emplace_back(readCString(strsData));
+			}
+
+			for (int i = 0; i < 10; i++) {
+				_strsStrings.emplace_back(readPascalString(strsData));
+			}
+
+			for (int i = 0; i < 51; i++) {
+				_strsStrings.emplace_back(readCString(strsData));
+			}
+		}
+
+		// "\x14", "About Indy Atlantis...<B;(-"
+		for (int i = 0; i < 2; i++) {
+			_strsStrings.emplace_back(readPascalString(strsData));
+		}
+
+		if (!isFloppyVersion) {
+			// "Indy Temp", "Indy Temp"
+			for (int i = 0; i < 2; i++) {
+				_strsStrings.emplace_back(readPascalString(strsData));
+			}
+		}
+
+		// "Are you sure you want to quit?",
+		// "Warning: The 'rough' command will make your Mac screen look dangerously like a PC.  (eek!)",
+		// "Are you sure you want to quit?",
+		// "Are you sure you want to restart this game from the beginning?",
+		// "Are you sure you want to quit?"
+		for (int i = 0; i < 5; i++) {
+			_strsStrings.emplace_back(readCString(strsData));
+		}
+
+		// " macPixHead is NULL", "Indy Atlantis"
+		for (int i = 0; i < 2; i++) {
+			_strsStrings.emplace_back(readPascalString(strsData));
+		}
+
+		// "CopyBits error:"
+		_strsStrings.emplace_back(readCString(strsData));
+
+		// "Open Game File...", "Indy Atlantis IQ Points", "Indy Atlantis IQ Points",
+		// "Indy Temp", "Indy Temp", "Save Game File as...", "Game file"
+		for (int i = 0; i < 7; i++) {
+			_strsStrings.emplace_back(readPascalString(strsData));
+		}
+
+		// "This disk is full.  The game was not saved."
+		_strsStrings.emplace_back(readCString(strsData));
+
+		// "An error occured while saving.  The game was not saved.  Please try saving the game to another disk."
+		_strsStrings.emplace_back(readCString(strsData));
+
+		// "At this size, you will not be able to fit the whole game on your screen."
+		_strsStrings.emplace_back(readCString(strsData));
+
+		// Debug strings
+		for (int i = 0; i < 3; i++) {
+			_strsStrings.emplace_back(readCString(strsData));
+		}
+
+		for (int i = 0; i < 2; i++) {
+			_strsStrings.emplace_back(readPascalString(strsData));
+		}
+
+		// All the "About" dialog strings
+		for (int i = 0; i < (isFloppyVersion ? 38 : 37); i++) {
+			_strsStrings.emplace_back(readPascalString(strsData));
+		}
+	} 
 
 	free(strsBlock);
 	delete strsStream;


Commit: 3670cd934b80c2e3b89585fda0a1a5d56d80fb58
    https://github.com/scummvm/scummvm/commit/3670cd934b80c2e3b89585fda0a1a5d56d80fb58
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Remove last hard-coded colors from common code

Changed paths:
    engines/scumm/macgui/macgui_dialogwindow.cpp


diff --git a/engines/scumm/macgui/macgui_dialogwindow.cpp b/engines/scumm/macgui/macgui_dialogwindow.cpp
index 7b2622fd12c..750f7d28ed0 100644
--- a/engines/scumm/macgui/macgui_dialogwindow.cpp
+++ b/engines/scumm/macgui/macgui_dialogwindow.cpp
@@ -330,8 +330,8 @@ void MacGuiImpl::MacDialogWindow::drawDottedHLine(int x0, int y, int x1) {
 		color[0] = _black;
 		color[1] = _white;
 	} else {
-		color[0] = kDarkGray;
-		color[1] = kLightGray;
+		color[0] = _gui->_windowManager->findBestColor(0x75, 0x75, 0x75);
+		color[1] = _gui->_windowManager->findBestColor(0xBE, 0xBE, 0xBE);
 	}
 
 	for (int x = x0; x <= x1; x++)


Commit: 8cf49f4efdf6668b43187efc25c4217a4e085cf4
    https://github.com/scummvm/scummvm/commit/8cf49f4efdf6668b43187efc25c4217a4e085cf4
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Move 16 color constants to its own header file

This should help ensure that we don't accidentally use them in code
common to both 16 and 256 color games.

Changed paths:
  A engines/scumm/macgui/macgui_colors.h
    engines/scumm/macgui/macgui_impl.h
    engines/scumm/macgui/macgui_indy3.cpp
    engines/scumm/macgui/macgui_indy3.h
    engines/scumm/macgui/macgui_loom.cpp


diff --git a/engines/scumm/macgui/macgui_colors.h b/engines/scumm/macgui/macgui_colors.h
new file mode 100644
index 00000000000..498b4433d1f
--- /dev/null
+++ b/engines/scumm/macgui/macgui_colors.h
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef SCUMM_MACGUI_COLORS_H
+
+namespace Scumm {
+
+// Colors used by the 16 color Mac games. Nothing that is ever drawn by
+// 256 color games should use these!
+
+#define kBlack         0
+#define	kBlue          1
+#define	kGreen         2
+#define kCyan          3
+#define kRed           4
+#define kMagenta       5
+#define kBrown         6
+#define kLightGray     7
+#define kDarkGray      8
+#define kBrightBlue    9
+#define kBrightGreen   10
+#define kBrightCyan    11
+#define kBrightRed     12
+#define kBrightMagenta 13
+#define kBrightYellow  14
+#define kWhite         15
+
+// Gray or checkerboard
+#define kBackground    254
+
+#define kTransparency  255
+
+} // End of namespace Scumm
+
+#endif
diff --git a/engines/scumm/macgui/macgui_impl.h b/engines/scumm/macgui/macgui_impl.h
index 9f0531738f5..a7a42213b42 100644
--- a/engines/scumm/macgui/macgui_impl.h
+++ b/engines/scumm/macgui/macgui_impl.h
@@ -73,31 +73,6 @@ protected:
 		kDelayAborted
 	};
 
-	// Colors used by the 16 color Mac games. Nothing that is ever drawn by
-	// 256 color games should use these!
-
-	enum Color {
-		kBlack = 0,
-		kBlue = 1,
-		kGreen = 2,
-		kCyan = 3,
-		kRed = 4,
-		kMagenta = 5,
-		kBrown = 6,
-		kLightGray = 7,
-		kDarkGray = 8,
-		kBrightBlue = 9,
-		kBrightGreen = 10,
-		kBrightCyan = 11,
-		kBrightRed = 12,
-		kBrightMagenta = 13,
-		kBrightYellow = 14,
-		kWhite = 15,
-
-		kBackground = 254,	// Gray or checkerboard
-		kTransparency = 255
-	};
-
 	enum FontId {
 		kSystemFont,
 
diff --git a/engines/scumm/macgui/macgui_indy3.cpp b/engines/scumm/macgui/macgui_indy3.cpp
index efe53e168ce..3753a4cd847 100644
--- a/engines/scumm/macgui/macgui_indy3.cpp
+++ b/engines/scumm/macgui/macgui_indy3.cpp
@@ -115,7 +115,7 @@ void MacIndy3Gui::Widget::fill(Common::Rect r) {
 	_gui->fill(r);
 }
 
-void MacIndy3Gui::Widget::drawBitmap(Common::Rect r, const uint16 *bitmap, Color color) const {
+void MacIndy3Gui::Widget::drawBitmap(Common::Rect r, const uint16 *bitmap, byte color) const {
 	_gui->drawBitmap(_surface, r, bitmap, color);
 }
 
@@ -138,7 +138,7 @@ void MacIndy3Gui::Widget::drawShadowBox(Common::Rect r) const {
 // The shadow frame is a rectangle with a highlight. It can be filled or
 // unfilled.
 
-void MacIndy3Gui::Widget::drawShadowFrame(Common::Rect r, Color shadowColor, Color fillColor) {
+void MacIndy3Gui::Widget::drawShadowFrame(Common::Rect r, byte shadowColor, byte fillColor) {
 	_surface->hLine(r.left, r.top, r.right - 1, kBlack);
 	_surface->hLine(r.left, r.bottom - 1, r.right - 1, kBlack);
 	_surface->vLine(r.left, r.top + 1, r.bottom - 2, kBlack);
@@ -315,7 +315,7 @@ void MacIndy3Gui::Button::draw() {
 
 		int x = (_bounds.left + (_bounds.width() - 1 - stringWidth) / 2) - 1;
 		int y = _bounds.top + 2;
-		Color color = _enabled ? kWhite : kBlack;
+		byte color = _enabled ? kWhite : kBlack;
 
 		if (hasTimer()) {
 			x++;
@@ -657,7 +657,7 @@ void MacIndy3Gui::Inventory::Slot::draw() {
 
 	Widget::draw();
 
-	Color fg, bg;
+	byte fg, bg;
 
 	if (hasTimer()) {
 		fg = kWhite;
@@ -863,7 +863,7 @@ void MacIndy3Gui::Inventory::ScrollButton::draw() {
 	};
 
 	const uint16 *arrow = (_direction == kScrollUp) ? upArrow : downArrow;
-	Color color = hasTimer() ? kBlack : kWhite;
+	byte color = hasTimer() ? kBlack : kWhite;
 
 	drawBitmap(_bounds, arrow, color);
 
diff --git a/engines/scumm/macgui/macgui_indy3.h b/engines/scumm/macgui/macgui_indy3.h
index de6d0e8093f..60167d44eb7 100644
--- a/engines/scumm/macgui/macgui_indy3.h
+++ b/engines/scumm/macgui/macgui_indy3.h
@@ -28,6 +28,8 @@
 
 #include "graphics/surface.h"
 
+#include "scumm/macgui/macgui_colors.h"
+
 namespace Scumm {
 
 class MacGuiImpl;
@@ -146,9 +148,9 @@ private:
 
 		// Primitives
 		void fill(Common::Rect r);
-		void drawBitmap(Common::Rect r, const uint16 *bitmap, Color color) const;
+		void drawBitmap(Common::Rect r, const uint16 *bitmap, byte color) const;
 		void drawShadowBox(Common::Rect r) const;
-		void drawShadowFrame(Common::Rect r, Color shadowColor, Color fillColor);
+		void drawShadowFrame(Common::Rect r, byte shadowColor, byte fillColor);
 
 		void markScreenAsDirty(Common::Rect r) const;
 	};
diff --git a/engines/scumm/macgui/macgui_loom.cpp b/engines/scumm/macgui/macgui_loom.cpp
index e54784a979a..940742d0451 100644
--- a/engines/scumm/macgui/macgui_loom.cpp
+++ b/engines/scumm/macgui/macgui_loom.cpp
@@ -33,6 +33,7 @@
 #include "scumm/scumm.h"
 #include "scumm/detection.h"
 #include "scumm/macgui/macgui_impl.h"
+#include "scumm/macgui/macgui_colors.h"
 #include "scumm/macgui/macgui_loom.h"
 #include "scumm/music.h"
 #include "scumm/sound.h"
@@ -531,9 +532,9 @@ void MacLoomGui::runDraftsInventory() {
 	int base = 55;
 
 	// TODO: Can these be drawn in different styles? (e.g. Checkerboard)
-	Color unlockedColor = kBlack;
-	Color inactiveColor = kBlack;
-	Color newDraftColor = kBlack;
+	byte unlockedColor = kBlack;
+	byte inactiveColor = kBlack;
+	byte newDraftColor = kBlack;
 
 	for (int i = 0; i < 16; i++) {
 		int draft = _vm->_scummVars[base + i * 2];
@@ -896,7 +897,7 @@ void MacLoomGui::update(int delta) {
 
 				_practiceBox->fillRect(Common::Rect(w, h), kBlack);
 
-				Color color = bw ? kWhite : kLightGray;
+				byte color = bw ? kWhite : kLightGray;
 
 				_practiceBox->hLine(2, 1, w - 3, color);
 				_practiceBox->hLine(2, h - 2, w - 3, color);
@@ -913,7 +914,7 @@ void MacLoomGui::update(int delta) {
 				_practiceBox->fillRect(Common::Rect(2, 2, w - 2, h - 2), kBlack);
 
 				const Graphics::Font *font = getFont(kLoomFontLarge);
-				Color colors[] = { kRed, kBrightRed, kBrightYellow, kBrightGreen, kBrightCyan, kCyan, kBrightBlue, kWhite };
+				byte colors[] = { kRed, kBrightRed, kBrightYellow, kBrightGreen, kBrightCyan, kCyan, kBrightBlue, kWhite };
 
 				for (int i = 0; i < 4; i++) {
 					int note = (notes >> (4 * i)) & 0x0F;


Commit: 387f4cfae3df82b1f0c9bc331011967296cd0200
    https://github.com/scummvm/scummvm/commit/387f4cfae3df82b1f0c9bc331011967296cd0200
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: v5 (Mac): Fix Y offset glitches during Mac GUI interactions

Changed paths:
    engines/scumm/gfx_mac.cpp


diff --git a/engines/scumm/gfx_mac.cpp b/engines/scumm/gfx_mac.cpp
index ba9939069fb..37a11f22e8a 100644
--- a/engines/scumm/gfx_mac.cpp
+++ b/engines/scumm/gfx_mac.cpp
@@ -194,11 +194,11 @@ void ScummEngine::mac_updateCompositeBuffer(const byte *buffer, int pitch, int x
 }
 
 void ScummEngine::mac_blitDoubleResImage(const byte *buffer, int pitch, int x, int y, int width, int height) {
-	byte *mac = (byte *)_macScreen->getBasePtr(x * 2, y * 2);
+	byte *mac = (byte *)_macScreen->getBasePtr(x * 2, y * 2 + _macScreenDrawOffset * 2);
 
 	mac_applyDoubleResToBuffer(buffer, mac, width, height, pitch, _macScreen->pitch);
 
-	_system->copyRectToScreen(_macScreen->getBasePtr(x * 2, y * 2), _macScreen->pitch, x * 2, y * 2 + _macScreenDrawOffset * 2, width * 2, height * 2);
+	_system->copyRectToScreen(_macScreen->getBasePtr(x * 2, y * 2 + _macScreenDrawOffset * 2), _macScreen->pitch, x * 2, y * 2 + _macScreenDrawOffset * 2, width * 2, height * 2);
 }
 
 void ScummEngine::mac_applyDoubleResToBuffer(const byte *inputBuffer, byte *outputBuffer, int width, int height, int inputPitch, int outputPitch) {
@@ -254,12 +254,12 @@ void ScummEngine::mac_blitEPXImage(const byte *buffer, int pitch, int x, int y,
 	int y2 = (y + height < _screenHeight) ? y + height + 1 : _screenHeight;
 
 	// Adjust output buffer accordingly
-	byte *targetScreenBuf = (byte *)_macScreen->getBasePtr(x1 * 2, y1 * 2);
+	byte *targetScreenBuf = (byte *)_macScreen->getBasePtr(x1 * 2, y1 * 2 + _macScreenDrawOffset * 2);
 
 	// Apply the EPX/Scale2x algorithm
 	mac_applyEPXToBuffer(_completeScreenBuffer, targetScreenBuf, x2 - x1, y2 - y1, _screenWidth, _macScreen->pitch, x1, y1, _screenWidth, _screenHeight);
 
-	_system->copyRectToScreen(_macScreen->getBasePtr(x1 * 2, y1 * 2), _macScreen->pitch, x1 * 2, y1 * 2 + _macScreenDrawOffset * 2, (x2 - x1) * 2, (y2 - y1) * 2);
+	_system->copyRectToScreen(_macScreen->getBasePtr(x1 * 2, y1 * 2 + _macScreenDrawOffset * 2), _macScreen->pitch, x1 * 2, y1 * 2 + _macScreenDrawOffset * 2, (x2 - x1) * 2, (y2 - y1) * 2);
 }
 
 void ScummEngine::mac_applyEPXToBuffer(const byte *inputBuffer, byte *outputBuffer, int width, int height, int inputPitch, int outputPitch, int xOffset, int yOffset, int bufferWidth, int bufferHeight) {


Commit: 73c50e9546166de9e2f630e9b2997f0787fc8518
    https://github.com/scummvm/scummvm/commit/73c50e9546166de9e2f630e9b2997f0787fc8518
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Add About dialog for Fate of Atlantis

This should work with both the CD and the floppy version. It is becoming
obvious that the About dialog for MI1, MI2 and Fate of Atlantis will
have at least a couple of things in common, but refactoring out the
common code will have to wait until all three are in place.

Changed paths:
    engines/scumm/macgui/macgui_mi1.cpp


diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index 1f980f2d47d..9dc8160462c 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -398,8 +398,8 @@ void MacMI1Gui::runAboutDialogMI1() {
 	const TextLine page12[] = {
 		{ 0, 0, kStyleHeaderSimple1, Graphics::kTextAlignLeft, _strsStrings[115].c_str() }, // "The Secret"
 		{ 87, 13, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[117].c_str() }, // "of"
-		{ 40, 26, kStyleHeaderSimple1, Graphics::kTextAlignLeft, _strsStrings[116].c_str() }, // "Monkey Island(TM)"
-		{ 178, 120, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[118].c_str() }, // "TM & (C) 1990 LucasArts Entertainment Company."
+		{ 40, 26, kStyleHeaderSimple1, Graphics::kTextAlignLeft, _strsStrings[116].c_str() }, // "Monkey Island\xAA"
+		{ 178, 120, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[118].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company."
 		{ 312, 133, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[119].c_str() }, // "All rights reserved."
 		TEXT_END_MARKER
 	};
@@ -431,7 +431,7 @@ void MacMI1Gui::runAboutDialogMI1() {
 		{ 29, 37, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[131].c_str() }, // "Stumped? Hint books are available"
 		{ 15, 55, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[134].c_str() }, // "In the U.S. call"
 		{ 89, 55, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[132].c_str() }, // "1 (800) STAR-WARS"
-		{ 89, 65, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[136].c_str() }, // "that's 1 (800)782-7927"
+		{ 89, 65, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[136].c_str() }, // "that\xD5s  1 (800)782-7927"
 		{ 19, 85, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[135].c_str() }, // "In Canada call"
 		{ 89, 85, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[133].c_str() }, // "1 (800) 828-7927"
 		TEXT_END_MARKER
@@ -444,7 +444,7 @@ void MacMI1Gui::runAboutDialogMI1() {
 		{ 62, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[141].c_str() }, // "For hints call"
 		{ 130, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[139].c_str() }, // "1 (900) 740-JEDI"
 		{ 5, 72, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[142].c_str() }, // "The charge for the hint line is 75\xA2 per minute."
-		{ 10, 82, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[143].c_str() }, // "(You must have your parents' permission to"
+		{ 10, 82, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[143].c_str() }, // "(You must have your parents\xD5 permission to"
 		{ 25, 92, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[144].c_str() }, // "call this number if you are under 18.)"
 		TEXT_END_MARKER
 	};
@@ -578,7 +578,6 @@ void MacMI1Gui::runAboutDialogMI1() {
 			if (aboutPages[page].drawArea == 2) {
 				window->drawTextBox(drawArea, aboutPages[page].text);
 			} else {
-				s->fillRect(drawArea, white);
 				window->drawTexts(drawArea, aboutPages[page].text);
 			}
 		}
@@ -629,6 +628,195 @@ void MacMI1Gui::runAboutDialogMI2() {
 }
 
 void MacMI1Gui::runAboutDialogIndy4() {
+	bool isFloppyVersion = _vm->_game.variant && !strcmp(_vm->_game.variant, "Floppy");
+
+	int width = 416;
+	int height = 166;
+	int x = (640 - width) / 2;
+	int y = (400 - height) / 2;
+
+	Common::Rect bounds(x, y, x + width, y + height);
+	MacDialogWindow *window = createWindow(bounds);
+//	Graphics::Surface *lucasArts = loadPict(5000);
+	Graphics::Surface *indianaJones = loadPict(5001);
+
+	Graphics::Surface *s = window->innerSurface();
+
+	int baseString = isFloppyVersion ? 119 : 236;
+	int baseString2 = isFloppyVersion ? 142 : 258;
+
+	const TextLine page3[] = {
+		{ 0, 68, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[baseString].c_str() }, // "PRESENTS"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page5[] = {
+		{ 317, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 1].c_str() }, // "\xA8"
+		{ 176, 125, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 2].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company."
+		{ 310, 138, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 3].c_str() }, // "All rights reserved."
+		TEXT_END_MARKER
+	};
+
+	const TextLine page6[] = {
+		{ 0, 19, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[baseString + 4].c_str() }, // "Macintosh version by
+		{ 133, 34, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[baseString + 5].c_str() }, // "Eric Johnston"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page7[] = {
+		{ 168, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 6].c_str() }, // "Created by"
+		{ 138, 19, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[baseString + 8].c_str() }, // "Hal Barwood"
+		{ 141, 42, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 7].c_str() }, // "Macintosh Scripting by"
+		{ 127, 57, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[baseString + 9].c_str() }, // "Alric Wilmunder"
+		TEXT_END_MARKER
+	};
+
+	// The original drew this page in two passes, 0.1 seconds apart. But I
+	// guess that's an implementation thing, not an intended effect, because
+	// none of the other pages do it.
+
+	const TextLine page8[] = {
+		{ 142, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 10].c_str() }, // "SCUMM Story System"
+		{ 168, 14, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 11].c_str() }, // "created by"
+		{ 68, 28, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[baseString + 13].c_str() }, // "Ron Gilbert    Aric Wilmunder"
+		{ 79, 43, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[baseString + 14].c_str() }, // "Brad P. Taylor    Vince Lee"
+		{ 135, 60, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 12].c_str() }, // "and"
+		{ 109, 58, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[baseString + 15].c_str() }, // "        Eric Johnston"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page9[] = {
+		{ 137, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 16].c_str() }, // "Macintosh Orchestration"
+		{ 125, 19, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[baseString + 18].c_str() }, // "Robin Goldstein"
+		{ 152, 42, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 17].c_str() }, // "Macintosh Testing"
+		{ 144, 57, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[baseString + 19].c_str() }, // "Jo Ashburn"
+		TEXT_END_MARKER
+	};
+
+	// Annoyingly, this page is missing a string in the CD version of the
+	// game so we need two different versions. Note that the "rough" command
+	// does work in both versions.
+
+	const TextLine page10_cd[] = {
+		{ 2, 19, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[baseString + 20].c_str() }, // "\xD2djm\xD3  Sound and Music System \xA91992 Eric Johnston
+		{ 2, 39, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[baseString + 21].c_str() }, // "\xD2epx\xD3  Graphics Smoothing System \xA91992 Eric Johnson
+		TEXT_END_MARKER
+	};
+
+	const TextLine page10_floppy[] = {
+		{ 2, 19, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[baseString + 20].c_str() }, // "\xD2djm\xD3  Sound and Music System \xA91992 Eric Johnston
+		{ 2, 39, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[baseString + 21].c_str() }, // "\xD2epx\xD3  Graphics Smoothing System \xA91992 Eric Johnson
+		{ 2, 54, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[baseString + 22].c_str() }, // "Type 'rough' to see the difference."
+		TEXT_END_MARKER
+	};
+
+	const TextLine page11[] = {
+		{ 112, 9, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2].c_str() }, // "Stumped?  Hint books are available!"
+		{ 98, 27, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 3].c_str() }, // "In the U.S. call"
+		{ 172, 27, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 1].c_str() }, // "1 (800) STAR-WARS"
+		{ 172, 37, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 5].c_str() }, // "that\xD5s  1 (800) 782-7927"
+		{ 102, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 4].c_str() }, // "In Canada call"
+		{ 172, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 2].c_str() }, // "1 (900) 740-JEDI"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page12[] = {
+		{ 110, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 6].c_str() }, // "Need a hint NOW?  Having problems?"
+		{ 89, 19, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 9].c_str() }, // "For technical support call"
+		{ 213, 19, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 7].c_str() }, // "1 (415) 721-3333"
+		{ 145, 29, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 10].c_str() }, // "For hints call"
+		{ 213, 29, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 8].c_str() }, // "1 (900) 740-JEDI"
+		{ 88, 44, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 11].c_str() }, // "The charge for the hint line is 75\xA2 per minute."
+		{ 93, 54, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 12].c_str() }, // "(You must have your parents\xD5 permission to"
+		{ 108, 64, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 13].c_str() }, // "call this number if you are under 18.)"
+		TEXT_END_MARKER
+	};
+
+	struct AboutPage {
+		const TextLine *text;
+		int drawArea;
+		uint32 delayMs;
+	};
+
+	AboutPage aboutPages[] = {
+		{ nullptr, 0,  2800 },
+		{ nullptr, 0,   100 },
+		{ nullptr, 0,   100 },
+		{ page3,   0,  2100 },
+		{ nullptr, 0,   500 },
+		{ page5,   0,  2900 },
+		{ page6,   1,  4200 },
+		{ page7,   1,  4300 },
+		{ page8,   1,  4200 },
+		{ page9,   1,  4200 },
+		{ nullptr, 1,  4200 },
+		{ page11,  1, 14100 },
+		{ page12,  1,     0 }
+	};
+
+	Common::Rect drawAreas[] = {
+		Common::Rect(2, 2, s->w - 2, s->h - 2),
+		Common::Rect(10, 63, s->w - 10, s->h - 10)
+	};
+
+	int page = 0;
+
+	window->show();
+
+	uint32 black = getBlack();
+	uint32 white = getWhite();
+
+	while (!_vm->shouldQuit() && page < ARRAYSIZE(aboutPages)) {
+		Common::Rect &drawArea = drawAreas[aboutPages[page].drawArea];
+
+		switch (page) {
+		case 0:
+			s->fillRect(drawArea, black);
+			break;
+		case 1:
+			window->fillPattern(drawArea, 0xD7D7, false, true);
+			break;
+		case 2:
+			window->fillPattern(drawArea, 0x5A5A, false, true);
+			break;
+		case 3:
+			s->fillRect(drawArea, white);
+			break;
+		case 4:
+			s->fillRect(drawArea, white);
+			window->drawSprite(indianaJones, 89, 6);
+			break;
+		case 6:
+			s->fillRect(Common::Rect(178, 129, s->w - 2, s->h - 2), white);
+			window->markRectAsDirty(Common::Rect(178, 129, s->w - 2, s->h - 2));
+			break;
+		case 10:
+			aboutPages[10].text = isFloppyVersion ? page10_floppy : page10_cd;
+			break;
+		}
+
+		if (aboutPages[page].drawArea != 2)
+			window->markRectAsDirty(drawArea);
+
+		if (aboutPages[page].text) {
+			if (aboutPages[page].drawArea == 1) {
+				window->drawTextBox(drawArea, aboutPages[page].text);
+			} else {
+				window->drawTexts(drawArea, aboutPages[page].text);
+			}
+		}
+
+		if (aboutPages[page].drawArea != 1)
+			window->markRectAsDirty(drawArea);
+
+		window->update();
+		delay(aboutPages[page].delayMs);
+		page++;
+	}
+
+//	delete lucasArts;
+	delete indianaJones;
+	delete window;
 }
 
 // A standard file picker dialog doesn't really make sense in ScummVM, so we


Commit: fa4b5734d088a19d2a16b01e4a215b97930ee86a
    https://github.com/scummvm/scummvm/commit/fa4b5734d088a19d2a16b01e4a215b97930ee86a
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MI1 (Mac): Stub GUI options for enabling/disabling sound

Changed paths:
    engines/scumm/macgui/macgui_mi1.cpp


diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index 9dc8160462c..391517c33aa 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -977,8 +977,6 @@ bool MacMI1Gui::runOptionsDialog() {
 		music = 0;
 	}
 
-	int scrolling = _vm->_snapScroll == 0;
-	int fullAnimation = _vm->VAR(_vm->VAR_MACHINE_SPEED) == 1 ? 0 : 1;
 	int textSpeed = _vm->_defaultTextSpeed;
 	int musicQuality = ConfMan.hasKey("mac_snd_quality") ? ConfMan.getInt("mac_snd_quality") : 0;
 	int musicQualityOption = (musicQuality == 0) ? 1 : (musicQuality - 1) % 3;
@@ -988,8 +986,6 @@ bool MacMI1Gui::runOptionsDialog() {
 
 	window->setWidgetValue(2, sound);
 	window->setWidgetValue(3, music);
-	window->setWidgetValue(6, scrolling);
-	window->setWidgetValue(7, fullAnimation);
 
 	if (!sound)
 		window->setWidgetEnabled(3, false);
@@ -1000,9 +996,6 @@ bool MacMI1Gui::runOptionsDialog() {
 	window->addPictureSlider(8, 9, true, 5, 69, 0, 2, 6, 4);
 	window->setWidgetValue(12, musicQualityOption);
 
-	// Machine rating
-	window->addSubstitution(Common::String::format("%d", _vm->VAR(53)));
-
 	// When quitting, the default action is not to not apply options
 	bool ret = false;
 	Common::Array<int> deferredActionsIds;
@@ -1018,8 +1011,10 @@ bool MacMI1Gui::runOptionsDialog() {
 		if (clicked == 1)
 			break;
 
-		if (clicked == 2)
+		if (clicked == 2) {
 			window->setWidgetEnabled(3, window->getWidgetValue(2) != 0);
+			window->setWidgetValue(3, window->getWidgetValue(2) != 0 ? 1 : 0);
+		}
 	}
 
 	if (ret) {
@@ -1031,35 +1026,17 @@ bool MacMI1Gui::runOptionsDialog() {
 		_vm->setTalkSpeed(_vm->_defaultTextSpeed);
 
 		// SOUND&MUSIC ACTIVATION
-		// 0 - Sound&Music on
-		// 1 - Sound on, music off
-		// 2 - Sound&Music off
-		int musicVariableValue = 0;
-
 		if (window->getWidgetValue(2) == 0) {
-			musicVariableValue = 2;
+			// Sound&Music off
+			// STUB
 		} else if (window->getWidgetValue(2) == 1 && window->getWidgetValue(3) == 0) {
-			musicVariableValue = 1;
-		}
-
-		_vm->VAR(167) = musicVariableValue;
-
-		if (musicVariableValue != 0) {
-			if (_vm->VAR(169) != 0) {
-				_vm->_sound->stopSound(_vm->VAR(169));
-				_vm->VAR(169) = 0;
-			}
+			// Sound on, music off
+			// STUB
+		} else {
+			// Sound&Music on
+			// STUB
 		}
 
-		// SCROLLING ACTIVATION
-		_vm->_snapScroll = window->getWidgetValue(6) == 0;
-
-		if (_vm->VAR_CAMERA_FAST_X != 0xFF)
-			_vm->VAR(_vm->VAR_CAMERA_FAST_X) = _vm->_snapScroll;
-
-		// FULL ANIMATION ACTIVATION
-		_vm->VAR(_vm->VAR_MACHINE_SPEED) = window->getWidgetValue(7) == 1 ? 0 : 1;
-
 		// MUSIC QUALITY SELECTOR
 		musicQuality = musicQuality * 3 + 1 + window->getWidgetValue(12);
 		_vm->_musicEngine->setQuality(musicQuality);


Commit: 7cb1e8905689b123f97f5cdc86a5a68c7140fa8b
    https://github.com/scummvm/scummvm/commit/7cb1e8905689b123f97f5cdc86a5a68c7140fa8b
Author: athrxx (athrxx at scummvm.org)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: add sound enable menu options (WIP)

Seems to work, but I yet have to remove the VAR(167) usage and
probably save the setting in the scummvm ini.

Changed paths:
    engines/scumm/macgui/macgui_mi1.cpp
    engines/scumm/music.h
    engines/scumm/players/player_mac_intern.h
    engines/scumm/players/player_mac_loom_monkey.cpp
    engines/scumm/players/player_mac_new.cpp


diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index 391517c33aa..170004f20ed 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -1027,14 +1027,17 @@ bool MacMI1Gui::runOptionsDialog() {
 
 		// SOUND&MUSIC ACTIVATION
 		if (window->getWidgetValue(2) == 0) {
-			// Sound&Music off
-			// STUB
+			_vm->_musicEngine->disableMusic();
+			_vm->_musicEngine->disableSoundEffects();
+			_vm->VAR(167) = 2;
 		} else if (window->getWidgetValue(2) == 1 && window->getWidgetValue(3) == 0) {
-			// Sound on, music off
-			// STUB
+			_vm->_musicEngine->disableMusic();
+			_vm->_musicEngine->enableSoundEffects();
+			_vm->VAR(167) = 1;
 		} else {
-			// Sound&Music on
-			// STUB
+			_vm->_musicEngine->enableMusic();
+			_vm->_musicEngine->enableSoundEffects();
+			_vm->VAR(167) = 0;
 		}
 
 		// MUSIC QUALITY SELECTOR
diff --git a/engines/scumm/music.h b/engines/scumm/music.h
index ba9ea607e17..a8fabbaa4ed 100644
--- a/engines/scumm/music.h
+++ b/engines/scumm/music.h
@@ -106,12 +106,14 @@ public:
 	/**
 	 * Notify player that the sound is supposed to be disabled (used for Macintosh sound)
 	 */
-	virtual void disable() {}
+	virtual void disableMusic() {}
+	virtual void disableSoundEffects() {}
 
 	/**
 	 * Notify player that the sound is supposed to be enabled (used for Macintosh sound)
 	 */
-	virtual void enable() {}
+	virtual void enableMusic() {}
+	virtual void enableSoundEffects() {}
 
 	/**
 	 * Save or load the music state.
diff --git a/engines/scumm/players/player_mac_intern.h b/engines/scumm/players/player_mac_intern.h
index 37cc4f60479..b23d729590f 100644
--- a/engines/scumm/players/player_mac_intern.h
+++ b/engines/scumm/players/player_mac_intern.h
@@ -233,8 +233,10 @@ public:
 	void setQuality(int qual);
 	void saveLoadWithSerializer(Common::Serializer &ser);
 	void restoreAfterLoad();
-	void enable() {}
-	void disable() {}
+	void enableMusic() {}
+	void disableMusic() {}
+	void enableSoundEffects() {}
+	void disableSoundEffects() {}
 
 	void vblCallback() override;
 	void generateData(int8 *dst, uint32 byteSize, Audio::Mixer::SoundType type, bool expectStereo) const override;
@@ -388,8 +390,10 @@ public:
 	void setQuality(int qual);
 	void saveLoadWithSerializer(Common::Serializer &ser);
 	void restoreAfterLoad();
-	void enable();
-	void disable();
+	void enableMusic();
+	void disableMusic();
+	void enableSoundEffects();
+	void disableSoundEffects();
 
 	void vblCallback() override;
 	void generateData(int8 *dst, uint32 byteSize, Audio::Mixer::SoundType type, bool expectStereo) const override;
@@ -402,6 +406,7 @@ private:
 	void stopActiveSound();
 	void setupChannels();
 	void disposeAllChannels();
+	void updateDisabledState();
 
 	void detectQuality();
 	bool isSoundCardType10() const;
@@ -422,6 +427,7 @@ private:
 	int _effectiveChanConfig;
 	int _defaultChanConfig;
 	bool _16bit;
+	byte _disableFlags;
 
 	MacLowLevelPCMDriver::ChanHandle _sndChannel;
 	MacLowLevelPCMDriver::ChanHandle _musChannels[4];
diff --git a/engines/scumm/players/player_mac_loom_monkey.cpp b/engines/scumm/players/player_mac_loom_monkey.cpp
index 2a9ff633d5d..0bcf42d62f3 100644
--- a/engines/scumm/players/player_mac_loom_monkey.cpp
+++ b/engines/scumm/players/player_mac_loom_monkey.cpp
@@ -412,7 +412,7 @@ const Common::SharedPtr<MacSndLoader::Instrument> *MonkeyMacSndLoader::fetchInst
 Common::WeakPtr<LoomMonkeyMacSnd> *LoomMonkeyMacSnd::_inst = nullptr;
 
 LoomMonkeyMacSnd::LoomMonkeyMacSnd(ScummEngine *vm, Audio::Mixer *mixer) : VblTaskClientDriver(), _vm(vm), _mixer(mixer), _curSound(0), _loader(nullptr),
-	_macstr(nullptr), _sdrv(nullptr), _vblTskProc(this, &VblTaskClientDriver::vblCallback), _songTimer(0), _songTimerInternal(0),
+	_macstr(nullptr), _sdrv(nullptr), _vblTskProc(this, &VblTaskClientDriver::vblCallback), _songTimer(0), _songTimerInternal(0), _disableFlags(0),
 	_machineRating(0), _selectedQuality(2), _effectiveChanConfig(0), _16bit(false), _idRangeMax(200), _sndChannel(0), _chanUse(0), _defaultChanConfig(0),
 	_chanConfigTable(nullptr), _chanPlaying(0), _curChanConfig(0), _curSynthType(0), _curSndType(Audio::Mixer::kPlainSoundType), _mixerThread(false),
 	_restartSound(0), _lastSndType(Audio::Mixer::kPlainSoundType), _chanCbProc(this, &MacLowLevelPCMDriver::CallbackClient::sndChannelCallback),
@@ -531,8 +531,12 @@ void LoomMonkeyMacSnd::startSound(int id, int jumpToTick) {
 		return;
 	}
 
-	//if (_sndDisableFlags && _loader->isMusic())
-	//	return;
+	if (_disableFlags) {
+		if (_loader->restartSoundAfterLoad())
+			_curSoundSaveVar = id;
+		if (_loader->isMusic() || (_disableFlags & 2))
+			return;
+	}
 
 	_effectiveChanConfig = _loader->getChanSetup() ? _loader->getChanSetup() : _defaultChanConfig;
 	_curSndType = _loader->isMusic() ? Audio::Mixer::kMusicSoundType : Audio::Mixer::kSFXSoundType;
@@ -641,14 +645,24 @@ void LoomMonkeyMacSnd::restoreAfterLoad() {
 		startSound(sound);
 }
 
-void LoomMonkeyMacSnd::enable() {
-	restoreAfterLoad();
+void LoomMonkeyMacSnd::enableMusic() {
+	_disableFlags &= ~1;
+	updateDisabledState();
 }
 
-void LoomMonkeyMacSnd::disable() {
-	int sound = _curSoundSaveVar;
-	stopActiveSound();
-	_curSoundSaveVar = sound;
+void LoomMonkeyMacSnd::disableMusic() {
+	_disableFlags |= 1;
+	updateDisabledState();
+}
+
+void LoomMonkeyMacSnd::enableSoundEffects() {
+	_disableFlags &= ~2;
+	updateDisabledState();
+}
+
+void LoomMonkeyMacSnd::disableSoundEffects() {
+	_disableFlags |= 2;
+	updateDisabledState();
 }
 
 void LoomMonkeyMacSnd::vblCallback() {
@@ -881,6 +895,17 @@ void LoomMonkeyMacSnd::disposeAllChannels() {
 	_curChanConfig = 0;
 }
 
+void LoomMonkeyMacSnd::updateDisabledState() {
+	if (_disableFlags == 0) {
+		if (_curSoundSaveVar)
+			startSound(_curSoundSaveVar);
+	} else {
+		int sound = _curSoundSaveVar;
+		stopActiveSound();
+		_curSoundSaveVar = sound;
+	}
+}
+
 void LoomMonkeyMacSnd::detectQuality() {
 	if (_machineRating == 0) {
 		if (!_loader->ignoreMachineRating()) {
diff --git a/engines/scumm/players/player_mac_new.cpp b/engines/scumm/players/player_mac_new.cpp
index eaf0a63dd8f..14cefd90b7a 100644
--- a/engines/scumm/players/player_mac_new.cpp
+++ b/engines/scumm/players/player_mac_new.cpp
@@ -1095,8 +1095,10 @@ public:
 	void setQuality(int qual) override;
 	void saveLoadWithSerializer(Common::Serializer &ser) override;
 	void restoreAfterLoad() override;
-	void enable() override;
-	void disable() override;
+	void enableMusic() override;
+	void disableMusic() override;
+	void enableSoundEffects() override;
+	void disableSoundEffects() override;
 
 private:
 	Common::SharedPtr<T> _player;
@@ -1158,14 +1160,24 @@ template <typename T> void MusicEngineImpl<T>::restoreAfterLoad() {
 		_player->restoreAfterLoad();
 }
 
-template <typename T> void MusicEngineImpl<T>::enable() {
+template <typename T> void MusicEngineImpl<T>::enableMusic() {
 	if (_player != nullptr)
-		_player->enable();
+		_player->enableMusic();
 }
 
-template <typename T> void MusicEngineImpl<T>::disable() {
+template <typename T> void MusicEngineImpl<T>::disableMusic() {
 	if (_player != nullptr)
-		_player->disable();
+		_player->disableMusic();
+}
+
+template <typename T> void MusicEngineImpl<T>::enableSoundEffects() {
+	if (_player != nullptr)
+		_player->enableSoundEffects();
+}
+
+template <typename T> void MusicEngineImpl<T>::disableSoundEffects() {
+	if (_player != nullptr)
+		_player->disableSoundEffects();
 }
 
 namespace MacSound {


Commit: ec135b3f14e568f40be15d638360ca23eed8447b
    https://github.com/scummvm/scummvm/commit/ec135b3f14e568f40be15d638360ca23eed8447b
Author: athrxx (athrxx at scummvm.org)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: (MI1/Mac) - finish menu option for sound enabling/disabling

Changed paths:
    engines/scumm/macgui/macgui_mi1.cpp
    engines/scumm/music.h
    engines/scumm/players/player_mac_intern.h
    engines/scumm/players/player_mac_loom_monkey.cpp
    engines/scumm/players/player_mac_new.cpp
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index 170004f20ed..2b47241f189 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -969,14 +969,8 @@ bool MacMI1Gui::runOptionsDialog() {
 	// 11 - Text speed slider (manually created)
 	// 12 - Music quality slider (manually created)
 
-	int sound = 1;
-	int music = 1;
-	if (_vm->VAR(167) == 2) {
-		sound = music = 0;
-	} else if (_vm->VAR(167) == 1) {
-		music = 0;
-	}
-
+	int sound = (!ConfMan.hasKey("mute") || !ConfMan.getBool("mute")) ? 1 : 0;
+	int music = (!ConfMan.hasKey("music_mute") || !ConfMan.getBool("music_mute")) ? 1 : 0;
 	int textSpeed = _vm->_defaultTextSpeed;
 	int musicQuality = ConfMan.hasKey("mac_snd_quality") ? ConfMan.getInt("mac_snd_quality") : 0;
 	int musicQualityOption = (musicQuality == 0) ? 1 : (musicQuality - 1) % 3;
@@ -1026,19 +1020,10 @@ bool MacMI1Gui::runOptionsDialog() {
 		_vm->setTalkSpeed(_vm->_defaultTextSpeed);
 
 		// SOUND&MUSIC ACTIVATION
-		if (window->getWidgetValue(2) == 0) {
-			_vm->_musicEngine->disableMusic();
-			_vm->_musicEngine->disableSoundEffects();
-			_vm->VAR(167) = 2;
-		} else if (window->getWidgetValue(2) == 1 && window->getWidgetValue(3) == 0) {
-			_vm->_musicEngine->disableMusic();
-			_vm->_musicEngine->enableSoundEffects();
-			_vm->VAR(167) = 1;
-		} else {
-			_vm->_musicEngine->enableMusic();
-			_vm->_musicEngine->enableSoundEffects();
-			_vm->VAR(167) = 0;
-		}
+		_vm->_musicEngine->toggleMusic(window->getWidgetValue(2) != 0 && (window->getWidgetValue(2) != 1 || window->getWidgetValue(3) != 0));
+		_vm->_musicEngine->toggleSoundEffects(window->getWidgetValue(2) != 0);
+		ConfMan.setBool("music_mute", window->getWidgetValue(2) == 0 || (window->getWidgetValue(2) == 1 && window->getWidgetValue(3) == 0));
+		ConfMan.setBool("mute", window->getWidgetValue(2) == 0);
 
 		// MUSIC QUALITY SELECTOR
 		musicQuality = musicQuality * 3 + 1 + window->getWidgetValue(12);
diff --git a/engines/scumm/music.h b/engines/scumm/music.h
index a8fabbaa4ed..9e1738461d5 100644
--- a/engines/scumm/music.h
+++ b/engines/scumm/music.h
@@ -104,16 +104,10 @@ public:
 	virtual void setQuality(int qual) {}
 
 	/**
-	 * Notify player that the sound is supposed to be disabled (used for Macintosh sound)
+	 * Notify player that the sound is supposed to be enabled/disabled (used for Macintosh sound)
 	 */
-	virtual void disableMusic() {}
-	virtual void disableSoundEffects() {}
-
-	/**
-	 * Notify player that the sound is supposed to be enabled (used for Macintosh sound)
-	 */
-	virtual void enableMusic() {}
-	virtual void enableSoundEffects() {}
+	virtual void toggleMusic(bool enable) {}
+	virtual void toggleSoundEffects(bool enable) {}
 
 	/**
 	 * Save or load the music state.
diff --git a/engines/scumm/players/player_mac_intern.h b/engines/scumm/players/player_mac_intern.h
index b23d729590f..aae032c70aa 100644
--- a/engines/scumm/players/player_mac_intern.h
+++ b/engines/scumm/players/player_mac_intern.h
@@ -233,10 +233,8 @@ public:
 	void setQuality(int qual);
 	void saveLoadWithSerializer(Common::Serializer &ser);
 	void restoreAfterLoad();
-	void enableMusic() {}
-	void disableMusic() {}
-	void enableSoundEffects() {}
-	void disableSoundEffects() {}
+	void toggleMusic(bool enable) {}
+	void toggleSoundEffects(bool enable) {}
 
 	void vblCallback() override;
 	void generateData(int8 *dst, uint32 byteSize, Audio::Mixer::SoundType type, bool expectStereo) const override;
@@ -390,10 +388,8 @@ public:
 	void setQuality(int qual);
 	void saveLoadWithSerializer(Common::Serializer &ser);
 	void restoreAfterLoad();
-	void enableMusic();
-	void disableMusic();
-	void enableSoundEffects();
-	void disableSoundEffects();
+	void toggleMusic(bool enable);
+	void toggleSoundEffects(bool enable);
 
 	void vblCallback() override;
 	void generateData(int8 *dst, uint32 byteSize, Audio::Mixer::SoundType type, bool expectStereo) const override;
@@ -415,6 +411,7 @@ private:
 	int _restartSound;
 	int _curSoundSaveVar;
 	int _songTimer;
+	bool _blocked;
 	byte _songTimerInternal;
 	byte *_chanConfigTable;
 	const int _idRangeMax;
diff --git a/engines/scumm/players/player_mac_loom_monkey.cpp b/engines/scumm/players/player_mac_loom_monkey.cpp
index 0bcf42d62f3..cfc5833bdb8 100644
--- a/engines/scumm/players/player_mac_loom_monkey.cpp
+++ b/engines/scumm/players/player_mac_loom_monkey.cpp
@@ -532,8 +532,10 @@ void LoomMonkeyMacSnd::startSound(int id, int jumpToTick) {
 	}
 
 	if (_disableFlags) {
-		if (_loader->restartSoundAfterLoad())
+		if (_loader->restartSoundAfterLoad()) {
 			_curSoundSaveVar = id;
+			_loader->unblock();
+		}
 		if (_loader->isMusic() || (_disableFlags & 2))
 			return;
 	}
@@ -645,23 +647,13 @@ void LoomMonkeyMacSnd::restoreAfterLoad() {
 		startSound(sound);
 }
 
-void LoomMonkeyMacSnd::enableMusic() {
-	_disableFlags &= ~1;
-	updateDisabledState();
-}
-
-void LoomMonkeyMacSnd::disableMusic() {
-	_disableFlags |= 1;
-	updateDisabledState();
-}
-
-void LoomMonkeyMacSnd::enableSoundEffects() {
-	_disableFlags &= ~2;
+void LoomMonkeyMacSnd::toggleMusic(bool enable) {
+	_disableFlags = enable ? _disableFlags & ~1 : _disableFlags | 1;
 	updateDisabledState();
 }
 
-void LoomMonkeyMacSnd::disableSoundEffects() {
-	_disableFlags |= 2;
+void LoomMonkeyMacSnd::toggleSoundEffects(bool enable) {
+	_disableFlags = enable ? _disableFlags & ~2 : _disableFlags | 2;
 	updateDisabledState();
 }
 
diff --git a/engines/scumm/players/player_mac_new.cpp b/engines/scumm/players/player_mac_new.cpp
index 14cefd90b7a..1063defcd0c 100644
--- a/engines/scumm/players/player_mac_new.cpp
+++ b/engines/scumm/players/player_mac_new.cpp
@@ -1095,10 +1095,8 @@ public:
 	void setQuality(int qual) override;
 	void saveLoadWithSerializer(Common::Serializer &ser) override;
 	void restoreAfterLoad() override;
-	void enableMusic() override;
-	void disableMusic() override;
-	void enableSoundEffects() override;
-	void disableSoundEffects() override;
+	void toggleMusic(bool enable) override;
+	void toggleSoundEffects(bool enable) override;
 
 private:
 	Common::SharedPtr<T> _player;
@@ -1160,24 +1158,14 @@ template <typename T> void MusicEngineImpl<T>::restoreAfterLoad() {
 		_player->restoreAfterLoad();
 }
 
-template <typename T> void MusicEngineImpl<T>::enableMusic() {
+template <typename T> void MusicEngineImpl<T>::toggleMusic(bool enable) {
 	if (_player != nullptr)
-		_player->enableMusic();
+		_player->toggleMusic(enable);
 }
 
-template <typename T> void MusicEngineImpl<T>::disableMusic() {
+template <typename T> void MusicEngineImpl<T>::toggleSoundEffects(bool enable) {
 	if (_player != nullptr)
-		_player->disableMusic();
-}
-
-template <typename T> void MusicEngineImpl<T>::enableSoundEffects() {
-	if (_player != nullptr)
-		_player->enableSoundEffects();
-}
-
-template <typename T> void MusicEngineImpl<T>::disableSoundEffects() {
-	if (_player != nullptr)
-		_player->disableSoundEffects();
+		_player->toggleSoundEffects(enable);
 }
 
 namespace MacSound {
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 7c98e8b3354..c4c70917471 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2269,6 +2269,8 @@ void ScummEngine::setupMusic(int midi) {
 			_musicEngine->setQuality(MacSound::kQualityLowest);
 		else if (ConfMan.hasKey("mac_snd_quality"))
 			_musicEngine->setQuality(ConfMan.getInt("mac_snd_quality"));
+		_musicEngine->toggleMusic(!ConfMan.hasKey("music_mute") || !ConfMan.getBool("music_mute"));
+		_musicEngine->toggleSoundEffects(!ConfMan.hasKey("mute") || !ConfMan.getBool("mute"));
 		_sound->_musicType = MDT_MACINTOSH;
 	} else if (_game.id == GID_MANIAC && _game.version == 1) {
 		_musicEngine = new Player_V1(this, _mixer, MidiDriver::getMusicType(dev) != MT_PCSPK);


Commit: f8c03575671f0dd25d36ee2983a7a9d265dc92ed
    https://github.com/scummvm/scummvm/commit/f8c03575671f0dd25d36ee2983a7a9d265dc92ed
Author: athrxx (athrxx at scummvm.org)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: remove unused var

Changed paths:
    engines/scumm/players/player_mac_intern.h


diff --git a/engines/scumm/players/player_mac_intern.h b/engines/scumm/players/player_mac_intern.h
index aae032c70aa..6d3f2a57ae5 100644
--- a/engines/scumm/players/player_mac_intern.h
+++ b/engines/scumm/players/player_mac_intern.h
@@ -411,7 +411,6 @@ private:
 	int _restartSound;
 	int _curSoundSaveVar;
 	int _songTimer;
-	bool _blocked;
 	byte _songTimerInternal;
 	byte *_chanConfigTable;
 	const int _idRangeMax;


Commit: 9d5f734a7c4314794f6a658288d3f8453a3777fe
    https://github.com/scummvm/scummvm/commit/9d5f734a7c4314794f6a658288d3f8453a3777fe
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Add initial work on MI2 About dialog

This is incomplete, but there are font rendering issues that others are
going to have to help me with, and this provides a test case. "Monkey
Island 2" is close enough that I may be able to figure it out soon, but
for "LeChuck's Revenge" the font manager picks a different font than the
one I asked for. (TTF instead of a bitmap font, I believe?)

Changed paths:
    engines/scumm/macgui/macgui_dialogwindow.cpp
    engines/scumm/macgui/macgui_impl.h
    engines/scumm/macgui/macgui_indy3.cpp
    engines/scumm/macgui/macgui_mi1.cpp


diff --git a/engines/scumm/macgui/macgui_dialogwindow.cpp b/engines/scumm/macgui/macgui_dialogwindow.cpp
index 750f7d28ed0..e2a77833f20 100644
--- a/engines/scumm/macgui/macgui_dialogwindow.cpp
+++ b/engines/scumm/macgui/macgui_dialogwindow.cpp
@@ -693,10 +693,20 @@ void MacGuiImpl::MacDialogWindow::plotPatternDarkenOnly(int x, int y, int patter
 		s->setPixel(x, y, window->_gui->getBlack());
 }
 
-void MacGuiImpl::MacDialogWindow::drawTexts(Common::Rect r, const TextLine *lines) {
+void MacGuiImpl::MacDialogWindow::drawTexts(Common::Rect r, const TextLine *lines, bool inverse) {
 	if (!lines)
 		return;
 
+	uint32 fg, bg;
+
+	if (inverse) {
+		fg = _white;
+		bg = _black;
+	} else {
+		fg = _black;
+		bg = _white;
+	}
+
 	Graphics::Surface *s = innerSurface();
 
 	for (int i = 0; lines[i].str; i++) {
@@ -717,6 +727,9 @@ void MacGuiImpl::MacDialogWindow::drawTexts(Common::Rect r, const TextLine *line
 		case kStyleBold:
 			f1 = _gui->getFont(kAboutFontBold);
 			break;
+		case kStyleBold2:
+			f1 = _gui->getFont(kAboutFontBold2);
+			break;
 		case kStyleExtraBold:
 			f1 = _gui->getFont(kAboutFontExtraBold);
 			break;
@@ -732,25 +745,35 @@ void MacGuiImpl::MacDialogWindow::drawTexts(Common::Rect r, const TextLine *line
 		int width = r.right - x;
 
 		if (lines[i].style == kStyleHeader) {
-			f1->drawString(s, msg, x - 1, y + 1, width, _black, align);
-			f2->drawString(s, msg, x + 1, y + 1, width, _black, align);
-			f1->drawString(s, msg, x - 2, y, width, _black, align);
-			f2->drawString(s, msg, x, y, width, _white, align);
+			f1->drawString(s, msg, x - 1, y + 1, width, fg, align);
+			f2->drawString(s, msg, x + 1, y + 1, width, fg, align);
+			f1->drawString(s, msg, x - 2, y, width, fg, align);
+			f2->drawString(s, msg, x, y, width, bg, align);
 		} else {
-			f1->drawString(s, msg, x, y, width, _black, align);
+			f1->drawString(s, msg, x, y, width, fg, align);
 
 			if (lines[i].style == kStyleExtraBold)
-				f1->drawString(s, msg, x + 1, y, width, _black, align);
+				f1->drawString(s, msg, x + 1, y, width, fg, align);
 		}
 	}
 }
 
-void MacGuiImpl::MacDialogWindow::drawTextBox(Common::Rect r, const TextLine *lines, int arc) {
-	Graphics::drawRoundRect(r, arc, _white, true, plotPixel, this);
-	Graphics::drawRoundRect(r, arc, _black, false, plotPixel, this);
+void MacGuiImpl::MacDialogWindow::drawTextBox(Common::Rect r, const TextLine *lines, bool inverse, int arc) {
+	uint32 fg, bg;
+
+	if (inverse) {
+		fg = _white;
+		bg = _black;
+	} else {
+		fg = _black;
+		bg = _white;
+	}
+
+	Graphics::drawRoundRect(r, arc, bg, true, plotPixel, this);
+	Graphics::drawRoundRect(r, arc, fg, false, plotPixel, this);
 	markRectAsDirty(r);
 
-	drawTexts(r, lines);
+	drawTexts(r, lines, inverse);
 }
 
 } // End of namespace Scumm
diff --git a/engines/scumm/macgui/macgui_impl.h b/engines/scumm/macgui/macgui_impl.h
index a7a42213b42..f01e4540ad0 100644
--- a/engines/scumm/macgui/macgui_impl.h
+++ b/engines/scumm/macgui/macgui_impl.h
@@ -78,6 +78,7 @@ protected:
 
 		kAboutFontRegular,
 		kAboutFontBold,
+		kAboutFontBold2,
 		kAboutFontExtraBold,
 		kAboutFontHeaderInside,
 		kAboutFontHeaderOutside,
@@ -100,6 +101,7 @@ protected:
 		kStyleHeaderSimple1,
 		kStyleHeaderSimple2,
 		kStyleBold,
+		kStyleBold2,
 		kStyleExtraBold,
 		kStyleRegular
 	};
@@ -644,8 +646,8 @@ public:
 		void fillPattern(Common::Rect r, uint16 pattern, bool fillBlack = true, bool fillWhite = true);
 		void drawSprite(const Graphics::Surface *sprite, int x, int y);
 		void drawSprite(const Graphics::Surface *sprite, int x, int y, Common::Rect clipRect);
-		void drawTexts(Common::Rect r, const TextLine *lines);
-		void drawTextBox(Common::Rect r, const TextLine *lines, int arc = 9);
+		void drawTexts(Common::Rect r, const TextLine *lines, bool inverse = false);
+		void drawTextBox(Common::Rect r, const TextLine *lines, bool inverse = false, int arc = 9);
 	};
 
 	MacGuiImpl(ScummEngine *vm, const Common::Path &resourceFile);
diff --git a/engines/scumm/macgui/macgui_indy3.cpp b/engines/scumm/macgui/macgui_indy3.cpp
index 3753a4cd847..72a3e94b364 100644
--- a/engines/scumm/macgui/macgui_indy3.cpp
+++ b/engines/scumm/macgui/macgui_indy3.cpp
@@ -1417,7 +1417,7 @@ void MacIndy3Gui::runAboutDialog() {
 				break;
 
 			case 8:
-				window->drawTextBox(Common::Rect(142, 106, 262, 119), page8, 3);
+				window->drawTextBox(Common::Rect(142, 106, 262, 119), page8, false, 3);
 				break;
 			}
 
diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index 2b47241f189..57a11bacccc 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -295,6 +295,21 @@ bool MacMI1Gui::getFontParams(FontId fontId, int &id, int &size, int &slant) con
 		size = 9;
 		slant = Graphics::kMacFontBold;
 		return true;
+	case kAboutFontBold2:
+		id = Graphics::kMacFontTimes;
+		size = 10;
+		slant = Graphics::kMacFontBold;
+		return true;
+	case kAboutFontHeaderOutside:
+		id = Graphics::kMacFontTimes;
+		size = 18;
+		slant = Graphics::kMacFontBold | Graphics::kMacFontItalic | Graphics::kMacFontOutline;
+		return true;
+	case kAboutFontHeaderInside:
+		id = Graphics::kMacFontTimes;
+		size = 18;
+		slant = Graphics::kMacFontItalic | Graphics::kMacFontBold | Graphics::kMacFontExtend;
+		return true;
 	case kAboutFontHeaderSimple1:
 		id = Graphics::kMacFontGeneva;
 		size = 12;
@@ -625,6 +640,103 @@ void MacMI1Gui::drawShadow(Graphics::Surface *s, int x, int y, int h, Common::Pa
 }
 
 void MacMI1Gui::runAboutDialogMI2() {
+	int width = 416;
+	int height = 166;
+	int x = (640 - width) / 2;
+	int y = (400 - height) / 2;
+
+	Common::Rect bounds(x, y, x + width, y + height);
+	MacDialogWindow *window = createWindow(bounds);
+//	Graphics::Surface *lucasArts = loadPict(5000);
+
+	Graphics::Surface *s = window->innerSurface();
+
+	const TextLine page3[] = {
+		{ 0, 68, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[115].c_str() }, // "PRESENTS"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page5[] = {
+		{ 0, 10, kStyleBold2, Graphics::kTextAlignCenter, _strsStrings[116].c_str() }, // "LeChuck\xD5s Revenge"
+		{ 0, 25, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[117].c_str() }, // "Monkey Island 2"
+		{ 176, 125, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[119].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company."
+		{ 310, 138, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[120].c_str() }, // "All rights reserved."
+		TEXT_END_MARKER
+	};
+
+	const TextLine page6[] = {
+		{ 0, 19, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[121].c_str() }, // "Macintosh version by
+		{ 133, 34, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[122].c_str() }, // "Eric Johnston"
+		TEXT_END_MARKER
+	};
+
+	struct AboutPage {
+		const TextLine *text;
+		int drawArea;
+		uint32 delayMs;
+	};
+
+	AboutPage aboutPages[] = {
+		{ nullptr, 0,  2800 },
+		{ nullptr, 0,   100 },
+		{ nullptr, 0,   100 },
+		{ page3,   0,  2100 },
+		{ nullptr, 0,   500 },
+		{ page5,   0,  2800 },
+		{ page6,   1,     0 },
+	};
+
+	Common::Rect drawAreas[] = {
+		Common::Rect(2, 2, s->w - 2, s->h - 2),
+		Common::Rect(10, 63, s->w - 10, s->h - 10)
+	};
+
+	int page = 0;
+
+	window->show();
+
+	uint32 black = getBlack();
+//	uint32 white = getWhite();
+
+	while (!_vm->shouldQuit() && page < ARRAYSIZE(aboutPages)) {
+		Common::Rect &drawArea = drawAreas[aboutPages[page].drawArea];
+
+		switch (page) {
+		case 0:
+			s->fillRect(drawArea, black);
+			break;
+		case 1:
+			// TODO: Verify this once the graphics work
+			window->fillPattern(drawArea, 0xEAEA, true, false);
+			break;
+		case 2:
+		case 4:
+			s->fillRect(drawArea, black);
+			break;
+		case 6:
+			s->fillRect(Common::Rect(178, 129, s->w - 2, s->h - 2), black);
+			window->markRectAsDirty(Common::Rect(178, 129, s->w - 2, s->h - 2));
+			break;
+		}
+
+		if (aboutPages[page].text) {
+			if (aboutPages[page].drawArea == 1) {
+				window->drawTextBox(drawArea, aboutPages[page].text, true);
+			} else {
+				window->drawTexts(drawArea, aboutPages[page].text, true);
+			}
+		}
+
+		if (aboutPages[page].drawArea != 1)
+			window->markRectAsDirty(drawArea);
+
+		window->update();
+		delay(aboutPages[page].delayMs);
+		page++;
+	}
+
+//	delete lucasArts;
+	delete window;
 }
 
 void MacMI1Gui::runAboutDialogIndy4() {


Commit: 90b5a73825ef3f3ad109dd5694f4a05882c2ec1c
    https://github.com/scummvm/scummvm/commit/90b5a73825ef3f3ad109dd5694f4a05882c2ec1c
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
GRAPHICS: MACGUI: Add kWMModeForceMacFonts flag

This flag prevents Mac fonts substitutions with equivalent TTF fonts.
Of course, being this a flag, it will not impact any previous game using
this. It will only impact whichever engine will decide to set it to active
(in our case, SCUMM).

Changed paths:
    graphics/macgui/macfontmanager.cpp
    graphics/macgui/macwindowmanager.h


diff --git a/graphics/macgui/macfontmanager.cpp b/graphics/macgui/macfontmanager.cpp
index 2638ab61644..997ff1605f3 100644
--- a/graphics/macgui/macfontmanager.cpp
+++ b/graphics/macgui/macfontmanager.cpp
@@ -521,7 +521,7 @@ const Font *MacFontManager::getFont(MacFont *macFont) {
 	}
 
 #ifdef USE_FREETYPE2
-	if (!font) {
+	if (!font && !(_mode & MacGUIConstants::kWMModeForceMacFonts)) {
 		if (_mode & kWMModeUnicode) {
 			if (macFont->getSize() <= 0) {
 				debugC(1, kDebugLevelMacGUI, "MacFontManager::getFont() - Font size <= 0!");
@@ -806,11 +806,13 @@ void MacFontManager::generateFontSubstitute(MacFont &macFont) {
 	Common::String name;
 
 #ifdef USE_FREETYPE2
-	// Check if we have TTF data for this font.
-	name = getFontName(macFont.getId(), 0, macFont.getSlant());
-	if (_ttfData.contains(name)) {
-		generateTTFFont(macFont, _ttfData[name]);
-		return;
+	if (!(_mode & MacGUIConstants::kWMModeForceMacFonts)) {
+		// Check if we have TTF data for this font.
+		name = getFontName(macFont.getId(), 0, macFont.getSlant());
+		if (_ttfData.contains(name)) {
+			generateTTFFont(macFont, _ttfData[name]);
+			return;
+		}
 	}
 #endif
 
diff --git a/graphics/macgui/macwindowmanager.h b/graphics/macgui/macwindowmanager.h
index 064f84c23c7..333c717ccf0 100644
--- a/graphics/macgui/macwindowmanager.h
+++ b/graphics/macgui/macwindowmanager.h
@@ -93,6 +93,7 @@ enum {
 	kWMModeForceMacFontsInWin95 = (1 << 11), // Enforce Mac font for languages which don't have glyphs in ms_sans_serif.ttf
 	kWMModeNoCursorOverride     = (1 << 12),
 	kWMModeForceMacBorder       = (1 << 13),
+	kWMModeForceMacFonts        = (1 << 14), // Enforce Mac fonts even when there are viable TTF substitutions
 };
 
 }


Commit: fd58a2b4c9fda31ef7a702983922f21d522e9e3f
    https://github.com/scummvm/scummvm/commit/fd58a2b4c9fda31ef7a702983922f21d522e9e3f
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Add kWMModeForceMacFonts flag on Mac GUI

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 07c0760f068..53c2e6f4f60 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -184,7 +184,8 @@ void MacGuiImpl::menuCallback(int id, Common::String &name, void *data) {
 }
 
 void MacGuiImpl::initialize() {
-	uint32 menuMode = Graphics::kWMModeNoDesktop | Graphics::kWMModeAutohideMenu | Graphics::kWMModalMenuMode | Graphics::kWMModeNoCursorOverride;
+	uint32 menuMode = Graphics::kWMModeNoDesktop | Graphics::kWMModeAutohideMenu |
+		Graphics::kWMModalMenuMode | Graphics::kWMModeNoCursorOverride | Graphics::kWMModeForceMacFonts;
 
 	// Allow a more modern UX: the menu doesn't close if the mouse accidentally goes outside the menu area
 	if (_vm->enhancementEnabled(kEnhUIUX))


Commit: ce721e3d62441498c17fdc122f1bdc2f6998dac0
    https://github.com/scummvm/scummvm/commit/ce721e3d62441498c17fdc122f1bdc2f6998dac0
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Add the remaining MI2 About screens

The "Monkey Island 2" title still isn't rendered correctly.

Changed paths:
    engines/scumm/macgui/macgui_mi1.cpp


diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index 57a11bacccc..76eb5012e70 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -548,43 +548,55 @@ void MacMI1Gui::runAboutDialogMI1() {
 		case 0:
 			s->fillRect(drawArea, black);
 			break;
+
 		case 1:
 			window->fillPattern(drawArea, 0xD7D7, false, true);
 			break;
+
 		case 2:
 			s->fillRect(drawArea, white);
 			break;
+
 		case 4:
 			allowMegaSkip = true;
 			s->fillRect(drawArea, white);
 			drawShadow(s, 77, 141, 2 * ARRAYSIZE(shadow1), shadow1);
 			break;
+
 		case 5:
 			drawShadow(s, 67, 140, 2 * ARRAYSIZE(shadow2), shadow2);
 			break;
+
 		case 6:
 			drawShadow(s, 52, 139, 2 * ARRAYSIZE(shadow3), shadow3);
 			break;
+
 		case 7:
 			drawShadow(s, 32, 138, 2 * ARRAYSIZE(shadow4), shadow4);
 			break;
+
 		case 8:
 			drawShadow(s, 7, 137, 2 * ARRAYSIZE(shadow5), shadow5);
 			break;
+
 		case 9:
 			// Monkeys
 			break;
+
 		case 10:
 			// Monkeys
 			break;
+
 		case 11:
 			// Monkeys (shadow still barely visible)
 			allowMegaSkip = megaSkip = false;
 			break;
+
 		case 13:
 			s->fillRect(Common::Rect(178, 127, s->w, s->h), white);
 			window->markRectAsDirty(Common::Rect(178, 127, s->w, s->h));
 			break;
+
 		default:
 			break;
 		}
@@ -657,8 +669,8 @@ void MacMI1Gui::runAboutDialogMI2() {
 	};
 
 	const TextLine page5[] = {
-		{ 0, 10, kStyleBold2, Graphics::kTextAlignCenter, _strsStrings[116].c_str() }, // "LeChuck\xD5s Revenge"
-		{ 0, 25, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[117].c_str() }, // "Monkey Island 2"
+		{ 1, 16, kStyleBold2, Graphics::kTextAlignCenter, _strsStrings[116].c_str() }, // "LeChuck\xD5s Revenge"
+		{ 1, 31, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[117].c_str() }, // "Monkey Island 2"
 		{ 176, 125, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[119].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company."
 		{ 310, 138, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[120].c_str() }, // "All rights reserved."
 		TEXT_END_MARKER
@@ -670,6 +682,61 @@ void MacMI1Gui::runAboutDialogMI2() {
 		TEXT_END_MARKER
 	};
 
+	const TextLine page7[] = {
+		{ 168, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[123].c_str() }, // "Created by"
+		{ 143, 19, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[125].c_str() }, // "Ron Gilbert"
+		{ 141, 42, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[124].c_str() }, // "Macintosh Scripting by"
+		{ 127, 57, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[126].c_str() }, // "Alric Wilmunder"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page8[] = {
+		{ 142, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[127].c_str() }, // "SCUMM Story System"
+		{ 168, 14, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[128].c_str() }, // "created by"
+		{ 68, 28, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[130].c_str() }, // "Ron Gilbert    Aric Wilmunder"
+		{ 79, 43, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[131].c_str() }, // "Brad P. Taylor    Vince Lee"
+		{ 135, 60, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[129].c_str() }, // "and"
+		{ 109, 58, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[132].c_str() }, // "        Eric Johnston"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page9[] = {
+		{ 137, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[133].c_str() }, // "Macintosh Orchestration"
+		{ 125, 19, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[135].c_str() }, // "Robin Goldstein"
+		{ 152, 42, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[134].c_str() }, // "Macintosh Testing"
+		{ 144, 57, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[136].c_str() }, // "Jo Ashburn"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page10[] = {
+		{ 2, 19, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[137].c_str() }, // "\xD2djm\xD3  Sound and Music System \xA91992 Eric Johnston
+		{ 2, 39, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[138].c_str() }, // "\xD2epx\xD3  Graphics Smoothing System \xA91992 Eric Johnson
+		{ 2, 54, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[139].c_str() }, // "Type 'rough' to see the difference."
+		TEXT_END_MARKER
+	};
+
+	const TextLine page11[] = {
+		{ 112, 9, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[140].c_str() }, // "Stumped?  Hint books are available!"
+		{ 98, 27, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[143].c_str() }, // "In the U.S. call"
+		{ 172, 27, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[141].c_str() }, // "1 (800) STAR-WARS"
+		{ 172, 37, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[145].c_str() }, // "that\xD5s  1 (800) 782-7927"
+		{ 102, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[144].c_str() }, // "In Canada call"
+		{ 172, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[142].c_str() }, // "1 (800) 828-7927"
+		TEXT_END_MARKER
+	};
+
+	const TextLine page12[] = {
+		{ 110, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[146].c_str() }, // "Need a hint NOW?  Having problems?"
+		{ 89, 19, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[149].c_str() }, // "For technical support call"
+		{ 213, 19, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[147].c_str() }, // "1 (415) 721-3333"
+		{ 145, 29, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[150].c_str() }, // "For hints call"
+		{ 213, 29, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[148].c_str() }, // "1 (900) 740-JEDI"
+		{ 88, 44, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[151].c_str() }, // "The charge for the hint line is 75\xA2 per minute."
+		{ 93, 54, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[152].c_str() }, // "(You must have your parents\xD5 permission to"
+		{ 108, 64, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[153].c_str() }, // "call this number if you are under 18.)"
+		TEXT_END_MARKER
+	};
+
 	struct AboutPage {
 		const TextLine *text;
 		int drawArea;
@@ -683,7 +750,13 @@ void MacMI1Gui::runAboutDialogMI2() {
 		{ page3,   0,  2100 },
 		{ nullptr, 0,   500 },
 		{ page5,   0,  2800 },
-		{ page6,   1,     0 },
+		{ page6,   1,  4300 },
+		{ page7,   1,  4300 },
+		{ page8,   1,  4200 },
+		{ page9,   1,  4200 },
+		{ page10,  1,  4200 },
+		{ page11,  1, 14000 },
+		{ page12,  1,     0 }
 	};
 
 	Common::Rect drawAreas[] = {
@@ -696,7 +769,6 @@ void MacMI1Gui::runAboutDialogMI2() {
 	window->show();
 
 	uint32 black = getBlack();
-//	uint32 white = getWhite();
 
 	while (!_vm->shouldQuit() && page < ARRAYSIZE(aboutPages)) {
 		Common::Rect &drawArea = drawAreas[aboutPages[page].drawArea];
@@ -705,18 +777,24 @@ void MacMI1Gui::runAboutDialogMI2() {
 		case 0:
 			s->fillRect(drawArea, black);
 			break;
+
 		case 1:
 			// TODO: Verify this once the graphics work
 			window->fillPattern(drawArea, 0xEAEA, true, false);
 			break;
+
 		case 2:
 		case 4:
 			s->fillRect(drawArea, black);
 			break;
+
 		case 6:
 			s->fillRect(Common::Rect(178, 129, s->w - 2, s->h - 2), black);
 			window->markRectAsDirty(Common::Rect(178, 129, s->w - 2, s->h - 2));
 			break;
+
+		default:
+			break;
 		}
 
 		if (aboutPages[page].text) {
@@ -828,7 +906,7 @@ void MacMI1Gui::runAboutDialogIndy4() {
 		{ 172, 27, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 1].c_str() }, // "1 (800) STAR-WARS"
 		{ 172, 37, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 5].c_str() }, // "that\xD5s  1 (800) 782-7927"
 		{ 102, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 4].c_str() }, // "In Canada call"
-		{ 172, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 2].c_str() }, // "1 (900) 740-JEDI"
+		{ 172, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 2].c_str() }, // "1 (800) 828-7927"
 		TEXT_END_MARKER
 	};
 
@@ -885,26 +963,35 @@ void MacMI1Gui::runAboutDialogIndy4() {
 		case 0:
 			s->fillRect(drawArea, black);
 			break;
+
 		case 1:
 			window->fillPattern(drawArea, 0xD7D7, false, true);
 			break;
+
 		case 2:
 			window->fillPattern(drawArea, 0x5A5A, false, true);
 			break;
+
 		case 3:
 			s->fillRect(drawArea, white);
 			break;
+
 		case 4:
 			s->fillRect(drawArea, white);
 			window->drawSprite(indianaJones, 89, 6);
 			break;
+
 		case 6:
 			s->fillRect(Common::Rect(178, 129, s->w - 2, s->h - 2), white);
 			window->markRectAsDirty(Common::Rect(178, 129, s->w - 2, s->h - 2));
 			break;
+
 		case 10:
 			aboutPages[10].text = isFloppyVersion ? page10_floppy : page10_cd;
 			break;
+
+		default:
+			break;
 		}
 
 		if (aboutPages[page].drawArea != 2)


Commit: 9d0dec6a751cd1c73b376353e6d352cd20c27325
    https://github.com/scummvm/scummvm/commit/9d0dec6a751cd1c73b376353e6d352cd20c27325
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Fix GUI colors, most noticeably in Fate of Atlantis

This one was my fault. The SCUMM engine has to notify the Mac window
manager whenver the palette changes, and I assumed that paletteColors
held the complete palette, when it's _currentPalette that does.

This means that the Mac window manager now gets the palette without
gamma correction, but that may not be such a bad thing. It's used for
color lookup and such, and gamma correction seems like just a
presentation detail that the window manager doesn't have to be aware of.

Changed paths:
    engines/scumm/macgui/macgui.cpp
    engines/scumm/macgui/macgui.h
    engines/scumm/macgui/macgui_impl.h
    engines/scumm/macgui/macgui_indy3.h
    engines/scumm/macgui/macgui_loom.h
    engines/scumm/macgui/macgui_mi1.h
    engines/scumm/palette.cpp


diff --git a/engines/scumm/macgui/macgui.cpp b/engines/scumm/macgui/macgui.cpp
index ac1e659653a..9fc9863c23d 100644
--- a/engines/scumm/macgui/macgui.cpp
+++ b/engines/scumm/macgui/macgui.cpp
@@ -56,6 +56,10 @@ MacGui::~MacGui() {
 	delete _impl;
 }
 
+int MacGui::getNumColors() const {
+	return _impl->getNumColors();
+}
+
 void MacGui::initialize() {
 	_impl->initialize();
 }
diff --git a/engines/scumm/macgui/macgui.h b/engines/scumm/macgui/macgui.h
index 51aeacd25c5..df6bf059e99 100644
--- a/engines/scumm/macgui/macgui.h
+++ b/engines/scumm/macgui/macgui.h
@@ -46,6 +46,8 @@ public:
 	MacGui(ScummEngine *vm, const Common::Path &resourceFile);
 	~MacGui();
 
+	int getNumColors() const;
+
 	void initialize();
 	void reset();
 	void update(int delta);
diff --git a/engines/scumm/macgui/macgui_impl.h b/engines/scumm/macgui/macgui_impl.h
index f01e4540ad0..e6eb4bbaaf3 100644
--- a/engines/scumm/macgui/macgui_impl.h
+++ b/engines/scumm/macgui/macgui_impl.h
@@ -656,6 +656,8 @@ public:
 	Graphics::MacWindowManager *_windowManager = nullptr;
 	bool _forceMenuClosed = false;
 
+	virtual int getNumColors() const = 0;
+
 	Graphics::Surface *surface() { return _surface; }
 	uint32 getBlack() const;
 	uint32 getWhite() const;
diff --git a/engines/scumm/macgui/macgui_indy3.h b/engines/scumm/macgui/macgui_indy3.h
index 60167d44eb7..fce72f3145a 100644
--- a/engines/scumm/macgui/macgui_indy3.h
+++ b/engines/scumm/macgui/macgui_indy3.h
@@ -45,6 +45,7 @@ public:
 	~MacIndy3Gui();
 
 	const Common::String name() const override { return "Indy"; }
+	int getNumColors() const override { return 16; }
 
 	Graphics::Surface _textArea;
 
diff --git a/engines/scumm/macgui/macgui_loom.h b/engines/scumm/macgui/macgui_loom.h
index 149c938079b..b0763737820 100644
--- a/engines/scumm/macgui/macgui_loom.h
+++ b/engines/scumm/macgui/macgui_loom.h
@@ -36,6 +36,7 @@ public:
 	~MacLoomGui();
 
 	const Common::String name() const override { return "Loom"; }
+	int getNumColors() const override { return 16; }
 
 	bool handleEvent(Common::Event event) override;
 
diff --git a/engines/scumm/macgui/macgui_mi1.h b/engines/scumm/macgui/macgui_mi1.h
index f29a18e9ff2..e8dc6963ffe 100644
--- a/engines/scumm/macgui/macgui_mi1.h
+++ b/engines/scumm/macgui/macgui_mi1.h
@@ -36,6 +36,7 @@ public:
 	~MacMI1Gui();
 
 	const Common::String name() const { return "game"; }
+	int getNumColors() const override { return 256; }
 
 	bool handleEvent(Common::Event event);
 
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index 2a999801ef5..d45c6c0ac29 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -273,9 +273,6 @@ void ScummEngine::resetPalette() {
 		}
 		setDirtyColors(0, 255);
 	}
-
-	if (_macGui)
-		_macGui->setPalette(_currentPalette, 16);
 }
 
 void ScummEngine::setPaletteFromTable(const byte *ptr, int numcolor, int index) {
@@ -1734,17 +1731,14 @@ void ScummEngine::updatePalette() {
 #endif
 
 	if (_game.platform == Common::kPlatformMacintosh && _game.heversion == 0) {
-		for (int i = 0; i < ARRAYSIZE(paletteColors); i += 3) {
+		for (int i = 0; i < 3 * num; ++i)
 			paletteColors[i] = _macGammaCorrectionLookUp[paletteColors[i]];
-			paletteColors[i + 1] = _macGammaCorrectionLookUp[paletteColors[i + 1]];
-			paletteColors[i + 2] = _macGammaCorrectionLookUp[paletteColors[i + 2]];
-		}
 	}
 
 	_system->getPaletteManager()->setPalette(paletteColors, first, num);
 
 	if (_macGui)
-		_macGui->setPalette(paletteColors, 256);
+		_macGui->setPalette(_currentPalette, _macGui->getNumColors());
 }
 
 } // End of namespace Scumm


Commit: 63fa812583e902545a1d486e35be4df3f667b658
    https://github.com/scummvm/scummvm/commit/63fa812583e902545a1d486e35be4df3f667b658
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Initial implementation of the "rough" command

Changed paths:
    engines/scumm/macgui/macgui_mi1.cpp
    engines/scumm/macgui/macgui_mi1.h


diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index 76eb5012e70..9870e4ba315 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -1252,6 +1252,24 @@ bool MacMI1Gui::handleEvent(Common::Event event) {
 	if (_vm->_userPut <= 0)
 		return false;
 
+	const char *rough = "rough";
+
+	if (event.type == Common::EVENT_KEYDOWN) {
+		if (event.kbd.keycode == rough[_roughProgress]) {
+			_roughProgress++;
+			if (_roughProgress >= strlen(rough)) {
+				if (_vm->_useMacGraphicsSmoothing && !_roughWarned) {
+					// TODO: Show warning dialog
+					_roughWarned = true;
+				}
+				_vm->mac_toggleSmoothing();
+				_roughProgress = 0;
+			}
+		} else {
+			_roughProgress = 0;
+		}
+	}
+
 	return false;
 }
 
diff --git a/engines/scumm/macgui/macgui_mi1.h b/engines/scumm/macgui/macgui_mi1.h
index e8dc6963ffe..ee3e0783833 100644
--- a/engines/scumm/macgui/macgui_mi1.h
+++ b/engines/scumm/macgui/macgui_mi1.h
@@ -60,6 +60,9 @@ protected:
 	void readStrings() override;
 
 private:
+	uint _roughProgress = 0;
+	bool _roughWarned = false;
+
 	void runAboutDialogMI1();
 	void runAboutDialogMI2();
 	void runAboutDialogIndy4();


Commit: 252ff4c831ee0a16dcdb4fe7f8f6d67f6e18d819
    https://github.com/scummvm/scummvm/commit/252ff4c831ee0a16dcdb4fe7f8f6d67f6e18d819
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: INDY4: Admit more executable names

These are executables found on LucasFilm Games
support page.

Changed paths:
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index c4c70917471..d2eb46b710c 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1270,7 +1270,12 @@ Common::Error ScummEngine::init() {
 				"Fate of Atlantis 1.1",
 				"Fate_of_Atlantis_1.1",
 				"Indy Fate",
-				"Indy_Fate"
+				"Indy_Fate",
+				"fate_v1.5",
+				"Indy 12/15/92",
+				"Indy_12/15/92",
+				"Fate of Atlantis v1.5",
+				"Fate_of_Atlantis_v1.5"
 			};
 
 			for (int i = 0; i < ARRAYSIZE(indy4FileNames); i++) {


Commit: 70ca4bd346751213173ec72d47ff1620c89ebdbd
    https://github.com/scummvm/scummvm/commit/70ca4bd346751213173ec72d47ff1620c89ebdbd
Author: athrxx (athrxx at scummvm.org)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: (Loom/Mac) - make sound toggle widget use ConfMan settings

(and other fixes to make this work properly)

Changed paths:
    engines/scumm/macgui/macgui_loom.cpp
    engines/scumm/players/player_mac_intern.h
    engines/scumm/players/player_mac_loom_monkey.cpp


diff --git a/engines/scumm/macgui/macgui_loom.cpp b/engines/scumm/macgui/macgui_loom.cpp
index 940742d0451..472a4a717d0 100644
--- a/engines/scumm/macgui/macgui_loom.cpp
+++ b/engines/scumm/macgui/macgui_loom.cpp
@@ -738,13 +738,8 @@ bool MacLoomGui::runOptionsDialog() {
 	// 11 - Text speed slider (manually created)
 	// 12 - Music quality slider (manually created)
 
-	int sound = 1;
-	int music = 1;
-	if (_vm->VAR(167) == 2) {
-		sound = music = 0;
-	} else if (_vm->VAR(167) == 1) {
-		music = 0;
-	}
+	int sound = (!ConfMan.hasKey("mute") || !ConfMan.getBool("mute")) ? 1 : 0;
+	int music = (!ConfMan.hasKey("music_mute") || !ConfMan.getBool("music_mute")) ? 1 : 0;
 
 	int scrolling = _vm->_snapScroll == 0;
 	int fullAnimation = _vm->VAR(_vm->VAR_MACHINE_SPEED) == 1 ? 0 : 1;
@@ -805,20 +800,15 @@ bool MacLoomGui::runOptionsDialog() {
 		// 2 - Sound&Music off
 		int musicVariableValue = 0;
 
-		if (window->getWidgetValue(2) == 0) {
+		if (window->getWidgetValue(2) == 0)
 			musicVariableValue = 2;
-		} else if (window->getWidgetValue(2) == 1 && window->getWidgetValue(3) == 0) {
+		else if (window->getWidgetValue(2) == 1 && window->getWidgetValue(3) == 0)
 			musicVariableValue = 1;
-		}
-
-		_vm->VAR(167) = musicVariableValue;
 
-		if (musicVariableValue != 0) {
-			if (_vm->VAR(169) != 0) {
-				_vm->_sound->stopSound(_vm->VAR(169));
-				_vm->VAR(169) = 0;
-			}
-		}
+		_vm->_musicEngine->toggleMusic(musicVariableValue == 0);
+		_vm->_musicEngine->toggleSoundEffects(musicVariableValue < 2);
+		ConfMan.setBool("music_mute", musicVariableValue > 0);
+		ConfMan.setBool("mute", musicVariableValue == 2);
 
 		// SCROLLING ACTIVATION
 		_vm->_snapScroll = window->getWidgetValue(6) == 0;
diff --git a/engines/scumm/players/player_mac_intern.h b/engines/scumm/players/player_mac_intern.h
index 6d3f2a57ae5..660d567e83d 100644
--- a/engines/scumm/players/player_mac_intern.h
+++ b/engines/scumm/players/player_mac_intern.h
@@ -410,6 +410,7 @@ private:
 	int _curSound;
 	int _restartSound;
 	int _curSoundSaveVar;
+	int &_checkSound;
 	int _songTimer;
 	byte _songTimerInternal;
 	byte *_chanConfigTable;
diff --git a/engines/scumm/players/player_mac_loom_monkey.cpp b/engines/scumm/players/player_mac_loom_monkey.cpp
index cfc5833bdb8..1456ae2d5fd 100644
--- a/engines/scumm/players/player_mac_loom_monkey.cpp
+++ b/engines/scumm/players/player_mac_loom_monkey.cpp
@@ -110,7 +110,7 @@ public:
 	bool parseNextEvent(uint16 chan, uint16 &duration, uint8 &note, bool &skip, bool &updateInstr) override;
 	uint16 getChanSetup() const override { return _chanSetup; }
 	bool isMusic() const override { return (_chanSetup == 0); }
-	bool restartSoundAfterLoad() const override { return true; }
+	bool restartSoundAfterLoad() const override { return isMusic(); }
 	bool ignoreMachineRating() const override { return false; }
 private:
 	const Common::SharedPtr<Instrument> *fetchInstrument(uint16 id) const;
@@ -416,7 +416,8 @@ LoomMonkeyMacSnd::LoomMonkeyMacSnd(ScummEngine *vm, Audio::Mixer *mixer) : VblTa
 	_machineRating(0), _selectedQuality(2), _effectiveChanConfig(0), _16bit(false), _idRangeMax(200), _sndChannel(0), _chanUse(0), _defaultChanConfig(0),
 	_chanConfigTable(nullptr), _chanPlaying(0), _curChanConfig(0), _curSynthType(0), _curSndType(Audio::Mixer::kPlainSoundType), _mixerThread(false),
 	_restartSound(0), _lastSndType(Audio::Mixer::kPlainSoundType), _chanCbProc(this, &MacLowLevelPCMDriver::CallbackClient::sndChannelCallback),
-	_curSoundSaveVar(0), _saveVersionChange(vm->_game.id == GID_MONKEY ? 115 : 114), _legacySaveUnits(vm->_game.id == GID_MONKEY ? 3 : 5) {
+	_curSoundSaveVar(0), _saveVersionChange(vm->_game.id == GID_MONKEY ? 115 : 114), _legacySaveUnits(vm->_game.id == GID_MONKEY ? 3 : 5),
+	_checkSound(vm->_game.id == GID_MONKEY ? _curSound : _curSoundSaveVar) { 
 	assert(_vm);
 	assert(_mixer);
 
@@ -519,7 +520,8 @@ void LoomMonkeyMacSnd::startSound(int id, int jumpToTick) {
 	if (_loader->blocked(ptr, size))
 		return;
 
-	stopActiveSound();
+	if (_curSound)
+		stopActiveSound();
 	if (_chanUse <= 1)
 		disposeAllChannels();
 
@@ -586,7 +588,7 @@ int LoomMonkeyMacSnd::getSoundStatus(int id) const {
 		return 0;
 	}
 	Common::StackLock lock(_mixer->mutex());
-	return (_curSound == id) ? 1 : 0;
+	return (_checkSound == id) ? 1 : 0;
 }
 
 void LoomMonkeyMacSnd::setQuality(int qual) {


Commit: c3934602bc4ca22423c103f0a12eb99613f41ed5
    https://github.com/scummvm/scummvm/commit/c3934602bc4ca22423c103f0a12eb99613f41ed5
Author: athrxx (athrxx at scummvm.org)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: (Indy3/Mac) - fix menu sound toggle options

Changed paths:
    engines/scumm/macgui/macgui_indy3.cpp
    engines/scumm/players/player_mac_indy3.cpp
    engines/scumm/players/player_mac_intern.h
    engines/scumm/players/player_mac_loom_monkey.cpp


diff --git a/engines/scumm/macgui/macgui_indy3.cpp b/engines/scumm/macgui/macgui_indy3.cpp
index 72a3e94b364..6a65cb652aa 100644
--- a/engines/scumm/macgui/macgui_indy3.cpp
+++ b/engines/scumm/macgui/macgui_indy3.cpp
@@ -32,6 +32,7 @@
 #include "scumm/dialogs.h"
 #include "scumm/macgui/macgui_impl.h"
 #include "scumm/macgui/macgui_indy3.h"
+#include "scumm/music.h"
 #include "scumm/sound.h"
 #include "scumm/verbs.h"
 
@@ -1590,9 +1591,8 @@ bool MacIndy3Gui::runOptionsDialog() {
 	// 8 - Scrolling checkbox
 	// 9 - Text speed slider (manually created)
 
-	int sound = _vm->_mixer->isSoundTypeMuted(Audio::Mixer::SoundType::kSFXSoundType) ? 0 : 1;
-	int music = _vm->_mixer->isSoundTypeMuted(Audio::Mixer::SoundType::kPlainSoundType) ? 0 : 1;
-
+	int sound = (!ConfMan.hasKey("mute") || !ConfMan.getBool("mute")) ? 1 : 0;
+	int music = (!ConfMan.hasKey("music_mute") || !ConfMan.getBool("music_mute")) ? 1 : 0;
 	int scrolling = _vm->_snapScroll == 0;
 	int textSpeed = _vm->_defaultTextSpeed;
 
@@ -1636,7 +1636,6 @@ bool MacIndy3Gui::runOptionsDialog() {
 		_vm->_defaultTextSpeed = CLIP<int>(window->getWidgetValue(9), 0, 9);
 		ConfMan.setInt("original_gui_text_speed", _vm->_defaultTextSpeed);
 		_vm->setTalkSpeed(_vm->_defaultTextSpeed);
-		_vm->syncSoundSettings();
 
 		// SOUND&MUSIC ACTIVATION
 		// 0 - Sound&Music on
@@ -1644,13 +1643,17 @@ bool MacIndy3Gui::runOptionsDialog() {
 		// 2 - Sound&Music off
 		bool disableSound = window->getWidgetValue(2) == 0;
 		bool disableMusic = window->getWidgetValue(3) == 0;
-		_vm->_mixer->muteSoundType(Audio::Mixer::SoundType::kSFXSoundType, disableSound);
-		_vm->_mixer->muteSoundType(Audio::Mixer::SoundType::kPlainSoundType, disableMusic || disableSound);
-
-		// SCROLLING ACTIVATION
-		_vm->_snapScroll = window->getWidgetValue(8) == 0;
 
+		_vm->_musicEngine->toggleMusic(!disableMusic);
+		_vm->_musicEngine->toggleSoundEffects(!disableSound);
+		ConfMan.setBool("music_mute", disableMusic);
+		ConfMan.setBool("mute", disableSound);
 		ConfMan.flushToDisk();
+
+		_vm->syncSoundSettings();
+
+		// SCROLLING ACTIVATION
+		_vm->_snapScroll = window->getWidgetValue(8) == 0;		
 	}
 
 	delete window;
diff --git a/engines/scumm/players/player_mac_indy3.cpp b/engines/scumm/players/player_mac_indy3.cpp
index c9bbb424ce6..6b65f99acb0 100644
--- a/engines/scumm/players/player_mac_indy3.cpp
+++ b/engines/scumm/players/player_mac_indy3.cpp
@@ -335,7 +335,7 @@ Indy3MacSnd::Indy3MacSnd(ScummEngine *vm, Audio::Mixer *mixer) : VblTaskClientDr
 	_vm(vm), _mixer(mixer), _musicChannels(nullptr), _curSound(0), _curSong(0), _lastSoundEffectPrio(0), _idRangeMax(86), _soundEffectNumLoops(-1),
 	_musicIDTable(nullptr), _macstr(nullptr), _musicIDTableLen(0), _soundUsage(0), _mdrv(nullptr), _sdrv(nullptr), _nextTickProc(this, &VblTaskClientDriver::vblCallback),
 	_soundEffectPlaying(false), _songTimer(0), _songTimerInternal(0), _qmode(0), _16bit(false), _qualHi(false),	_mixerThread(false), _activeChanCount(0),
-	_songUnfinished(false), _numMusicChannels(8), _numMusicTracks(4), _sfxChan(0) {
+	_songUnfinished(false), _numMusicChannels(8), _numMusicTracks(4), _sfxChan(0), _disableFlags(0), _soundEffectReschedule(false) {
 	assert(_vm);
 	assert(_mixer);
 
@@ -529,6 +529,27 @@ void Indy3MacSnd::restoreAfterLoad() {
 			startSound(i);
 		}
 	}
+	_soundEffectReschedule = true;
+}
+
+void Indy3MacSnd::toggleMusic(bool enable) {
+	if ((_disableFlags & 1) == (enable ? 0 : 1))
+		return;
+	if (enable)
+		_mdrv->start();
+	else
+		_mdrv->stop();
+	_disableFlags ^= 1;
+}
+
+void Indy3MacSnd::toggleSoundEffects(bool enable) {
+	if ((_disableFlags & 2) == (enable ? 0 : 2))
+		return;
+	if (enable)
+		_soundEffectReschedule = true;
+	else
+		stopSoundEffect();
+	_disableFlags ^= 2;
 }
 
 void Indy3MacSnd::vblCallback() {
@@ -539,7 +560,7 @@ void Indy3MacSnd::vblCallback() {
 
 	_mixerThread = true;
 
-	if (!_curSong && (_sdrv->getChannelStatus(_sfxChan) & MacSoundDriver::kStatusDone))
+	if (!_curSong && ((_sdrv->getChannelStatus(_sfxChan) & MacSoundDriver::kStatusDone) || _soundEffectReschedule))
 		updateSoundEffect();
 	else if (_curSong)
 		updateSong();
@@ -641,12 +662,15 @@ void Indy3MacSnd::startSoundEffect(int id) {
 	}
 
 	stopActiveSound();
-	_soundEffectPlaying = true;
 
 	// Two-byte prio always gets through.
 	_lastSoundEffectPrio = prio & 0xff;
 	_soundEffectNumLoops = (int8)ptr[27];
 
+	_soundUsage[id]++;
+	if (_disableFlags & 2)
+		return;
+
 	int offs = (READ_BE_UINT16(ptr + 14) >= READ_BE_UINT16(ptr + 12)) ? 2 : 0;
 	uint16 numSamples = READ_BE_UINT16(ptr + 12 + offs);
 	uint16 spos = READ_BE_UINT16(ptr + 8 + offs);
@@ -673,7 +697,7 @@ void Indy3MacSnd::startSoundEffect(int id) {
 	}
 
 	_curSound = id;
-	_soundUsage[id]++;
+	_soundEffectPlaying = true;
 }
 
 void Indy3MacSnd::stopSong() {
@@ -716,6 +740,9 @@ void Indy3MacSnd::updateSong() {
 					_musicChannels[ii]->nextTick();
 			}
 
+			if (_disableFlags)
+				break;
+
 			if (_qualHi) {
 				for (int i = 0; i < _mdrv->numChannels(); ++i)
 					_mdrv->send(LegacyMusicDriver::kChanRate, i, _curSong ? _musicChannels[i]->checkPeriod() : 0);
@@ -736,6 +763,7 @@ void Indy3MacSnd::updateSong() {
 void Indy3MacSnd::updateSoundEffect() {
 	_sdrv->clearChannelFlags(_sfxChan, MacSoundDriver::kStatusDone);
 	bool chkRestart = false;
+	_soundEffectReschedule = false;
 
 	if (!_soundEffectPlaying || !_curSound) {
 		chkRestart = true;
diff --git a/engines/scumm/players/player_mac_intern.h b/engines/scumm/players/player_mac_intern.h
index 660d567e83d..de1538c8723 100644
--- a/engines/scumm/players/player_mac_intern.h
+++ b/engines/scumm/players/player_mac_intern.h
@@ -60,10 +60,9 @@ public:
 	};
 
 	void clearFlags(uint8 flags, Audio::Mixer::SoundType sndType = Audio::Mixer::kPlainSoundType) { _status[sndType].flags &= ~flags; }
-
-protected:
 	void setFlags(uint8 flags, Audio::Mixer::SoundType sndType = Audio::Mixer::kPlainSoundType) { _status[sndType].flags |= flags; }
 
+protected:
 	Common::Mutex &_mutex;
 	const int _smpSize;
 	const int16 _smpMin;
@@ -233,8 +232,8 @@ public:
 	void setQuality(int qual);
 	void saveLoadWithSerializer(Common::Serializer &ser);
 	void restoreAfterLoad();
-	void toggleMusic(bool enable) {}
-	void toggleSoundEffects(bool enable) {}
+	void toggleMusic(bool enable);
+	void toggleSoundEffects(bool enable);
 
 	void vblCallback() override;
 	void generateData(int8 *dst, uint32 byteSize, Audio::Mixer::SoundType type, bool expectStereo) const override;
@@ -265,8 +264,10 @@ private:
 	uint _activeChanCount;
 	byte _songTimerInternal;
 	byte *_soundUsage;
+	byte _disableFlags;
 
 	bool _soundEffectPlaying;
+	bool _soundEffectReschedule;
 	int _qmode;
 	bool _16bit;
 	bool _qualHi;
diff --git a/engines/scumm/players/player_mac_loom_monkey.cpp b/engines/scumm/players/player_mac_loom_monkey.cpp
index 1456ae2d5fd..ce958bc7bc7 100644
--- a/engines/scumm/players/player_mac_loom_monkey.cpp
+++ b/engines/scumm/players/player_mac_loom_monkey.cpp
@@ -650,12 +650,16 @@ void LoomMonkeyMacSnd::restoreAfterLoad() {
 }
 
 void LoomMonkeyMacSnd::toggleMusic(bool enable) {
-	_disableFlags = enable ? _disableFlags & ~1 : _disableFlags | 1;
+	if ((_disableFlags & 1) == (enable ? 0 : 1))
+		return;
+	_disableFlags ^= 1;
 	updateDisabledState();
 }
 
 void LoomMonkeyMacSnd::toggleSoundEffects(bool enable) {
-	_disableFlags = enable ? _disableFlags & ~2 : _disableFlags | 2;
+	if ((_disableFlags & 2) == (enable ? 0 : 2))
+		return;
+	_disableFlags ^= 2;
 	updateDisabledState();
 }
 


Commit: d63e086a51731ec29b223c7531826079b69f0ee4
    https://github.com/scummvm/scummvm/commit/d63e086a51731ec29b223c7531826079b69f0ee4
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Finish up the "rough" command

Of course, we have to verify that it's using the right string for all
known versions of the games, but others are working on that. This is
good enough for the ones I own.

Changed paths:
    engines/scumm/macgui/macgui_mi1.cpp


diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index 9870e4ba315..13f07ff3977 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -1249,27 +1249,48 @@ bool MacMI1Gui::handleEvent(Common::Event event) {
 	if (_vm->isPaused())
 		return false;
 
-	if (_vm->_userPut <= 0)
-		return false;
-
 	const char *rough = "rough";
 
 	if (event.type == Common::EVENT_KEYDOWN) {
 		if (event.kbd.keycode == rough[_roughProgress]) {
 			_roughProgress++;
 			if (_roughProgress >= strlen(rough)) {
+				_roughProgress = 0;
 				if (_vm->_useMacGraphicsSmoothing && !_roughWarned) {
-					// TODO: Show warning dialog
 					_roughWarned = true;
+
+					Common::String warnString;
+
+					switch (_vm->_game.id) {
+					case GID_MONKEY2:
+						warnString = _strsStrings[98];
+						break;
+
+					case GID_INDY4:
+						if (_vm->_game.variant && !strcmp(_vm->_game.variant, "Floppy"))
+							warnString = _strsStrings[96];
+						else
+							warnString = _strsStrings[213];
+						break;
+
+					default:
+						warnString = "Warning: The 'rough' command will make your Mac screen look dangerously like a PC.  (eek!)";
+						break;
+					}
+
+					if (!runOkCancelDialog(warnString))
+						return false;
 				}
 				_vm->mac_toggleSmoothing();
-				_roughProgress = 0;
 			}
 		} else {
 			_roughProgress = 0;
 		}
 	}
 
+	if (_vm->_userPut <= 0)
+		return false;
+
 	return false;
 }
 


Commit: f3e1a1f697190af64f6120c4731ef2a7dbe50784
    https://github.com/scummvm/scummvm/commit/f3e1a1f697190af64f6120c4731ef2a7dbe50784
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Moved some common code into runAboutDialog()

Changed paths:
    engines/scumm/macgui/macgui_mi1.cpp
    engines/scumm/macgui/macgui_mi1.h


diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index 13f07ff3977..e63c00a8bbd 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -377,29 +377,32 @@ bool MacMI1Gui::handleMenu(int id, Common::String &name) {
 }
 
 void MacMI1Gui::runAboutDialog() {
+	int width = 416;
+	int height = 166;
+	int x = (640 - width) / 2;
+	int y = (400 - height) / 2;
+
+	Common::Rect bounds(x, y, x + width, y + height);
+	MacDialogWindow *window = createWindow(bounds);
+
 	switch (_vm->_game.id) {
 	case GID_MONKEY:
-		runAboutDialogMI1();
+		runAboutDialogMI1(window);
 		break;
 	case GID_MONKEY2:
-		runAboutDialogMI2();
+		runAboutDialogMI2(window);
 		break;
 	case GID_INDY4:
-		runAboutDialogIndy4();
+		runAboutDialogIndy4(window);
 		break;
 	default:
 		break;
 	}
-}
 
-void MacMI1Gui::runAboutDialogMI1() {
-	int width = 416;
-	int height = 166;
-	int x = (640 - width) / 2;
-	int y = (400 - height) / 2;
+	delete window;
+}
 
-	Common::Rect bounds(x, y, x + width, y + height);
-	MacDialogWindow *window = createWindow(bounds);
+void MacMI1Gui::runAboutDialogMI1(MacDialogWindow *window) {
 //	Graphics::Surface *lucasArts = loadPict(5000);
 //	Graphics::Surface *monkeys = loadPict(5001);
 
@@ -464,12 +467,6 @@ void MacMI1Gui::runAboutDialogMI1() {
 		TEXT_END_MARKER
 	};
 
-	struct AboutPage {
-		const TextLine *text;
-		int drawArea;
-		uint32 delayMs;
-	};
-
 	AboutPage aboutPages[] = {
 		{ nullptr, 0,  3600 },
 		{ nullptr, 0,   100 },
@@ -624,7 +621,6 @@ void MacMI1Gui::runAboutDialogMI1() {
 
 //	delete lucasArts;
 //	delete monkeys;
-	delete window;
 }
 
 void MacMI1Gui::drawShadow(Graphics::Surface *s, int x, int y, int h, Common::Pair<int, int> *drawData) {
@@ -651,18 +647,11 @@ void MacMI1Gui::drawShadow(Graphics::Surface *s, int x, int y, int h, Common::Pa
 	}
 }
 
-void MacMI1Gui::runAboutDialogMI2() {
-	int width = 416;
-	int height = 166;
-	int x = (640 - width) / 2;
-	int y = (400 - height) / 2;
+void MacMI1Gui::runAboutDialogMI2(MacDialogWindow *window) {
+	Graphics::Surface *s = window->innerSurface();
 
-	Common::Rect bounds(x, y, x + width, y + height);
-	MacDialogWindow *window = createWindow(bounds);
 //	Graphics::Surface *lucasArts = loadPict(5000);
 
-	Graphics::Surface *s = window->innerSurface();
-
 	const TextLine page3[] = {
 		{ 0, 68, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[115].c_str() }, // "PRESENTS"
 		TEXT_END_MARKER
@@ -737,12 +726,6 @@ void MacMI1Gui::runAboutDialogMI2() {
 		TEXT_END_MARKER
 	};
 
-	struct AboutPage {
-		const TextLine *text;
-		int drawArea;
-		uint32 delayMs;
-	};
-
 	AboutPage aboutPages[] = {
 		{ nullptr, 0,  2800 },
 		{ nullptr, 0,   100 },
@@ -814,24 +797,16 @@ void MacMI1Gui::runAboutDialogMI2() {
 	}
 
 //	delete lucasArts;
-	delete window;
 }
 
-void MacMI1Gui::runAboutDialogIndy4() {
+void MacMI1Gui::runAboutDialogIndy4(MacDialogWindow *window) {
 	bool isFloppyVersion = _vm->_game.variant && !strcmp(_vm->_game.variant, "Floppy");
 
-	int width = 416;
-	int height = 166;
-	int x = (640 - width) / 2;
-	int y = (400 - height) / 2;
+	Graphics::Surface *s = window->innerSurface();
 
-	Common::Rect bounds(x, y, x + width, y + height);
-	MacDialogWindow *window = createWindow(bounds);
 //	Graphics::Surface *lucasArts = loadPict(5000);
 	Graphics::Surface *indianaJones = loadPict(5001);
 
-	Graphics::Surface *s = window->innerSurface();
-
 	int baseString = isFloppyVersion ? 119 : 236;
 	int baseString2 = isFloppyVersion ? 142 : 258;
 
@@ -922,12 +897,6 @@ void MacMI1Gui::runAboutDialogIndy4() {
 		TEXT_END_MARKER
 	};
 
-	struct AboutPage {
-		const TextLine *text;
-		int drawArea;
-		uint32 delayMs;
-	};
-
 	AboutPage aboutPages[] = {
 		{ nullptr, 0,  2800 },
 		{ nullptr, 0,   100 },
@@ -1015,7 +984,6 @@ void MacMI1Gui::runAboutDialogIndy4() {
 
 //	delete lucasArts;
 	delete indianaJones;
-	delete window;
 }
 
 // A standard file picker dialog doesn't really make sense in ScummVM, so we
diff --git a/engines/scumm/macgui/macgui_mi1.h b/engines/scumm/macgui/macgui_mi1.h
index ee3e0783833..ad59e7c049d 100644
--- a/engines/scumm/macgui/macgui_mi1.h
+++ b/engines/scumm/macgui/macgui_mi1.h
@@ -60,12 +60,18 @@ protected:
 	void readStrings() override;
 
 private:
+	struct AboutPage {
+		const TextLine *text;
+		int drawArea;
+		uint32 delayMs;
+	};
+
 	uint _roughProgress = 0;
 	bool _roughWarned = false;
 
-	void runAboutDialogMI1();
-	void runAboutDialogMI2();
-	void runAboutDialogIndy4();
+	void runAboutDialogMI1(MacDialogWindow *window);
+	void runAboutDialogMI2(MacDialogWindow *window);
+	void runAboutDialogIndy4(MacDialogWindow *window);
 
 	void drawShadow(Graphics::Surface *s, int x, int y, int h, Common::Pair<int, int> *drawData);
 };


Commit: 93b9e2313027d9b28b519ab5dd0414115c10e817
    https://github.com/scummvm/scummvm/commit/93b9e2313027d9b28b519ab5dd0414115c10e817
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Fix Mac PICT hardcoded black and white colors

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 53c2e6f4f60..5d11c08868c 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -616,7 +616,7 @@ Graphics::Surface *MacGuiImpl::loadPict(int id) {
 		s->create(s1->w, s1->h, Graphics::PixelFormat::createFormatCLUT8());
 
 		byte paletteMap[256];
-
+		memset(paletteMap, 0, ARRAYSIZE(paletteMap));
 
 		for (int i = 0; i < pict.getPaletteColorCount(); i++) {
 			int r = palette[3 * i];
@@ -628,7 +628,7 @@ Graphics::Surface *MacGuiImpl::loadPict(int id) {
 		}
 
 		if (!pict.getPaletteColorCount()) {
-			paletteMap[255] = getBlack();
+			paletteMap[15] = getBlack();
 			paletteMap[0] = getWhite();
 		}
 


Commit: 0b02574b02405245166a2051e0daa3d5d288aa6b
    https://github.com/scummvm/scummvm/commit/0b02574b02405245166a2051e0daa3d5d288aa6b
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Add the monkey graphics to the MI1 About dialog

Changed paths:
    engines/scumm/macgui/macgui_mi1.cpp


diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index e63c00a8bbd..efbd81c777a 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -404,7 +404,7 @@ void MacMI1Gui::runAboutDialog() {
 
 void MacMI1Gui::runAboutDialogMI1(MacDialogWindow *window) {
 //	Graphics::Surface *lucasArts = loadPict(5000);
-//	Graphics::Surface *monkeys = loadPict(5001);
+	Graphics::Surface *monkeys = loadPict(5001);
 
 	Graphics::Surface *s = window->innerSurface();
 
@@ -538,12 +538,15 @@ void MacMI1Gui::runAboutDialogMI1(MacDialogWindow *window) {
 
 	window->show();
 
+	Common::Rect monkeysRect(monkeys->w, monkeys->h);
+
 	while (!_vm->shouldQuit() && page < ARRAYSIZE(aboutPages)) {
 		Common::Rect &drawArea = drawAreas[aboutPages[page].drawArea];
 
 		switch (page) {
 		case 0:
 			s->fillRect(drawArea, black);
+//			window->drawSprite(lucasArts, 0, 0, drawArea);
 			break;
 
 		case 1:
@@ -577,15 +580,20 @@ void MacMI1Gui::runAboutDialogMI1(MacDialogWindow *window) {
 			break;
 
 		case 9:
-			// Monkeys
+			monkeysRect.moveTo(2, 18);
+			window->drawSprite(monkeys, monkeysRect.left, monkeysRect.top);
 			break;
 
 		case 10:
-			// Monkeys
+			s->fillRect(monkeysRect, white);
+			monkeysRect.moveTo(2, 36);
+			s->fillRect(Common::Rect(monkeysRect.left, monkeysRect.top + monkeys->h, monkeysRect.left + monkeys->w, 146), white);
+			window->drawSprite(monkeys, monkeysRect.left, monkeysRect.top);
 			break;
 
 		case 11:
-			// Monkeys (shadow still barely visible)
+			s->fillRect(monkeysRect, white);
+			window->drawSprite(monkeys, 2, 54, drawArea);
 			allowMegaSkip = megaSkip = false;
 			break;
 
@@ -620,7 +628,7 @@ void MacMI1Gui::runAboutDialogMI1(MacDialogWindow *window) {
 	}
 
 //	delete lucasArts;
-//	delete monkeys;
+	delete monkeys;
 }
 
 void MacMI1Gui::drawShadow(Graphics::Surface *s, int x, int y, int h, Common::Pair<int, int> *drawData) {


Commit: ae795675fe4543ce3f9be6bbf1e6ba07a863e06a
    https://github.com/scummvm/scummvm/commit/ae795675fe4543ce3f9be6bbf1e6ba07a863e06a
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Rework Mac STRS handling

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/macgui/macgui_impl.h
    engines/scumm/macgui/macgui_indy3.cpp
    engines/scumm/macgui/macgui_indy3.h
    engines/scumm/macgui/macgui_loom.cpp
    engines/scumm/macgui/macgui_loom.h
    engines/scumm/macgui/macgui_mi1.cpp
    engines/scumm/macgui/macgui_mi1.h


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 5d11c08868c..77b7105a604 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -210,20 +210,17 @@ void MacGuiImpl::initialize() {
 			{ 0, nullptr, 0, 0, false }
 		};
 
-		Common::String aboutMenuDef;
+		Common::String aboutMenuDef = _strsStrings[kMSIAboutGameName].c_str();
 		int maxMenu = -1;
 		switch (_vm->_game.id) {
 		case GID_INDY3:
 		case GID_LOOM:
-			aboutMenuDef = _strsStrings[11].c_str();
 			maxMenu = 130;
 			break;
 		case GID_MONKEY:
-			aboutMenuDef = _strsStrings[94].c_str();
 			maxMenu = 131;
 			break;
 		default:
-			aboutMenuDef = "About " + name() + "...<B;(-";
 			maxMenu = 132;
 		}
 
@@ -686,23 +683,8 @@ MacGuiImpl::MacDialogWindow *MacGuiImpl::createDialog(int dialogId) {
 	Common::SeekableReadStream *res;
 
 	Common::String saveGameFileAsResStr, gameFileResStr;
-	switch (_vm->_game.id) {
-	case GID_INDY3:
-		saveGameFileAsResStr = _strsStrings[18].c_str();
-		gameFileResStr = _strsStrings[19].c_str();
-		break;
-	case GID_LOOM:
-		saveGameFileAsResStr = _strsStrings[17].c_str();
-		gameFileResStr = _strsStrings[18].c_str();
-		break;
-	case GID_MONKEY:
-		saveGameFileAsResStr = _strsStrings[103].c_str();
-		gameFileResStr = _strsStrings[104].c_str();
-		break;
-	default:
-		saveGameFileAsResStr = "Save Game File as...";
-		gameFileResStr = "Game file";
-	}
+	saveGameFileAsResStr = _strsStrings[kMSISaveGameFileAs].c_str();
+	gameFileResStr = _strsStrings[kMSIGameFile].c_str();
 
 	resource.open(_resourceFile);
 
@@ -943,37 +925,11 @@ void MacGuiImpl::drawFakeDriveLabel(MacDialogWindow *window, Common::Rect r, byt
 }
 
 bool MacGuiImpl::runQuitDialog() {
-	Common::String quitString;
-	switch (_vm->_game.id) {
-	case GID_INDY3:
-	case GID_LOOM:
-		quitString = _strsStrings[15].c_str();
-		break;
-	case GID_MONKEY:
-		quitString = _strsStrings[96].c_str();
-		break;
-	default:
-		quitString = "Are you sure you want to quit?";
-	}
-
-	return runOkCancelDialog(quitString);
+	return runOkCancelDialog(_strsStrings[kMSIAreYouSureYouWantToQuit].c_str());
 }
 
 bool MacGuiImpl::runRestartDialog() {
-	Common::String restartString;
-	switch (_vm->_game.id) {
-	case GID_INDY3:
-	case GID_LOOM:
-		restartString = _strsStrings[14].c_str();
-		break;
-	case GID_MONKEY:
-		restartString = _strsStrings[97].c_str();
-		break;
-	default:
-		restartString = "Are you sure you want to restart this game from the beginning?";
-	}
-
-	return runOkCancelDialog(restartString);
+	return runOkCancelDialog(_strsStrings[kMSIAreYouSureYouWantToRestart].c_str());
 }
 
 void MacGuiImpl::drawBanner(char *message) {
@@ -1011,4 +967,452 @@ void MacGuiImpl::drawBitmap(Graphics::Surface *s, Common::Rect r, const uint16 *
 	}
 }
 
+#define SKIP_C(x) { MacGuiImpl::kMSISkip, "C",      x }
+#define SKIP_P(x) { MacGuiImpl::kMSISkip, "Pascal", x }
+
+static MacGuiImpl::MacSTRSParsingEntry strsIndy3Table[] = {
+	SKIP_C(6),
+	SKIP_P(2),
+	SKIP_C(2),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
+	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
+	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
+	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
+	SKIP_P(2),
+	SKIP_C(2),
+	SKIP_P(1),
+	SKIP_C(67),
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString3,               "C",      1 },
+	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
+	// SKIP_C(1),
+	// SKIP_P(4),
+	// SKIP_C(3),
+	// SKIP_P(2),
+	// SKIP_C(4),
+	// SKIP_P(1),
+	// SKIP_C(1),
+	// SKIP_P(5),
+};
+
+static MacGuiImpl::MacSTRSParsingEntry strsLoomTable[] = {
+	SKIP_C(6),
+	SKIP_P(2),
+	SKIP_C(2),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
+	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
+	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
+	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
+	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
+	SKIP_C(2),
+	SKIP_P(1),
+	SKIP_C(67),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString2,               "C",      1 },
+	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
+	// SKIP_C(1),
+	// SKIP_P(4),
+	// SKIP_C(3),
+	// SKIP_P(2),
+	// SKIP_C(4),
+	// SKIP_P(1),
+	// SKIP_C(1),
+	// SKIP_P(5),
+	// SKIP_C(7),
+};
+
+static MacGuiImpl::MacSTRSParsingEntry strsMI1Table[] = {
+	SKIP_C(93),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
+	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
+	SKIP_C(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
+	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
+	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
+	SKIP_C(6),
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
+	// SKIP_C(75)
+};
+
+static MacGuiImpl::MacSTRSParsingEntry strsMI2Variant1Table[] = {
+	SKIP_C(93),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
+	{ MacGuiImpl::kMSIRoughCommandMsg,            "C",      1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
+	SKIP_C(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
+	SKIP_P(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
+	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
+	SKIP_C(6),
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString35,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString36,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString37,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString38,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString39,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString40,              "Pascal", 1 },
+	// SKIP_C(95)
+};
+
+static MacGuiImpl::MacSTRSParsingEntry strsIndy4CDVariant1Table[] = {
+	SKIP_C(144),
+	SKIP_P(1),
+	SKIP_C(2),
+	SKIP_P(10),
+	SKIP_C(51),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
+	{ MacGuiImpl::kMSIRoughCommandMsg,            "C",      1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
+	SKIP_C(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
+	SKIP_P(1),
+	SKIP_P(1),
+	SKIP_P(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
+	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
+	SKIP_C(6),
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString35,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString36,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString37,              "Pascal", 1 },
+};
+
+static MacGuiImpl::MacSTRSParsingEntry strsIndy4FloppyVariant1Table[] = {
+	SKIP_C(93),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
+	{ MacGuiImpl::kMSIRoughCommandMsg,            "C",      1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
+	SKIP_C(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
+	SKIP_P(1),
+	SKIP_P(1),
+	SKIP_P(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
+	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
+	SKIP_C(6),
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString38,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString35,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString36,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString37,              "Pascal", 1 },
+};
+
+#undef SKIP_C
+#undef SKIP_P
+
+void MacGuiImpl::readStrings() {
+	Common::MacResManager resource;
+	resource.open(_resourceFile);
+	uint32 strsLen = resource.getResLength(MKTAG('S', 'T', 'R', 'S'), 0);
+
+	if (strsLen <= 0)
+		return;
+
+	Common::SeekableReadStream *strsStream = resource.getResource(MKTAG('S', 'T', 'R', 'S'), 0);
+	uint8 *strsBlock = (uint8 *)malloc(strsLen);
+	strsStream->read(strsBlock, strsLen);
+
+	uint8 *strsData = strsBlock;
+	MacSTRSParsingEntry *parsingTable = nullptr;
+	int parsingTableSize = 0;
+
+	if (_vm->_game.id == GID_INDY3) {
+		parsingTable = strsIndy3Table;
+		parsingTableSize = ARRAYSIZE(strsIndy3Table);
+	} else if (_vm->_game.id == GID_LOOM) {
+		parsingTable = strsLoomTable;
+		parsingTableSize = ARRAYSIZE(strsLoomTable);
+	} else if (_vm->_game.id == GID_MONKEY) {
+		parsingTable = strsMI1Table;
+		parsingTableSize = ARRAYSIZE(strsMI1Table);
+	} else if (_vm->_game.id == GID_MONKEY2) {
+		parsingTable = strsMI2Variant1Table;
+		parsingTableSize = ARRAYSIZE(strsMI2Variant1Table);
+	} else if (_vm->_game.id == GID_INDY4) {
+		switch (strsLen) {
+		case 6516:
+			parsingTable = strsIndy4FloppyVariant1Table;
+			parsingTableSize = ARRAYSIZE(strsIndy4FloppyVariant1Table);
+			break;
+		case 6836: // CD
+			parsingTable = strsIndy4CDVariant1Table;
+			parsingTableSize = ARRAYSIZE(strsIndy4CDVariant1Table);
+			break;
+		default:
+			warning("MacGuiImpl::readStrings(): String parsing table not defined for this variant of the game; STRS resource %d bytes", strsLen);
+			break;
+		}
+
+	} else {
+		error("MacGuiImpl::readStrings(): String parsing table not defined for this game");
+	}
+
+	parseSTRSBlock(strsData, parsingTable, parsingTableSize);
+
+	free(strsBlock);
+	delete strsStream;
+}
+
+void MacGuiImpl::parseSTRSBlock(uint8 *strsData, MacSTRSParsingEntry *parsingTable, int parsingTableSize) {
+	_strsStrings.clear();
+	_strsStrings.reserve(128);
+	for (int i = 0; i < 128; i++) {
+		_strsStrings.emplace_back("");
+	} 
+
+	for (int i = 0; i < parsingTableSize; i++) {
+		MacSTRSParsingEntry entry = parsingTable[i];
+
+		if (entry.strId == kMSISkip) {
+			for (int j = 0; j < entry.numStrings; j++) {
+				entry.parsingMethod == "C" ? readCString(strsData) : readPascalString(strsData);
+			}
+		} else {
+			for (int j = 0; j < entry.numStrings; j++) {
+				if (entry.parsingMethod == "C") {
+					_strsStrings[entry.strId] = readCString(strsData);
+				} else if (entry.parsingMethod == "Pascal") {
+					_strsStrings[entry.strId] = readPascalString(strsData);
+				} else {
+					error("MacGuiImpl::parseSTRSBlock(): invalid parsing method encountered (%s)", entry.parsingMethod.c_str());
+				}
+			}
+		}
+	}
+}
+
 } // End of namespace Scumm
diff --git a/engines/scumm/macgui/macgui_impl.h b/engines/scumm/macgui/macgui_impl.h
index e6eb4bbaaf3..f660ff982e3 100644
--- a/engines/scumm/macgui/macgui_impl.h
+++ b/engines/scumm/macgui/macgui_impl.h
@@ -48,6 +48,64 @@ class MacGuiImpl {
 public:
 	class MacDialogWindow;
 
+	enum MacStringIds {
+		kMSISkip = -1,
+		kMSIAboutGameName = 1,
+		kMSIRoughCommandMsg,
+		kMSIAreYouSureYouWantToQuit,
+		kMSIAreYouSureYouWantToRestart,
+		kMSIGameName,
+		kMSIOpenGameFile,
+		kMSISaveGameFileAs,
+		kMSIGameFile,
+		kMSIAboutString1,
+		kMSIAboutString2,
+		kMSIAboutString3,
+		kMSIAboutString4,
+		kMSIAboutString5,
+		kMSIAboutString6,
+		kMSIAboutString7,
+		kMSIAboutString8,
+		kMSIAboutString9,
+		kMSIAboutString10,
+		kMSIAboutString11,
+		kMSIAboutString12,
+		kMSIAboutString13,
+		kMSIAboutString14,
+		kMSIAboutString15,
+		kMSIAboutString16,
+		kMSIAboutString17,
+		kMSIAboutString18,
+		kMSIAboutString19,
+		kMSIAboutString20,
+		kMSIAboutString21,
+		kMSIAboutString22,
+		kMSIAboutString23,
+		kMSIAboutString24,
+		kMSIAboutString25,
+		kMSIAboutString26,
+		kMSIAboutString27,
+		kMSIAboutString28,
+		kMSIAboutString29,
+		kMSIAboutString30,
+		kMSIAboutString31,
+		kMSIAboutString32,
+		kMSIAboutString33,
+		kMSIAboutString34,
+		kMSIAboutString35,
+		kMSIAboutString36,
+		kMSIAboutString37,
+		kMSIAboutString38,
+		kMSIAboutString39,
+		kMSIAboutString40
+	};
+
+	struct MacSTRSParsingEntry {
+		MacStringIds strId;
+		Common::String parsingMethod;
+		int numStrings;
+	};
+
 protected:
 	ScummEngine *_vm = nullptr;
 	OSystem *_system = nullptr;
@@ -176,7 +234,6 @@ protected:
 		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F
 	};
 
-
 	MacGuiImpl::DelayStatus delay(uint32 ms = 0);
 
 	virtual bool getFontParams(FontId fontId, int &id, int &size, int &slant) const;
@@ -193,7 +250,8 @@ protected:
 
 	bool runOkCancelDialog(Common::String text);
 
-	virtual void readStrings() {}
+	void readStrings();
+	void parseSTRSBlock(uint8 *strsData, MacSTRSParsingEntry *parsingTable, int parsingTableSize);
 
 	// These are non interactable, no point in having them as widgets for now...
 	void drawFakePathList(MacDialogWindow *window, Common::Rect r, byte *icon, const char *text, Graphics::TextAlign alignment);
diff --git a/engines/scumm/macgui/macgui_indy3.cpp b/engines/scumm/macgui/macgui_indy3.cpp
index 6a65cb652aa..316716c1560 100644
--- a/engines/scumm/macgui/macgui_indy3.cpp
+++ b/engines/scumm/macgui/macgui_indy3.cpp
@@ -938,105 +938,6 @@ MacIndy3Gui::~MacIndy3Gui() {
 	_textArea.free();
 }
 
-
-void MacIndy3Gui::readStrings() {
-	Common::MacResManager resource;
-	resource.open(_resourceFile);
-	uint32 strsLen = resource.getResLength(MKTAG('S', 'T', 'R', 'S'), 0);
-	Common::SeekableReadStream *strsStream = resource.getResource(MKTAG('S', 'T', 'R', 'S'), 0);
-	uint8 *strsBlock = (uint8 *)malloc(strsLen);
-	strsStream->read(strsBlock, strsLen);
-
-	uint8 *strsData = strsBlock;
-
-	// Most of these are debug strings. We parse the entire STRS block anyway,
-	// for any future need.
-
-	// Debug strings
-	for (int i = 0; i < 6; i++) {
-		_strsStrings.emplace_back(readCString(strsData));
-	}
-
-	_strsStrings.emplace_back(readPascalString(strsData));
-	_strsStrings.emplace_back(readPascalString(strsData));
-
-	_strsStrings.emplace_back(readCString(strsData));
-	_strsStrings.emplace_back(readCString(strsData));
-
-	// "\x14", "About Indy...<B;(-", "MacScumm", "MacScumm"
-	for (int i = 0; i < 4; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
-
-	// "Are you sure you want to restart this game from the beginning?"
-	_strsStrings.emplace_back(readCString(strsData));
-
-	// "Are you sure you want to quit?"
-	_strsStrings.emplace_back(readCString(strsData));
-
-	// "Open Game File...", "Open Game File...", "Save Game File as..."
-	// "Game file", "Save Game File as...", "Game file"
-	for (int i = 0; i < 6; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
-
-	// "An error occured while saving.  The game was not saved."
-	_strsStrings.emplace_back(readCString(strsData));
-
-	// "Select a color"
-	_strsStrings.emplace_back(readPascalString(strsData));
-
-	// Debug strings
-	for (int i = 0; i < 67; i++) {
-		_strsStrings.emplace_back(readCString(strsData));
-	}
-
-	// "About", "about", "Indiana Jones and the Last Crusade", "The Graphic Adventure"
-	for (int i = 0; i < 4; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
-
-	// "%sInterpreter version %c.%c.%c"
-	_strsStrings.emplace_back(readCString(strsData));
-
-	// All the other "About" dialog strings
-	for (int i = 0; i < 31; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
-
-	// "ERROR #%d"
-	_strsStrings.emplace_back(readCString(strsData));
-
-	// Other debug strings...
-	for (int i = 0; i < 4; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
-
-	for (int i = 0; i < 3; i++) {
-		_strsStrings.emplace_back(readCString(strsData));
-	}
-
-	_strsStrings.emplace_back(readPascalString(strsData));
-	_strsStrings.emplace_back(readPascalString(strsData));
-
-	// "Copyright (c) 1989 Lucasfilm Ltd. All Rights Reserved.", "rb, "wb", "wb"
-	for (int i = 0; i < 4; i++) {
-		_strsStrings.emplace_back(readCString(strsData));
-	}
-
-	// Other debug strings...
-	_strsStrings.emplace_back(readPascalString(strsData));
-
-	_strsStrings.emplace_back(readCString(strsData));
-
-	for (int i = 0; i < 5; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
-
-	free(strsBlock);
-	delete strsStream;
-}
-
 void MacIndy3Gui::setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) {
 	const byte buf[15 * 15] = {
 		3, 3, 3, 3, 3, 3, 0, 1, 0, 3, 3, 3, 3, 3, 3,
@@ -1258,71 +1159,71 @@ void MacIndy3Gui::runAboutDialog() {
 
 	const char *subVers = (const char *)_vm->getStringAddress(24);
 
-	Common::String version = Common::String::format(_strsStrings[95].c_str(), subVers, '5', '1', '6');
+	Common::String version = Common::String::format(_strsStrings[kMSIAboutString3].c_str(), subVers, '5', '1', '6');
 
 	const TextLine page1[] = {
-		{ 0, 4, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[93].c_str() }, // "Indiana Jones and the Last Crusade"
-		{ 0, 22, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[94].c_str() }, // "The Graphic Adventure"
+		{ 0, 4, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString1].c_str() }, // "Indiana Jones and the Last Crusade"
+		{ 0, 22, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString2].c_str() }, // "The Graphic Adventure"
 		{ 0, 49, kStyleBold, Graphics::kTextAlignCenter, version.c_str() }, // "Mac 1.7 8/17/90, Interpreter version 5.1.6"
-		{ 1, 82, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[96].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company.  All rights reserved."
+		{ 1, 82, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString4].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company.  All rights reserved."
 		TEXT_END_MARKER
 	};
 
 	const TextLine page2[] = {
-		{ 1, 7, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[97].c_str() }, // "Macintosh version by"
-		{ 70, 21, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[99].c_str() }, // "Eric Johnston"
-		{ 194, 32, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[98].c_str() }, // "and"
-		{ 216, 41, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[100].c_str() }, // "Dan Filner"
+		{ 1, 7, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString5].c_str() }, // "Macintosh version by"
+		{ 70, 21, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString7].c_str() }, // "Eric Johnston"
+		{ 194, 32, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString6].c_str() }, // "and"
+		{ 216, 41, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString8].c_str() }, // "Dan Filner"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page3[] = {
-		{ 1, 7, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[101].c_str() }, // "Macintosh scripting by"
-		{ 75, 21, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[103].c_str() }, // "Ron Baldwin"
-		{ 186, 32, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[102].c_str() }, // "and"
-		{ 214, 41, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[104].c_str() }, // "David Fox"
+		{ 1, 7, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString9].c_str() }, // "Macintosh scripting by"
+		{ 75, 21, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString11].c_str() }, // "Ron Baldwin"
+		{ 186, 32, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString10].c_str() }, // "and"
+		{ 214, 41, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString12].c_str() }, // "David Fox"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page4[] = {
-		{ 1, 7, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[105].c_str() }, // "Designed and scripted by"
-		{ 77, 24, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[106].c_str() }, // "Noah Falstein"
-		{ 134, 44, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[107].c_str() }, // "David Fox"
-		{ 167, 64, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[108].c_str() }, // "Ron Gilbert"
+		{ 1, 7, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString13].c_str() }, // "Designed and scripted by"
+		{ 77, 24, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString14].c_str() }, // "Noah Falstein"
+		{ 134, 44, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString15].c_str() }, // "David Fox"
+		{ 167, 64, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString16].c_str() }, // "Ron Gilbert"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page5[] = {
-		{ 1, 7, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[109].c_str() }, // "SCUMM Story System"
-		{ 1, 17, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[110].c_str() }, // "created by"
-		{ 107, 36, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[112].c_str() }, // "Ron Gilbert"
-		{ 170, 52, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[111].c_str() }, // "and"
-		{ 132, 66, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[113].c_str() }, // "Aric Wilmunder"
+		{ 1, 7, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString17].c_str() }, // "SCUMM Story System"
+		{ 1, 17, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString18].c_str() }, // "created by"
+		{ 107, 36, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString20].c_str() }, // "Ron Gilbert"
+		{ 170, 52, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString19].c_str() }, // "and"
+		{ 132, 66, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString21].c_str() }, // "Aric Wilmunder"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page6[] = {
-		{ 1, 19, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[114].c_str() }, // "Stumped?  Indy hint books are available!"
-		{ 86, 36, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[117].c_str() }, // "In the U.S. call"
-		{ 160, 37, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[115].c_str() }, // "1 (800) STAR-WARS"
-		{ 160, 46, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[119].c_str() }, // "that\xD5s  1 (800) 782-7927"
-		{ 90, 66, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[118].c_str() }, // "In Canada call"
-		{ 160, 67, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[116].c_str() }, // "1 (800) 828-7927"
+		{ 1, 19, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString22].c_str() }, // "Stumped?  Indy hint books are available!"
+		{ 86, 36, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString25].c_str() }, // "In the U.S. call"
+		{ 160, 37, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString23].c_str() }, // "1 (800) STAR-WARS"
+		{ 160, 46, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString27].c_str() }, // "that\xD5s  1 (800) 782-7927"
+		{ 90, 66, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString26].c_str() }, // "In Canada call"
+		{ 160, 67, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString24].c_str() }, // "1 (800) 828-7927"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page7[] = {
-		{ 1, 17, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[120].c_str() }, // "Need a hint NOW?  Having problems?"
-		{ 53, 31, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[122].c_str() }, // "For hints or technical support call"
-		{ 215, 32, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[121].c_str() }, // "1 (900) 740-JEDI"
-		{ 1, 46, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[123].c_str() }, // "The charge is 75\xA2 per minute."
-		{ 1, 56, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[124].c_str() }, // "(You must have your parents\xD5 permission to"
-		{ 1, 66, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[125].c_str() }, // "call this number if you are under 18.)"
+		{ 1, 17, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString28].c_str() }, // "Need a hint NOW?  Having problems?"
+		{ 53, 31, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString30].c_str() }, // "For hints or technical support call"
+		{ 215, 32, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString29].c_str() }, // "1 (900) 740-JEDI"
+		{ 1, 46, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString31].c_str() }, // "The charge is 75\xA2 per minute."
+		{ 1, 56, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString32].c_str() }, // "(You must have your parents\xD5 permission to"
+		{ 1, 66, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString33].c_str() }, // "call this number if you are under 18.)"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page8[] = {
-		{ 1, 1, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[126].c_str() }, // "Click to continue"
+		{ 1, 1, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString34].c_str() }, // "Click to continue"
 		TEXT_END_MARKER
 	};
 
diff --git a/engines/scumm/macgui/macgui_indy3.h b/engines/scumm/macgui/macgui_indy3.h
index fce72f3145a..4b210a2e94f 100644
--- a/engines/scumm/macgui/macgui_indy3.h
+++ b/engines/scumm/macgui/macgui_indy3.h
@@ -86,8 +86,6 @@ protected:
 	bool runOptionsDialog() override;
 	bool runIqPointsDialog();
 
-	void readStrings() override;
-
 private:
 	int _verbGuiTop = 0;
 	Graphics::Surface _verbGuiSurface;
diff --git a/engines/scumm/macgui/macgui_loom.cpp b/engines/scumm/macgui/macgui_loom.cpp
index 472a4a717d0..5e33694387c 100644
--- a/engines/scumm/macgui/macgui_loom.cpp
+++ b/engines/scumm/macgui/macgui_loom.cpp
@@ -60,110 +60,6 @@ MacLoomGui::~MacLoomGui() {
 	}
 }
 
-void MacLoomGui::readStrings() {
-	Common::MacResManager resource;
-	resource.open(_resourceFile);
-	uint32 strsLen = resource.getResLength(MKTAG('S', 'T', 'R', 'S'), 0);
-	Common::SeekableReadStream *strsStream = resource.getResource(MKTAG('S', 'T', 'R', 'S'), 0);
-	uint8 *strsBlock = (uint8 *)malloc(strsLen);
-	strsStream->read(strsBlock, strsLen);
-
-	uint8 *strsData = strsBlock;
-
-	// Most of these are debug strings. We parse the entire STRS block anyway,
-	// for any future need.
-
-	// Debug strings
-	for (int i = 0; i < 6; i++) {
-		_strsStrings.emplace_back(readCString(strsData));
-	}
-
-	_strsStrings.emplace_back(readPascalString(strsData));
-	_strsStrings.emplace_back(readPascalString(strsData));
-
-	_strsStrings.emplace_back(readCString(strsData));
-	_strsStrings.emplace_back(readCString(strsData));
-
-	// "\x14", "About Loom...<B;(-", "MacScumm", "MacScumm"
-	for (int i = 0; i < 4; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
-
-	// "Are you sure you want to restart this game from the beginning?"
-	_strsStrings.emplace_back(readCString(strsData));
-
-	// "Are you sure you want to quit?"
-	_strsStrings.emplace_back(readCString(strsData));
-
-	// "Open Game File...", "Save Game File as..." "Game file"
-	for (int i = 0; i < 3; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
-
-	// "This disk is full.  The game was not saved."
-	_strsStrings.emplace_back(readCString(strsData));
-
-	// "An error occured while saving.  The game was not saved.  Please try saving the game to another disk."
-	_strsStrings.emplace_back(readCString(strsData));
-
-	// "Select a color"
-	_strsStrings.emplace_back(readPascalString(strsData));
-
-	// Debug strings
-	for (int i = 0; i < 67; i++) {
-		_strsStrings.emplace_back(readCString(strsData));
-	}
-
-	// "About", "PRESENTS"
-	for (int i = 0; i < 2; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
-
-	// "%s Interpreter version %c.%c.%c"
-	_strsStrings.emplace_back(readCString(strsData));
-
-	// All the other "About" dialog strings
-	for (int i = 0; i < 30; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
-
-	// "ERROR #%d"
-	_strsStrings.emplace_back(readCString(strsData));
-
-	// Other debug strings...
-	for (int i = 0; i < 4; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
-
-	for (int i = 0; i < 3; i++) {
-		_strsStrings.emplace_back(readCString(strsData));
-	}
-
-	_strsStrings.emplace_back(readPascalString(strsData));
-	_strsStrings.emplace_back(readPascalString(strsData));
-
-	// "Copyright (c) 1989 Lucasfilm Ltd. All Rights Reserved.", "rb, "wb", "wb"
-	for (int i = 0; i < 4; i++) {
-		_strsStrings.emplace_back(readCString(strsData));
-	}
-
-	// Other debug strings...
-	_strsStrings.emplace_back(readPascalString(strsData));
-
-	_strsStrings.emplace_back(readCString(strsData));
-
-	for (int i = 0; i < 5; i++) {
-		_strsStrings.emplace_back(readPascalString(strsData));
-	}
-
-	for (int i = 0; i < 7; i++) {
-		_strsStrings.emplace_back(readCString(strsData));
-	}
-
-	free(strsBlock);
-	delete strsStream;
-}
-
 const Graphics::Font *MacLoomGui::getFontByScummId(int32 id) {
 	switch (id) {
 	case 0:
@@ -277,70 +173,70 @@ void MacLoomGui::runAboutDialog() {
 	Graphics::Surface *loom = loadPict(5001);
 
 	const char *subVers = (const char *)_vm->getStringAddress(5);
-	Common::String version = Common::String::format(_strsStrings[91].c_str(), subVers, '5', '1', '6');
+	Common::String version = Common::String::format(_strsStrings[kMSIAboutString2].c_str(), subVers, '5', '1', '6');
 
 	const TextLine page1[] = {
-		{ 0, 23, kStyleExtraBold, Graphics::kTextAlignCenter, _strsStrings[90].c_str() }, // "PRESENTS"
+		{ 0, 23, kStyleExtraBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString1].c_str() }, // "PRESENTS"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page2[] = {
-		{ 1, 59, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[92].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company.  All rights reserved."
+		{ 1, 59, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString3].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company.  All rights reserved."
 		{ 0, 70, kStyleRegular, Graphics::kTextAlignCenter, version.c_str() }, // "Release Version 1.2  25-JAN-91 Interpreter version 5.1.6"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page3[] = {
-		{ 1, 11, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[93].c_str() }, // "Macintosh version by"
-		{ 0, 25, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[95].c_str() }, // "Eric Johnston"
-		{ 0, 49, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[94].c_str() }, // "Macintosh scripting by"
-		{ 1, 63, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[96].c_str() }, // "Ron Baldwin"
+		{ 1, 11, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString4].c_str() }, // "Macintosh version by"
+		{ 0, 25, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString6].c_str() }, // "Eric Johnston"
+		{ 0, 49, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString5].c_str() }, // "Macintosh scripting by"
+		{ 1, 63, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString7].c_str() }, // "Ron Baldwin"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page4[] = {
-		{ 0, 26, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[97].c_str() }, // "Original game created by"
-		{ 1, 40, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[98].c_str() }, // "Brian Moriarty"
+		{ 0, 26, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString8].c_str() }, // "Original game created by"
+		{ 1, 40, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString9].c_str() }, // "Brian Moriarty"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page5[] = {
-		{ 1, 11, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[99].c_str() }, // "Produced by"
-		{ 0, 25, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[101].c_str() }, // "Gregory D. Hammond"
-		{ 0, 49, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[100].c_str() }, // "Macintosh Version Produced by"
-		{ 1, 63, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[102].c_str() }, // "David Fox"
+		{ 1, 11, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString10].c_str() }, // "Produced by"
+		{ 0, 25, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString12].c_str() }, // "Gregory D. Hammond"
+		{ 0, 49, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString11].c_str() }, // "Macintosh Version Produced by"
+		{ 1, 63, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString13].c_str() }, // "David Fox"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page6[] = {
-		{ 1, 6, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[103].c_str() }, // "SCUMM Story System"
-		{ 1, 16, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[104].c_str() }, // "created by"
-		{ 97, 35, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[106].c_str() }, // "Ron Gilbert"
-		{ 1, 51, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[105].c_str() }, // "and"
-		{ 122, 65, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[107].c_str() }, // "Aric Wilmunder"
+		{ 1, 6, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString14].c_str() }, // "SCUMM Story System"
+		{1, 16, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString15].c_str()}, // "created by"
+		{ 97, 35, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString17].c_str() }, // "Ron Gilbert"
+		{ 1, 51, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString16].c_str() }, // "and"
+		{ 122, 65, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString18].c_str() }, // "Aric Wilmunder"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page7[] = {
-		{ 1, 16, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[108].c_str() }, // "Stumped?  Loom hint books are available!"
-		{ 76, 33, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[111].c_str() }, // "In the U.S. call"
-		{ 150, 34, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[109].c_str() }, // "1 (800) STAR-WARS"
-		{ 150, 43, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[113].c_str() }, // "that\xD5s  1 (800) 782-7927"
-		{ 80, 63, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[112].c_str() }, // "In Canada call"
-		{ 150, 64, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[110].c_str() }, // "1 (800) 828-7927"
+		{ 1, 16, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString19].c_str() }, // "Stumped?  Loom hint books are available!"
+		{ 76, 33, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString22].c_str() }, // "In the U.S. call"
+		{ 150, 34, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString20].c_str() }, // "1 (800) STAR-WARS"
+		{ 150, 43, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString24].c_str() }, // "that\xD5s  1 (800) 782-7927"
+		{ 80, 63, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString23].c_str() }, // "In Canada call"
+		{ 150, 64, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString21].c_str() }, // "1 (800) 828-7927"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page8[] = {
-		{ 1, 11, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[114].c_str() }, // "Need a hint NOW?  Having problems?"
-		{ 81, 25, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[117].c_str() }, // "For technical support call"
-		{ 205, 26, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[115].c_str() }, // "1 (415) 721-3333"
-		{ 137, 35, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[118].c_str() }, // "For hints call"
-
-		{ 205, 36, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[116].c_str() }, // "1 (900) 740-JEDI"
-		{ 1, 50, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[119].c_str() }, // "The charge for the hint line is 75\xA2 per minute."
-		{ 1, 60, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[120].c_str() }, // "(You must have your parents\xD5 permission to"
-		{ 1, 70, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[121].c_str() }, // "call this number if you are under 18.)"
+		{ 1, 11, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString25].c_str() }, // "Need a hint NOW?  Having problems?"
+		{ 81, 25, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString28].c_str() }, // "For technical support call"
+		{ 205, 26, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString26].c_str() }, // "1 (415) 721-3333"
+		{ 137, 35, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString29].c_str() }, // "For hints call"
+
+		{ 205, 36, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString27].c_str() }, // "1 (900) 740-JEDI"
+		{ 1, 50, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString30].c_str() }, // "The charge for the hint line is 75\xA2 per minute."
+		{ 1, 60, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString31].c_str() }, // "(You must have your parents\xD5 permission to"
+		{ 1, 70, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString32].c_str() }, // "call this number if you are under 18.)"
 		TEXT_END_MARKER
 	};
 
@@ -656,8 +552,8 @@ bool MacLoomGui::runSaveDialog(int &saveSlotToHandle, Common::String &name) {
 	Common::StringArray savegameNames;
 	prepareSaveLoad(savegameNames, busySlots, slotIds, ARRAYSIZE(busySlots));
 
-	Common::String saveGameFileAsResStr = _strsStrings[17].c_str();
-	Common::String gameFileResStr = _strsStrings[18].c_str();
+	Common::String saveGameFileAsResStr = _strsStrings[kMSISaveGameFileAs].c_str();
+	Common::String gameFileResStr = _strsStrings[kMSIGameFile].c_str();
 
 	int firstAvailableSlot = -1;
 	for (int i = 1; i < ARRAYSIZE(busySlots); i++) { // Skip the autosave slot
diff --git a/engines/scumm/macgui/macgui_loom.h b/engines/scumm/macgui/macgui_loom.h
index b0763737820..6a8f4d7325a 100644
--- a/engines/scumm/macgui/macgui_loom.h
+++ b/engines/scumm/macgui/macgui_loom.h
@@ -59,8 +59,6 @@ protected:
 	bool runSaveDialog(int &saveSlotToHandle, Common::String &name) override;
 	bool runOptionsDialog() override;
 
-	void readStrings() override;
-
 private:
 	Graphics::Surface *_practiceBox = nullptr;
 	Common::Point _practiceBoxPos;
diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index efbd81c777a..489ae19b5a9 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -51,6 +51,7 @@ MacMI1Gui::MacMI1Gui(ScummEngine *vm, const Common::Path &resourceFile) : MacGui
 MacMI1Gui::~MacMI1Gui() {
 }
 
+#if 0
 void MacMI1Gui::readStrings() {
 	Common::MacResManager resource;
 	resource.open(_resourceFile);
@@ -272,7 +273,7 @@ void MacMI1Gui::readStrings() {
 	free(strsBlock);
 	delete strsStream;
 }
-
+#endif
 const Graphics::Font *MacMI1Gui::getFontByScummId(int32 id) {
 	switch (id) {
 	case 0:
@@ -409,61 +410,61 @@ void MacMI1Gui::runAboutDialogMI1(MacDialogWindow *window) {
 	Graphics::Surface *s = window->innerSurface();
 
 	const TextLine page3[] = {
-		{ 0, 68, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[114].c_str() }, // "PRESENTS"
+		{ 0, 68, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString2].c_str() }, // "PRESENTS"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page12[] = {
-		{ 0, 0, kStyleHeaderSimple1, Graphics::kTextAlignLeft, _strsStrings[115].c_str() }, // "The Secret"
-		{ 87, 13, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[117].c_str() }, // "of"
-		{ 40, 26, kStyleHeaderSimple1, Graphics::kTextAlignLeft, _strsStrings[116].c_str() }, // "Monkey Island\xAA"
-		{ 178, 120, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[118].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company."
-		{ 312, 133, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[119].c_str() }, // "All rights reserved."
+		{ 0, 0, kStyleHeaderSimple1, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString3].c_str() }, // "The Secret"
+		{ 87, 13, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString5].c_str() }, // "of"
+		{ 40, 26, kStyleHeaderSimple1, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString4].c_str() }, // "Monkey Island\xAA"
+		{ 178, 120, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString6].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company."
+		{ 312, 133, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString7].c_str() }, // "All rights reserved."
 		TEXT_END_MARKER
 	};
 
 	const TextLine page13[] = {
-		{ 0, 47, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[120].c_str() }, // "Macintosh version by"
-		{ 50, 62, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[121].c_str() }, // "Eric Johnston"
+		{ 0, 47, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString8].c_str() }, // "Macintosh version by"
+		{ 50, 62, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString9].c_str() }, // "Eric Johnston"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page14[] = {
-		{ 85, 32, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[122].c_str() }, // "Created by"
-		{ 60, 47, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[124].c_str() }, // "Ron Gilbert"
-		{ 39, 70, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[123].c_str() }, // "Macintosh Version Produced by"
-		{ 47, 85, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[125].c_str() }, // "Brenna Holden"
+		{ 85, 32, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString10].c_str() }, // "Created by"
+		{ 60, 47, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString12].c_str() }, // "Ron Gilbert"
+		{ 39, 70, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString11].c_str() }, // "Macintosh Version Produced by"
+		{ 47, 85, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString13].c_str() }, // "Brenna Holden"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page15[] = {
-		{ 59, 27, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[126].c_str() }, // "SCUMM Story System"
-		{ 85, 37, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[127].c_str() }, // "created by"
-		{ 35, 57, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[129].c_str() }, // "Ron Gilbert"
-		{ 102, 72, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[128].c_str() }, // "and"
-		{ 59, 87, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[130].c_str() }, // "Aric Wilmunder"
+		{ 59, 27, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString14].c_str() }, // "SCUMM Story System"
+		{ 85, 37, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString15].c_str() }, // "created by"
+		{ 35, 57, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString17].c_str() }, // "Ron Gilbert"
+		{ 102, 72, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString16].c_str() }, // "and"
+		{ 59, 87, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString18].c_str() }, // "Aric Wilmunder"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page16[] = {
-		{ 29, 37, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[131].c_str() }, // "Stumped? Hint books are available"
-		{ 15, 55, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[134].c_str() }, // "In the U.S. call"
-		{ 89, 55, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[132].c_str() }, // "1 (800) STAR-WARS"
-		{ 89, 65, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[136].c_str() }, // "that\xD5s  1 (800)782-7927"
-		{ 19, 85, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[135].c_str() }, // "In Canada call"
-		{ 89, 85, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[133].c_str() }, // "1 (800) 828-7927"
+		{ 29, 37, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString19].c_str() }, // "Stumped? Hint books are available"
+		{ 15, 55, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString22].c_str() }, // "In the U.S. call"
+		{ 89, 55, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString20].c_str() }, // "1 (800) STAR-WARS"
+		{ 89, 65, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString24].c_str() }, // "that\xD5s  1 (800)782-7927"
+		{ 19, 85, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString23].c_str() }, // "In Canada call"
+		{ 89, 85, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString21].c_str() }, // "1 (800) 828-7927"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page17[] = {
-		{ 27, 32, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[137].c_str() }, // "Need a hint NOW?  Having problems?"
-		{ 6, 47, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[140].c_str() }, // "For technical support call"
-		{ 130, 47, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[138].c_str() }, // "1 (415) 721-3333"
-		{ 62, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[141].c_str() }, // "For hints call"
-		{ 130, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[139].c_str() }, // "1 (900) 740-JEDI"
-		{ 5, 72, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[142].c_str() }, // "The charge for the hint line is 75\xA2 per minute."
-		{ 10, 82, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[143].c_str() }, // "(You must have your parents\xD5 permission to"
-		{ 25, 92, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[144].c_str() }, // "call this number if you are under 18.)"
+		{ 27, 32, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString25].c_str() }, // "Need a hint NOW?  Having problems?"
+		{ 6, 47, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString28].c_str() }, // "For technical support call"
+		{ 130, 47, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString26].c_str() }, // "1 (415) 721-3333"
+		{ 62, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString29].c_str() }, // "For hints call"
+		{ 130, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString27].c_str() }, // "1 (900) 740-JEDI"
+		{ 5, 72, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString30].c_str() }, // "The charge for the hint line is 75\xA2 per minute."
+		{ 10, 82, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString31].c_str() }, // "(You must have your parents\xD5 permission to"
+		{ 25, 92, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString32].c_str() }, // "call this number if you are under 18.)"
 		TEXT_END_MARKER
 	};
 
@@ -661,76 +662,76 @@ void MacMI1Gui::runAboutDialogMI2(MacDialogWindow *window) {
 //	Graphics::Surface *lucasArts = loadPict(5000);
 
 	const TextLine page3[] = {
-		{ 0, 68, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[115].c_str() }, // "PRESENTS"
+		{ 0, 68, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString2].c_str() }, // "PRESENTS"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page5[] = {
-		{ 1, 16, kStyleBold2, Graphics::kTextAlignCenter, _strsStrings[116].c_str() }, // "LeChuck\xD5s Revenge"
-		{ 1, 31, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[117].c_str() }, // "Monkey Island 2"
-		{ 176, 125, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[119].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company."
-		{ 310, 138, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[120].c_str() }, // "All rights reserved."
+		{ 1, 16, kStyleBold2, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString3].c_str() }, // "LeChuck\xD5s Revenge"
+		{ 1, 31, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString4].c_str() }, // "Monkey Island 2"
+		{ 176, 125, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString6].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company."
+		{ 310, 138, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString7].c_str() }, // "All rights reserved."
 		TEXT_END_MARKER
 	};
 
 	const TextLine page6[] = {
-		{ 0, 19, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[121].c_str() }, // "Macintosh version by
-		{ 133, 34, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[122].c_str() }, // "Eric Johnston"
+		{ 0, 19, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString8].c_str() }, // "Macintosh version by
+		{ 133, 34, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString9].c_str() }, // "Eric Johnston"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page7[] = {
-		{ 168, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[123].c_str() }, // "Created by"
-		{ 143, 19, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[125].c_str() }, // "Ron Gilbert"
-		{ 141, 42, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[124].c_str() }, // "Macintosh Scripting by"
-		{ 127, 57, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[126].c_str() }, // "Alric Wilmunder"
+		{ 168, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString10].c_str() }, // "Created by"
+		{ 143, 19, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString12].c_str() }, // "Ron Gilbert"
+		{ 141, 42, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString11].c_str() }, // "Macintosh Scripting by"
+		{ 127, 57, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString13].c_str() }, // "Alric Wilmunder"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page8[] = {
-		{ 142, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[127].c_str() }, // "SCUMM Story System"
-		{ 168, 14, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[128].c_str() }, // "created by"
-		{ 68, 28, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[130].c_str() }, // "Ron Gilbert    Aric Wilmunder"
-		{ 79, 43, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[131].c_str() }, // "Brad P. Taylor    Vince Lee"
-		{ 135, 60, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[129].c_str() }, // "and"
-		{ 109, 58, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[132].c_str() }, // "        Eric Johnston"
+		{ 142, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString14].c_str() }, // "SCUMM Story System"
+		{ 168, 14, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString15].c_str() }, // "created by"
+		{ 68, 28, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString17].c_str() }, // "Ron Gilbert    Aric Wilmunder"
+		{ 79, 43, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString18].c_str() }, // "Brad P. Taylor    Vince Lee"
+		{ 135, 60, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString16].c_str() }, // "and"
+		{ 109, 58, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString19].c_str() }, // "        Eric Johnston"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page9[] = {
-		{ 137, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[133].c_str() }, // "Macintosh Orchestration"
-		{ 125, 19, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[135].c_str() }, // "Robin Goldstein"
-		{ 152, 42, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[134].c_str() }, // "Macintosh Testing"
-		{ 144, 57, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[136].c_str() }, // "Jo Ashburn"
+		{ 137, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString20].c_str() }, // "Macintosh Orchestration"
+		{ 125, 19, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString22].c_str() }, // "Robin Goldstein"
+		{ 152, 42, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString21].c_str() }, // "Macintosh Testing"
+		{ 144, 57, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString23].c_str() }, // "Jo Ashburn"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page10[] = {
-		{ 2, 19, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[137].c_str() }, // "\xD2djm\xD3  Sound and Music System \xA91992 Eric Johnston
-		{ 2, 39, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[138].c_str() }, // "\xD2epx\xD3  Graphics Smoothing System \xA91992 Eric Johnson
-		{ 2, 54, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[139].c_str() }, // "Type 'rough' to see the difference."
+		{ 2, 19, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString24].c_str() }, // "\xD2djm\xD3  Sound and Music System \xA91992 Eric Johnston
+		{ 2, 39, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString25].c_str() }, // "\xD2epx\xD3  Graphics Smoothing System \xA91992 Eric Johnson
+		{ 2, 54, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString26].c_str() }, // "Type 'rough' to see the difference."
 		TEXT_END_MARKER
 	};
 
 	const TextLine page11[] = {
-		{ 112, 9, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[140].c_str() }, // "Stumped?  Hint books are available!"
-		{ 98, 27, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[143].c_str() }, // "In the U.S. call"
-		{ 172, 27, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[141].c_str() }, // "1 (800) STAR-WARS"
-		{ 172, 37, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[145].c_str() }, // "that\xD5s  1 (800) 782-7927"
-		{ 102, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[144].c_str() }, // "In Canada call"
-		{ 172, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[142].c_str() }, // "1 (800) 828-7927"
+		{ 112, 9, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString27].c_str() }, // "Stumped?  Hint books are available!"
+		{ 98, 27, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString30].c_str() }, // "In the U.S. call"
+		{ 172, 27, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString28].c_str() }, // "1 (800) STAR-WARS"
+		{ 172, 37, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString32].c_str() }, // "that\xD5s  1 (800) 782-7927"
+		{ 102, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString31].c_str() }, // "In Canada call"
+		{ 172, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString29].c_str() }, // "1 (800) 828-7927"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page12[] = {
-		{ 110, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[146].c_str() }, // "Need a hint NOW?  Having problems?"
-		{ 89, 19, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[149].c_str() }, // "For technical support call"
-		{ 213, 19, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[147].c_str() }, // "1 (415) 721-3333"
-		{ 145, 29, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[150].c_str() }, // "For hints call"
-		{ 213, 29, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[148].c_str() }, // "1 (900) 740-JEDI"
-		{ 88, 44, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[151].c_str() }, // "The charge for the hint line is 75\xA2 per minute."
-		{ 93, 54, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[152].c_str() }, // "(You must have your parents\xD5 permission to"
-		{ 108, 64, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[153].c_str() }, // "call this number if you are under 18.)"
+		{ 110, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString33].c_str() }, // "Need a hint NOW?  Having problems?"
+		{ 89, 19, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString36].c_str() }, // "For technical support call"
+		{ 213, 19, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString34].c_str() }, // "1 (415) 721-3333"
+		{ 145, 29, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString37].c_str() }, // "For hints call"
+		{ 213, 29, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString35].c_str() }, // "1 (900) 740-JEDI"
+		{ 88, 44, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString38].c_str() }, // "The charge for the hint line is 75\xA2 per minute."
+		{ 93, 54, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString39].c_str() }, // "(You must have your parents\xD5 permission to"
+		{ 108, 64, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString40].c_str() }, // "call this number if you are under 18.)"
 		TEXT_END_MARKER
 	};
 
@@ -815,32 +816,29 @@ void MacMI1Gui::runAboutDialogIndy4(MacDialogWindow *window) {
 //	Graphics::Surface *lucasArts = loadPict(5000);
 	Graphics::Surface *indianaJones = loadPict(5001);
 
-	int baseString = isFloppyVersion ? 119 : 236;
-	int baseString2 = isFloppyVersion ? 142 : 258;
-
 	const TextLine page3[] = {
-		{ 0, 68, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[baseString].c_str() }, // "PRESENTS"
+		{ 0, 68, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString2].c_str() }, // "PRESENTS"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page5[] = {
-		{ 317, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 1].c_str() }, // "\xA8"
-		{ 176, 125, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 2].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company."
-		{ 310, 138, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 3].c_str() }, // "All rights reserved."
+		{ 317, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString3].c_str() }, // "\xA8"
+		{ 176, 125, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString4].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company."
+		{ 310, 138, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString5].c_str() }, // "All rights reserved."
 		TEXT_END_MARKER
 	};
 
 	const TextLine page6[] = {
-		{ 0, 19, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[baseString + 4].c_str() }, // "Macintosh version by
-		{ 133, 34, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[baseString + 5].c_str() }, // "Eric Johnston"
+		{ 0, 19, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString6].c_str() }, // "Macintosh version by
+		{ 133, 34, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString7].c_str() }, // "Eric Johnston"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page7[] = {
-		{ 168, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 6].c_str() }, // "Created by"
-		{ 138, 19, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[baseString + 8].c_str() }, // "Hal Barwood"
-		{ 141, 42, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 7].c_str() }, // "Macintosh Scripting by"
-		{ 127, 57, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[baseString + 9].c_str() }, // "Alric Wilmunder"
+		{ 168, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString8].c_str() }, // "Created by"
+		{ 138, 19, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString10].c_str() }, // "Hal Barwood"
+		{ 141, 42, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString9].c_str() }, // "Macintosh Scripting by"
+		{ 127, 57, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString11].c_str() }, // "Alric Wilmunder"
 		TEXT_END_MARKER
 	};
 
@@ -849,20 +847,20 @@ void MacMI1Gui::runAboutDialogIndy4(MacDialogWindow *window) {
 	// none of the other pages do it.
 
 	const TextLine page8[] = {
-		{ 142, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 10].c_str() }, // "SCUMM Story System"
-		{ 168, 14, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 11].c_str() }, // "created by"
-		{ 68, 28, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[baseString + 13].c_str() }, // "Ron Gilbert    Aric Wilmunder"
-		{ 79, 43, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[baseString + 14].c_str() }, // "Brad P. Taylor    Vince Lee"
-		{ 135, 60, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 12].c_str() }, // "and"
-		{ 109, 58, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[baseString + 15].c_str() }, // "        Eric Johnston"
+		{ 142, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString12].c_str() }, // "SCUMM Story System"
+		{ 168, 14, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString13].c_str() }, // "created by"
+		{ 68, 28, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString15].c_str() }, // "Ron Gilbert    Aric Wilmunder"
+		{ 79, 43, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString16].c_str() }, // "Brad P. Taylor    Vince Lee"
+		{ 135, 60, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString14].c_str() }, // "and"
+		{ 109, 58, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString17].c_str() }, // "        Eric Johnston"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page9[] = {
-		{ 137, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 16].c_str() }, // "Macintosh Orchestration"
-		{ 125, 19, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[baseString + 18].c_str() }, // "Robin Goldstein"
-		{ 152, 42, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString + 17].c_str() }, // "Macintosh Testing"
-		{ 144, 57, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[baseString + 19].c_str() }, // "Jo Ashburn"
+		{ 137, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString18].c_str() }, // "Macintosh Orchestration"
+		{ 125, 19, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString20].c_str() }, // "Robin Goldstein"
+		{ 152, 42, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString19].c_str() }, // "Macintosh Testing"
+		{ 144, 57, kStyleHeaderSimple2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString21].c_str() }, // "Jo Ashburn"
 		TEXT_END_MARKER
 	};
 
@@ -871,37 +869,37 @@ void MacMI1Gui::runAboutDialogIndy4(MacDialogWindow *window) {
 	// does work in both versions.
 
 	const TextLine page10_cd[] = {
-		{ 2, 19, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[baseString + 20].c_str() }, // "\xD2djm\xD3  Sound and Music System \xA91992 Eric Johnston
-		{ 2, 39, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[baseString + 21].c_str() }, // "\xD2epx\xD3  Graphics Smoothing System \xA91992 Eric Johnson
+		{ 2, 19, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString22].c_str() }, // "\xD2djm\xD3  Sound and Music System \xA91992 Eric Johnston
+		{ 2, 39, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString23].c_str() }, // "\xD2epx\xD3  Graphics Smoothing System \xA91992 Eric Johnson
 		TEXT_END_MARKER
 	};
 
 	const TextLine page10_floppy[] = {
-		{ 2, 19, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[baseString + 20].c_str() }, // "\xD2djm\xD3  Sound and Music System \xA91992 Eric Johnston
-		{ 2, 39, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[baseString + 21].c_str() }, // "\xD2epx\xD3  Graphics Smoothing System \xA91992 Eric Johnson
-		{ 2, 54, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[baseString + 22].c_str() }, // "Type 'rough' to see the difference."
+		{ 2, 19, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString22].c_str() }, // "\xD2djm\xD3  Sound and Music System \xA91992 Eric Johnston
+		{ 2, 39, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString23].c_str() }, // "\xD2epx\xD3  Graphics Smoothing System \xA91992 Eric Johnson
+		{ 2, 54, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString38].c_str() }, // "Type 'rough' to see the difference."
 		TEXT_END_MARKER
 	};
 
 	const TextLine page11[] = {
-		{ 112, 9, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2].c_str() }, // "Stumped?  Hint books are available!"
-		{ 98, 27, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 3].c_str() }, // "In the U.S. call"
-		{ 172, 27, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 1].c_str() }, // "1 (800) STAR-WARS"
-		{ 172, 37, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 5].c_str() }, // "that\xD5s  1 (800) 782-7927"
-		{ 102, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 4].c_str() }, // "In Canada call"
-		{ 172, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 2].c_str() }, // "1 (800) 828-7927"
+		{ 112, 9, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString24].c_str() }, // "Stumped?  Hint books are available!"
+		{ 98, 27, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString27].c_str() }, // "In the U.S. call"
+		{ 172, 27, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString25].c_str() }, // "1 (800) STAR-WARS"
+		{ 172, 37, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString29].c_str() }, // "that\xD5s  1 (800) 782-7927"
+		{ 102, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString28].c_str() }, // "In Canada call"
+		{ 172, 57, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString26].c_str() }, // "1 (800) 828-7927"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page12[] = {
-		{ 110, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 6].c_str() }, // "Need a hint NOW?  Having problems?"
-		{ 89, 19, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 9].c_str() }, // "For technical support call"
-		{ 213, 19, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 7].c_str() }, // "1 (415) 721-3333"
-		{ 145, 29, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 10].c_str() }, // "For hints call"
-		{ 213, 29, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 8].c_str() }, // "1 (900) 740-JEDI"
-		{ 88, 44, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 11].c_str() }, // "The charge for the hint line is 75\xA2 per minute."
-		{ 93, 54, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 12].c_str() }, // "(You must have your parents\xD5 permission to"
-		{ 108, 64, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[baseString2 + 13].c_str() }, // "call this number if you are under 18.)"
+		{ 110, 4, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString30].c_str() }, // "Need a hint NOW?  Having problems?"
+		{ 89, 19, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString33].c_str() }, // "For technical support call"
+		{ 213, 19, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString31].c_str() }, // "1 (415) 721-3333"
+		{ 145, 29, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString34].c_str() }, // "For hints call"
+		{ 213, 29, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString32].c_str() }, // "1 (900) 740-JEDI"
+		{ 88, 44, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString35].c_str() }, // "The charge for the hint line is 75\xA2 per minute."
+		{ 93, 54, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString36].c_str() }, // "(You must have your parents\xD5 permission to"
+		{ 108, 64, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString37].c_str() }, // "call this number if you are under 18.)"
 		TEXT_END_MARKER
 	};
 
@@ -1062,8 +1060,8 @@ bool MacMI1Gui::runSaveDialog(int &saveSlotToHandle, Common::String &name) {
 	Common::StringArray savegameNames;
 	prepareSaveLoad(savegameNames, busySlots, slotIds, ARRAYSIZE(busySlots));
 
-	Common::String saveGameFileAsResStr = _strsStrings[103].c_str();
-	Common::String gameFileResStr = _strsStrings[104].c_str();
+	Common::String saveGameFileAsResStr = _strsStrings[kMSISaveGameFileAs].c_str();
+	Common::String gameFileResStr = _strsStrings[kMSIGameFile].c_str();
 
 	int firstAvailableSlot = -1;
 	for (int i = 1; i < ARRAYSIZE(busySlots); i++) { // Skip the autosave slot
@@ -1235,26 +1233,7 @@ bool MacMI1Gui::handleEvent(Common::Event event) {
 				if (_vm->_useMacGraphicsSmoothing && !_roughWarned) {
 					_roughWarned = true;
 
-					Common::String warnString;
-
-					switch (_vm->_game.id) {
-					case GID_MONKEY2:
-						warnString = _strsStrings[98];
-						break;
-
-					case GID_INDY4:
-						if (_vm->_game.variant && !strcmp(_vm->_game.variant, "Floppy"))
-							warnString = _strsStrings[96];
-						else
-							warnString = _strsStrings[213];
-						break;
-
-					default:
-						warnString = "Warning: The 'rough' command will make your Mac screen look dangerously like a PC.  (eek!)";
-						break;
-					}
-
-					if (!runOkCancelDialog(warnString))
+					if (!runOkCancelDialog(_strsStrings[kMSIRoughCommandMsg]))
 						return false;
 				}
 				_vm->mac_toggleSmoothing();
diff --git a/engines/scumm/macgui/macgui_mi1.h b/engines/scumm/macgui/macgui_mi1.h
index ad59e7c049d..707eefaaa9b 100644
--- a/engines/scumm/macgui/macgui_mi1.h
+++ b/engines/scumm/macgui/macgui_mi1.h
@@ -57,8 +57,6 @@ protected:
 	bool runSaveDialog(int &saveSlotToHandle, Common::String &name);
 	bool runOptionsDialog();
 
-	void readStrings() override;
-
 private:
 	struct AboutPage {
 		const TextLine *text;


Commit: 6e1879f61125a9d50e3425642b11cc8c4847d3ac
    https://github.com/scummvm/scummvm/commit/6e1879f61125a9d50e3425642b11cc8c4847d3ac
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Add strings table for another Fate of Atlantis version

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 77b7105a604..752cb9ff2cf 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -1331,6 +1331,68 @@ static MacGuiImpl::MacSTRSParsingEntry strsIndy4FloppyVariant1Table[] = {
 	{ MacGuiImpl::kMSIAboutString37,              "Pascal", 1 },
 };
 
+static MacGuiImpl::MacSTRSParsingEntry strsIndy4FloppyVariant2Table[] = {
+	SKIP_C(93),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
+	{ MacGuiImpl::kMSIRoughCommandMsg,            "C",      1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
+	SKIP_C(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
+	SKIP_P(1),
+	SKIP_P(1),
+	SKIP_P(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
+	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
+	SKIP_C(6),
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString38,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString35,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString36,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString37,              "Pascal", 1 },
+};
+
 #undef SKIP_C
 #undef SKIP_P
 
@@ -1368,6 +1430,11 @@ void MacGuiImpl::readStrings() {
 			parsingTable = strsIndy4FloppyVariant1Table;
 			parsingTableSize = ARRAYSIZE(strsIndy4FloppyVariant1Table);
 			break;
+		case 6612:
+			// V1.0 10-9-92 from the LucasArts Mac CD Game Pack II
+			parsingTable = strsIndy4FloppyVariant2Table;
+			parsingTableSize = ARRAYSIZE(strsIndy4FloppyVariant2Table);
+			break;
 		case 6836: // CD
 			parsingTable = strsIndy4CDVariant1Table;
 			parsingTableSize = ARRAYSIZE(strsIndy4CDVariant1Table);


Commit: 0324de1b5b0618afd376227c3f8ad0159872f0b0
    https://github.com/scummvm/scummvm/commit/0324de1b5b0618afd376227c3f8ad0159872f0b0
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Add another Monkey Island 2 variant

This needs to be rearranged a bit, but I don't have "variant 1" so I
can't add information about its size.

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 752cb9ff2cf..74539e4d94b 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -1205,6 +1205,69 @@ static MacGuiImpl::MacSTRSParsingEntry strsMI2Variant1Table[] = {
 	// SKIP_C(95)
 };
 
+static MacGuiImpl::MacSTRSParsingEntry strsMI2Variant2Table[] = {
+	SKIP_C(93),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
+	SKIP_C(2),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
+	{ MacGuiImpl::kMSIRoughCommandMsg,            "C",      1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
+	SKIP_C(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
+	SKIP_P(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
+	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
+	SKIP_C(6),
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString35,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString36,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString37,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString38,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString39,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString40,              "Pascal", 1 },
+	// SKIP_C(95)
+};
+
 static MacGuiImpl::MacSTRSParsingEntry strsIndy4CDVariant1Table[] = {
 	SKIP_C(144),
 	SKIP_P(1),
@@ -1422,8 +1485,17 @@ void MacGuiImpl::readStrings() {
 		parsingTable = strsMI1Table;
 		parsingTableSize = ARRAYSIZE(strsMI1Table);
 	} else if (_vm->_game.id == GID_MONKEY2) {
-		parsingTable = strsMI2Variant1Table;
-		parsingTableSize = ARRAYSIZE(strsMI2Variant1Table);
+		switch (strsLen) {
+		case 6602:
+			// v1.0 11/5/92 from the LucasArts Mac CD Game Pack II
+			parsingTable = strsMI2Variant2Table;
+			parsingTableSize = ARRAYSIZE(strsMI2Variant2Table);
+			break;
+		default:
+			parsingTable = strsMI2Variant1Table;
+			parsingTableSize = ARRAYSIZE(strsMI2Variant1Table);
+			break;
+		}
 	} else if (_vm->_game.id == GID_INDY4) {
 		switch (strsLen) {
 		case 6516:


Commit: 4ad96f14f92425232a01d6e13dc98fc0bb6cfe1f
    https://github.com/scummvm/scummvm/commit/4ad96f14f92425232a01d6e13dc98fc0bb6cfe1f
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Add size information about some other Mac games

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 74539e4d94b..88baa6cb81c 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -1476,14 +1476,29 @@ void MacGuiImpl::readStrings() {
 	int parsingTableSize = 0;
 
 	if (_vm->_game.id == GID_INDY3) {
-		parsingTable = strsIndy3Table;
-		parsingTableSize = ARRAYSIZE(strsIndy3Table);
+		switch (strsLen) {
+		case 2950:
+			// 1.7 8/17/90
+			parsingTable = strsIndy3Table;
+			parsingTableSize = ARRAYSIZE(strsIndy3Table);
+			break;
+		}
 	} else if (_vm->_game.id == GID_LOOM) {
-		parsingTable = strsLoomTable;
-		parsingTableSize = ARRAYSIZE(strsLoomTable);
+		switch (strsLen) {
+		case 3184:
+			// 1.2 25-JAN-91
+			parsingTable = strsLoomTable;
+			parsingTableSize = ARRAYSIZE(strsLoomTable);
+			break;
+		}
 	} else if (_vm->_game.id == GID_MONKEY) {
-		parsingTable = strsMI1Table;
-		parsingTableSize = ARRAYSIZE(strsMI1Table);
+		switch (strsLen) {
+		case 5986:
+			// version 2.4
+			parsingTable = strsMI1Table;
+			parsingTableSize = ARRAYSIZE(strsMI1Table);
+			break;
+		}
 	} else if (_vm->_game.id == GID_MONKEY2) {
 		switch (strsLen) {
 		case 6602:
@@ -1508,19 +1523,19 @@ void MacGuiImpl::readStrings() {
 			parsingTableSize = ARRAYSIZE(strsIndy4FloppyVariant2Table);
 			break;
 		case 6836: // CD
+			// V1.0 10-9-92
 			parsingTable = strsIndy4CDVariant1Table;
 			parsingTableSize = ARRAYSIZE(strsIndy4CDVariant1Table);
 			break;
-		default:
-			warning("MacGuiImpl::readStrings(): String parsing table not defined for this variant of the game; STRS resource %d bytes", strsLen);
-			break;
 		}
-
 	} else {
 		error("MacGuiImpl::readStrings(): String parsing table not defined for this game");
 	}
 
-	parseSTRSBlock(strsData, parsingTable, parsingTableSize);
+	if (parsingTable)
+		parseSTRSBlock(strsData, parsingTable, parsingTableSize);
+	else
+		warning("MacGuiImpl::readStrings(): String parsing table not defined for this variant of the game; STRS resource %d bytes", strsLen);
 
 	free(strsBlock);
 	delete strsStream;


Commit: 007d56d9c972fa888ae57e0775fc29301c32932c
    https://github.com/scummvm/scummvm/commit/007d56d9c972fa888ae57e0775fc29301c32932c
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Fix "rough" command on MI1 Mac

Changed paths:
    engines/scumm/macgui/macgui_mi1.cpp


diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index 489ae19b5a9..47363f4adbd 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -1233,7 +1233,7 @@ bool MacMI1Gui::handleEvent(Common::Event event) {
 				if (_vm->_useMacGraphicsSmoothing && !_roughWarned) {
 					_roughWarned = true;
 
-					if (!runOkCancelDialog(_strsStrings[kMSIRoughCommandMsg]))
+					if (!_strsStrings[kMSIRoughCommandMsg].empty() && !runOkCancelDialog(_strsStrings[kMSIRoughCommandMsg]))
 						return false;
 				}
 				_vm->mac_toggleSmoothing();


Commit: 9e4a4f8c77fb80dd9704b5da657ec0c98018ce67
    https://github.com/scummvm/scummvm/commit/9e4a4f8c77fb80dd9704b5da657ec0c98018ce67
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
GRAPHICS: Cleaned up and renamed unpackBitsRgn()

This is actually used for images without Rgn as well. The new code
should be easier to understand, and it handles all of the black and
white images from the Mac versions of Loom, Indy 3, Indy 4, MI1, and
MI2. It's still unfortunate - and perhaps unnecessary - that we had two
different decoders for Rect/Rgn, but I'm not comfortable modifying the
old one. Maybe later.

Changed paths:
    image/pict.cpp
    image/pict.h


diff --git a/image/pict.cpp b/image/pict.cpp
index feb7493e612..defeb3c09ef 100644
--- a/image/pict.cpp
+++ b/image/pict.cpp
@@ -22,8 +22,10 @@
 #include "image/pict.h"
 #include "image/codecs/codec.h"
 
+#include "common/bitstream.h"
 #include "common/debug.h"
 #include "common/endian.h"
+#include "common/memstream.h"
 #include "common/stream.h"
 #include "common/substream.h"
 #include "common/textconsole.h"
@@ -217,11 +219,11 @@ void PICTDecoder::o_longText(Common::SeekableReadStream &stream) {
 
 void PICTDecoder::o_bitsRgn(Common::SeekableReadStream &stream) {
 	// Copy unpacked data with clipped region (8bpp or lower)
-	unpackBitsRectOrRgn(stream, false);
+	unpackBitsRectOrRgn(stream, false, true);
 }
 
 void PICTDecoder::o_packBitsRgn(Common::SeekableReadStream &stream) {
-	unpackBitsRectOrRgn(stream, true);
+	unpackBitsRectOrRgn(stream, true, true);
 }
 
 void PICTDecoder::o_shortComment(Common::SeekableReadStream &stream) {
@@ -256,12 +258,12 @@ void PICTDecoder::o_headerOp(Common::SeekableReadStream &stream) {
 
 void PICTDecoder::on_bitsRect(Common::SeekableReadStream &stream) {
 	// Copy unpacked data with clipped rectangle (8bpp or lower)
-	unpackBitsRectOrRgn(stream, false);
+	unpackBitsRectOrRgn(stream, false, false);
 }
 
 void PICTDecoder::on_packBitsRect(Common::SeekableReadStream &stream) {
 	// Unpack data (8bpp or lower)
-	unpackBitsRectOrRgn(stream, true);
+	unpackBitsRectOrRgn(stream, true, false);
 }
 
 void PICTDecoder::on_directBitsRect(Common::SeekableReadStream &stream) {
@@ -271,7 +273,7 @@ void PICTDecoder::on_directBitsRect(Common::SeekableReadStream &stream) {
 	unpackBitsRect(stream, false, pixMap);
 }
 
-void PICTDecoder::unpackBitsRectOrRgn(Common::SeekableReadStream &stream, bool hasPackBits) {
+void PICTDecoder::unpackBitsRectOrRgn(Common::SeekableReadStream &stream, bool compressed, bool hasRegion) {
     PixMap pixMap = readRowBytes(stream, false);
     bool hasPixMap = (pixMap.rowBytes & 0x8000);
     pixMap.rowBytes = pixMap.rowBytes & 0x7fff;
@@ -279,7 +281,7 @@ void PICTDecoder::unpackBitsRectOrRgn(Common::SeekableReadStream &stream, bool h
     if (hasPixMap)
         unpackBitsRect(stream, true, pixMap);
     else
-        unpackBitsRgn(stream, hasPackBits);
+        unpackBits(stream, compressed, hasRegion);
 }
 
 void PICTDecoder::on_compressedQuickTime(Common::SeekableReadStream &stream) {
@@ -549,83 +551,84 @@ void PICTDecoder::unpackBitsRect(Common::SeekableReadStream &stream, bool withPa
 	delete[] buffer;
 }
 
-void PICTDecoder::unpackBitsRgn(Common::SeekableReadStream &stream, bool compressed) {
-	int x1, x2, y1, y2;
-	int size = 0;
+// TODO: It should be possible to merge this with unpackBitsRect, but that's
+// a story for another day because this works for now.
 
+void PICTDecoder::unpackBits(Common::SeekableReadStream &stream, bool compressed, bool hasRegion) {
 	if (!_outputSurface) {
 		_outputSurface = new Graphics::Surface();
 		_outputSurface->create(_imageRect.width(), _imageRect.height(), Graphics::PixelFormat::createFormatCLUT8());
 	}
 
-	y1 = stream.readSint16BE();
-	x1 = stream.readSint16BE();
-	y2 = stream.readSint16BE();
-	x2 = stream.readSint16BE();
+	int y1 = stream.readSint16BE();
+	int x1 = stream.readSint16BE();
+	int y2 = stream.readSint16BE();
+	int x2 = stream.readSint16BE();
 
-	stream.skip(8);	// Skip srcRect
-	stream.skip(8);	// Skip dstRect
-	stream.skip(2);	// Skip mode
-	stream.skip(stream.readUint16BE() - 2);
+	stream.skip(8); // srcRect
+	stream.skip(8); // dstRect
+	stream.skip(2); // mode
 
-	int x = 0;
-	int y = 0;
-	byte value;
+	if (hasRegion)
+		stream.skip(stream.readUint16BE() - 2);
+
+	Common::Rect outputRect(_outputSurface->w, _outputSurface->h);
 
 	if (!compressed) {
-		for (y = y1; y < y2 && y < _imageRect.height(); y++) {
-			byte b = stream.readByte();
-			byte bit = 0x80;
+		Common::BitStream8MSB bs(stream);
 
-			for (x = x1; x < x2 && x < _imageRect.width(); x++) {
-				if (b & bit)
-					_outputSurface->setPixel(x, y, 0x0F);
-				else
-					_outputSurface->setPixel(x, y, 0x00);
+		for (int y = y1; y < y2; y++) {
+			int yPos = y - _imageRect.top;
 
-				bit >>= 1;
+			for (int x = x1; x < x2; x++) {
+				int xPos = x - _imageRect.left;
 
-				if (bit == 0) {
-					b = stream.readByte();
-					bit = 0x80;
-				}
+				uint bit = bs.getBit();
+
+				if (outputRect.contains(xPos, yPos))
+					_outputSurface->setPixel(xPos, yPos, bit);
 			}
 		}
-	} else {
-		for (y = y1; y < y2 && y < _imageRect.height(); y++) {
-			x = x1;
-			size = stream.readByte();
-
-			while (size > 0) {
-				byte count = stream.readByte();
-				size--;
-
-				bool repeat;
-
-				if (count >= 128) {
-					// Repeat value
-					count = 256 - count;
-					repeat = true;
-					value = stream.readByte();
-					size--;
-				} else {
-					// Copy values
-					repeat = false;
-					value = 0;
-				}
 
-				for (int j = 0; j <= count; j++) {
-					if (!repeat) {
-						value = stream.readByte();
-						size--;
-					}
-					for (int k = 7; k >= 0 && x < x2 && x < _imageRect.width(); k--, x++) {
-						if (value & (1 << k))
-							_outputSurface->setPixel(x, y, 0x0F);
-						else
-							_outputSurface->setPixel(x, y, 0x00);
-					}
-				}
+		return;
+	}
+
+	for (int y = y1; y < y2; y++) {
+		int yPos = y - _imageRect.top;
+		int x = x1;
+
+		byte rowBytes = stream.readByte();
+		byte readBytes = 0;
+
+		while (readBytes < rowBytes) {
+			byte rowBuf[128];
+			byte bufLen;
+
+			byte value = stream.readByte();
+			readBytes++;
+
+			if (value >= 128) {
+				bufLen = (256 - value) + 1;
+				byte repeatValue = stream.readByte();
+				memset(rowBuf, repeatValue, bufLen);
+				readBytes++;
+			} else {
+				bufLen = value + 1;
+				stream.read(rowBuf, bufLen);
+				readBytes += bufLen;
+			}
+
+			Common::MemoryReadStream ms(rowBuf, bufLen);
+			Common::BitStream8MSB bs(ms);
+
+			for (int i = 0; i < 8 * bufLen; i++) {
+				int xPos = x - _imageRect.left;
+				uint bit = bs.getBit();
+
+				if (outputRect.contains(xPos, yPos))
+					_outputSurface->setPixel(xPos, yPos, bit);
+
+				x++;
 			}
 		}
 	}
diff --git a/image/pict.h b/image/pict.h
index 29b8cb9c8cd..ec301e7e885 100644
--- a/image/pict.h
+++ b/image/pict.h
@@ -98,8 +98,8 @@ private:
 	int _version;
 
 	// Utility Functions
-	void unpackBitsRectOrRgn(Common::SeekableReadStream &stream, bool hasPackBits);
-	void unpackBitsRgn(Common::SeekableReadStream &stream, bool compressed);
+	void unpackBitsRectOrRgn(Common::SeekableReadStream &stream, bool compressed, bool hasRegion);
+	void unpackBits(Common::SeekableReadStream &stream, bool compressed, bool hasRegion);
 	void unpackBitsRect(Common::SeekableReadStream &stream, bool withPalette, PixMap pixMap);
 	void unpackBitsLine(byte *out, uint32 length, Common::SeekableReadStream *stream, byte bitsPerPixel, byte bytesPerPixel);
 	void skipBitsRect(Common::SeekableReadStream &stream, bool withPalette);


Commit: 71bb8340f650630b89a174592093edff7e4401e6
    https://github.com/scummvm/scummvm/commit/71bb8340f650630b89a174592093edff7e4401e6
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Add LucasArts logo to the MI1/MI2/Indy4 About dialogs

The PICT decoder can finally decode that graphics correctly. Also fixed
the fade effect in MI2, now that I can actually see what happens.

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/macgui/macgui_mi1.cpp


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 88baa6cb81c..acccd03fee8 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -625,8 +625,8 @@ Graphics::Surface *MacGuiImpl::loadPict(int id) {
 		}
 
 		if (!pict.getPaletteColorCount()) {
-			paletteMap[15] = getBlack();
 			paletteMap[0] = getWhite();
+			paletteMap[1] = getBlack();
 		}
 
 		if (palette) {
diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index 47363f4adbd..0b63454bfd0 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -404,7 +404,7 @@ void MacMI1Gui::runAboutDialog() {
 }
 
 void MacMI1Gui::runAboutDialogMI1(MacDialogWindow *window) {
-//	Graphics::Surface *lucasArts = loadPict(5000);
+	Graphics::Surface *lucasArts = loadPict(5000);
 	Graphics::Surface *monkeys = loadPict(5001);
 
 	Graphics::Surface *s = window->innerSurface();
@@ -547,7 +547,7 @@ void MacMI1Gui::runAboutDialogMI1(MacDialogWindow *window) {
 		switch (page) {
 		case 0:
 			s->fillRect(drawArea, black);
-//			window->drawSprite(lucasArts, 0, 0, drawArea);
+			window->drawSprite(lucasArts, 64, 2, drawArea);
 			break;
 
 		case 1:
@@ -628,7 +628,7 @@ void MacMI1Gui::runAboutDialogMI1(MacDialogWindow *window) {
 		page++;
 	}
 
-//	delete lucasArts;
+	delete lucasArts;
 	delete monkeys;
 }
 
@@ -659,7 +659,7 @@ void MacMI1Gui::drawShadow(Graphics::Surface *s, int x, int y, int h, Common::Pa
 void MacMI1Gui::runAboutDialogMI2(MacDialogWindow *window) {
 	Graphics::Surface *s = window->innerSurface();
 
-//	Graphics::Surface *lucasArts = loadPict(5000);
+	Graphics::Surface *lucasArts = loadPict(5000);
 
 	const TextLine page3[] = {
 		{ 0, 68, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString2].c_str() }, // "PRESENTS"
@@ -768,11 +768,11 @@ void MacMI1Gui::runAboutDialogMI2(MacDialogWindow *window) {
 		switch (page) {
 		case 0:
 			s->fillRect(drawArea, black);
+			window->drawSprite(lucasArts, 64, 2, drawArea);
 			break;
 
 		case 1:
-			// TODO: Verify this once the graphics work
-			window->fillPattern(drawArea, 0xEAEA, true, false);
+			window->fillPattern(drawArea, 0xADAD, true, false);
 			break;
 
 		case 2:
@@ -805,7 +805,7 @@ void MacMI1Gui::runAboutDialogMI2(MacDialogWindow *window) {
 		page++;
 	}
 
-//	delete lucasArts;
+	delete lucasArts;
 }
 
 void MacMI1Gui::runAboutDialogIndy4(MacDialogWindow *window) {
@@ -813,7 +813,7 @@ void MacMI1Gui::runAboutDialogIndy4(MacDialogWindow *window) {
 
 	Graphics::Surface *s = window->innerSurface();
 
-//	Graphics::Surface *lucasArts = loadPict(5000);
+	Graphics::Surface *lucasArts = loadPict(5000);
 	Graphics::Surface *indianaJones = loadPict(5001);
 
 	const TextLine page3[] = {
@@ -937,6 +937,7 @@ void MacMI1Gui::runAboutDialogIndy4(MacDialogWindow *window) {
 		switch (page) {
 		case 0:
 			s->fillRect(drawArea, black);
+			window->drawSprite(lucasArts, 64, 2, drawArea);
 			break;
 
 		case 1:
@@ -988,7 +989,7 @@ void MacMI1Gui::runAboutDialogIndy4(MacDialogWindow *window) {
 		page++;
 	}
 
-//	delete lucasArts;
+	delete lucasArts;
 	delete indianaJones;
 }
 


Commit: c5b62faf147281ee6f52ff82f8a48b4e49da73e3
    https://github.com/scummvm/scummvm/commit/c5b62faf147281ee6f52ff82f8a48b4e49da73e3
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Fix and clean up more STRS handling

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/macgui/macgui_mi1.cpp
    engines/scumm/macgui/macgui_mi1.h


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index acccd03fee8..f5d9833be67 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -1146,7 +1146,6 @@ static MacGuiImpl::MacSTRSParsingEntry strsMI2Variant1Table[] = {
 	SKIP_C(93),
 	SKIP_P(1),
 	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
-	SKIP_C(1),
 	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
 	{ MacGuiImpl::kMSIRoughCommandMsg,            "C",      1 },
 	SKIP_C(1),
@@ -1501,15 +1500,15 @@ void MacGuiImpl::readStrings() {
 		}
 	} else if (_vm->_game.id == GID_MONKEY2) {
 		switch (strsLen) {
+		case 6574:
+			parsingTable = strsMI2Variant1Table;
+			parsingTableSize = ARRAYSIZE(strsMI2Variant1Table);
+			break;
 		case 6602:
 			// v1.0 11/5/92 from the LucasArts Mac CD Game Pack II
 			parsingTable = strsMI2Variant2Table;
 			parsingTableSize = ARRAYSIZE(strsMI2Variant2Table);
 			break;
-		default:
-			parsingTable = strsMI2Variant1Table;
-			parsingTableSize = ARRAYSIZE(strsMI2Variant1Table);
-			break;
 		}
 	} else if (_vm->_game.id == GID_INDY4) {
 		switch (strsLen) {
diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_mi1.cpp
index 0b63454bfd0..d19e00a9fdc 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_mi1.cpp
@@ -48,232 +48,6 @@ MacMI1Gui::MacMI1Gui(ScummEngine *vm, const Common::Path &resourceFile) : MacGui
 	readStrings();
 }
 
-MacMI1Gui::~MacMI1Gui() {
-}
-
-#if 0
-void MacMI1Gui::readStrings() {
-	Common::MacResManager resource;
-	resource.open(_resourceFile);
-	uint32 strsLen = resource.getResLength(MKTAG('S', 'T', 'R', 'S'), 0);
-
-	if (strsLen <= 0)
-		return;
-
-	Common::SeekableReadStream *strsStream = resource.getResource(MKTAG('S', 'T', 'R', 'S'), 0);
-	uint8 *strsBlock = (uint8 *)malloc(strsLen);
-	strsStream->read(strsBlock, strsLen);
-
-	uint8 *strsData = strsBlock;
-
-	// Most of these are debug strings. We parse the entire STRS block anyway,
-	// for any future need.
-
-	if (_vm->_game.id == GID_MONKEY) {
-		// Debug strings
-		for (int i = 0; i < 93; i++) {
-			_strsStrings.emplace_back(readCString(strsData));
-		}
-
-		// "\x14", "About Monkey Island...<B;(-"
-		for (int i = 0; i < 2; i++) {
-			_strsStrings.emplace_back(readPascalString(strsData));
-		}
-
-		// "Are you sure you want to quit?", "Are you sure you want to quit?",
-		// "Are you sure you want to restart this game from the beginning?",
-		// "Are you sure you want to quit?"
-		for (int i = 0; i < 4; i++) {
-			_strsStrings.emplace_back(readCString(strsData));
-		}
-
-		// "macPixHead is NULL", "Monkey Island"
-		for (int i = 0; i < 2; i++) {
-			_strsStrings.emplace_back(readPascalString(strsData));
-		}
-
-		// "CopyBits error:"
-		_strsStrings.emplace_back(readCString(strsData));
-
-		// "Open Game File...", "Save Game File as..." "Game file"
-		for (int i = 0; i < 3; i++) {
-			_strsStrings.emplace_back(readPascalString(strsData));
-		}
-
-		// "This disk is full.  The game was not saved."
-		_strsStrings.emplace_back(readCString(strsData));
-
-		// "An error occured while saving.  The game was not saved.  Please try saving the game to another disk."
-		_strsStrings.emplace_back(readCString(strsData));
-
-		// "At this size, you will not be able to fit the whole game on your screen."
-		_strsStrings.emplace_back(readCString(strsData));
-
-		// Debug strings
-		for (int i = 0; i < 3; i++) {
-			_strsStrings.emplace_back(readCString(strsData));
-		}
-
-		for (int i = 0; i < 2; i++) {
-			_strsStrings.emplace_back(readPascalString(strsData));
-		}
-
-		// All the "About" dialog strings
-		for (int i = 0; i < 32; i++) {
-			_strsStrings.emplace_back(readPascalString(strsData));
-		}
-
-		// Remaining debug strings
-		for (int i = 0; i < 75; i++) {
-			_strsStrings.emplace_back(readCString(strsData));
-		}
-	} else if (_vm->_game.id == GID_MONKEY2) {
-		// Debug strings
-		for (int i = 0; i < 93; i++) {
-			_strsStrings.emplace_back(readCString(strsData));
-		}
-
-		// "\x14", "About Monkey Island 2...<B;(-"
-		for (int i = 0; i < 2; i++) {
-			_strsStrings.emplace_back(readPascalString(strsData));
-		}
-
-		// "Are you sure you want to quit?",
-		// "Warning: The 'rough' command will make your Mac screen look dangerously like a PC.  (eek!)",
-		// "Are you sure you want to quit?",
-		// "Are you sure you want to restart this game from the beginning?",
-		// "Are you sure you want to quit?"
-		for (int i = 0; i < 5; i++) {
-			_strsStrings.emplace_back(readCString(strsData));
-		}
-
-		// " macPixHead is NULL", "Monkey Island 2"
-		for (int i = 0; i < 2; i++) {
-			_strsStrings.emplace_back(readPascalString(strsData));
-		}
-
-		// "CopyBits error:"
-		_strsStrings.emplace_back(readCString(strsData));
-
-		// "Open Game File...", "Monkey2 temp", "Monkey2 temp", "Save Game File as...", "Game file"
-		for (int i = 0; i < 5; i++) {
-			_strsStrings.emplace_back(readPascalString(strsData));
-		}
-
-		// "This disk is full.  The game was not saved."
-		_strsStrings.emplace_back(readCString(strsData));
-
-		// "An error occured while saving.  The game was not saved.  Please try saving the game to another disk."
-		_strsStrings.emplace_back(readCString(strsData));
-
-		// "At this size, you will not be able to fit the whole game on your screen."
-		_strsStrings.emplace_back(readCString(strsData));
-
-		// Debug strings
-		for (int i = 0; i < 3; i++) {
-			_strsStrings.emplace_back(readCString(strsData));
-		}
-
-		for (int i = 0; i < 2; i++) {
-			_strsStrings.emplace_back(readPascalString(strsData));
-		}
-
-		// All the "About" dialog strings
-		for (int i = 0; i < 40; i++) {
-			_strsStrings.emplace_back(readPascalString(strsData));
-		}
-
-		// More debug strings...
-		for (int i = 0; i < 95; i++) {
-			_strsStrings.emplace_back(readCString(strsData));
-		}
-	} else if (_vm->_game.id == GID_INDY4) {
-		bool isFloppyVersion = _vm->_game.variant && !strcmp(_vm->_game.variant, "Floppy");
-
-		// Debug strings
-		for (int i = 0; i < (isFloppyVersion ? 93 : 144); i++) {
-			_strsStrings.emplace_back(readCString(strsData));
-		}
-
-		if (!isFloppyVersion) {
-			_strsStrings.emplace_back(readPascalString(strsData));
-
-			for (int i = 0; i < 2; i++) {
-				_strsStrings.emplace_back(readCString(strsData));
-			}
-
-			for (int i = 0; i < 10; i++) {
-				_strsStrings.emplace_back(readPascalString(strsData));
-			}
-
-			for (int i = 0; i < 51; i++) {
-				_strsStrings.emplace_back(readCString(strsData));
-			}
-		}
-
-		// "\x14", "About Indy Atlantis...<B;(-"
-		for (int i = 0; i < 2; i++) {
-			_strsStrings.emplace_back(readPascalString(strsData));
-		}
-
-		if (!isFloppyVersion) {
-			// "Indy Temp", "Indy Temp"
-			for (int i = 0; i < 2; i++) {
-				_strsStrings.emplace_back(readPascalString(strsData));
-			}
-		}
-
-		// "Are you sure you want to quit?",
-		// "Warning: The 'rough' command will make your Mac screen look dangerously like a PC.  (eek!)",
-		// "Are you sure you want to quit?",
-		// "Are you sure you want to restart this game from the beginning?",
-		// "Are you sure you want to quit?"
-		for (int i = 0; i < 5; i++) {
-			_strsStrings.emplace_back(readCString(strsData));
-		}
-
-		// " macPixHead is NULL", "Indy Atlantis"
-		for (int i = 0; i < 2; i++) {
-			_strsStrings.emplace_back(readPascalString(strsData));
-		}
-
-		// "CopyBits error:"
-		_strsStrings.emplace_back(readCString(strsData));
-
-		// "Open Game File...", "Indy Atlantis IQ Points", "Indy Atlantis IQ Points",
-		// "Indy Temp", "Indy Temp", "Save Game File as...", "Game file"
-		for (int i = 0; i < 7; i++) {
-			_strsStrings.emplace_back(readPascalString(strsData));
-		}
-
-		// "This disk is full.  The game was not saved."
-		_strsStrings.emplace_back(readCString(strsData));
-
-		// "An error occured while saving.  The game was not saved.  Please try saving the game to another disk."
-		_strsStrings.emplace_back(readCString(strsData));
-
-		// "At this size, you will not be able to fit the whole game on your screen."
-		_strsStrings.emplace_back(readCString(strsData));
-
-		// Debug strings
-		for (int i = 0; i < 3; i++) {
-			_strsStrings.emplace_back(readCString(strsData));
-		}
-
-		for (int i = 0; i < 2; i++) {
-			_strsStrings.emplace_back(readPascalString(strsData));
-		}
-
-		// All the "About" dialog strings
-		for (int i = 0; i < (isFloppyVersion ? 38 : 37); i++) {
-			_strsStrings.emplace_back(readPascalString(strsData));
-		}
-	} 
-
-	free(strsBlock);
-	delete strsStream;
-}
-#endif
 const Graphics::Font *MacMI1Gui::getFontByScummId(int32 id) {
 	switch (id) {
 	case 0:
@@ -1013,7 +787,7 @@ bool MacMI1Gui::runOpenDialog(int &saveSlotToHandle) {
 	Common::StringArray savegameNames;
 	prepareSaveLoad(savegameNames, availSlots, slotIds, ARRAYSIZE(availSlots));
 
-	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, "Monkey Island", Graphics::kTextAlignLeft);
+	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, _strsStrings[kMSIGameName].c_str(), Graphics::kTextAlignLeft);
 	drawFakeDriveLabel(window, Common::Rect(242, 10, 340, 28), _hardDriveIcon, "ScummVM", Graphics::kTextAlignLeft);
 
 	window->addListBox(Common::Rect(14, 31, 232, 161), savegameNames, true);
@@ -1072,7 +846,7 @@ bool MacMI1Gui::runSaveDialog(int &saveSlotToHandle, Common::String &name) {
 		}
 	}
 
-	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, "Monkey Island", Graphics::kTextAlignLeft);
+	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, _strsStrings[kMSIGameName].c_str(), Graphics::kTextAlignLeft);
 	drawFakeDriveLabel(window, Common::Rect(242, 10, 340, 28), _hardDriveIcon, "ScummVM", Graphics::kTextAlignLeft);
 
 	window->addListBox(Common::Rect(14, 31, 232, 129), savegameNames, true, true);
diff --git a/engines/scumm/macgui/macgui_mi1.h b/engines/scumm/macgui/macgui_mi1.h
index 707eefaaa9b..51d1f6af8ef 100644
--- a/engines/scumm/macgui/macgui_mi1.h
+++ b/engines/scumm/macgui/macgui_mi1.h
@@ -33,7 +33,7 @@ class MacGuiImpl;
 class MacMI1Gui : public MacGuiImpl {
 public:
 	MacMI1Gui(ScummEngine *vm, const Common::Path &resourceFile);
-	~MacMI1Gui();
+	~MacMI1Gui() {}
 
 	const Common::String name() const { return "game"; }
 	int getNumColors() const override { return 256; }


Commit: 47ed8016d4a1c841aed70c7d8967e87281f66d2f
    https://github.com/scummvm/scummvm/commit/47ed8016d4a1c841aed70c7d8967e87281f66d2f
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: INDY3/LOOM: Fix artifacts caused by Mac screen Y offset

Changed paths:
    engines/scumm/charset.cpp
    engines/scumm/gfx_mac.cpp


diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index 28cc1f74b3f..f459887b503 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -1927,16 +1927,16 @@ void CharsetRendererMac::printCharInternal(int chr, int color, bool shadow, int
 			_font->drawChar(&_vm->_textSurface, chr, x + 2, y + 2, 0);
 
 			if (color != -1) {
-				_font->drawChar(_vm->_macScreen, chr, x + 1, y - 1, shadowColor);
-				_font->drawChar(_vm->_macScreen, chr, x - 1, y + 1, shadowColor);
-				_font->drawChar(_vm->_macScreen, chr, x + 2, y + 2, shadowColor);
+				_font->drawChar(_vm->_macScreen, chr, x + 1, y - 1 + 2 * _vm->_macScreenDrawOffset, shadowColor);
+				_font->drawChar(_vm->_macScreen, chr, x - 1, y + 1 + 2 * _vm->_macScreenDrawOffset, shadowColor);
+				_font->drawChar(_vm->_macScreen, chr, x + 2, y + 2 + 2 * _vm->_macScreenDrawOffset, shadowColor);
 			}
 		} else {
 			// Indy 3 uses simpler shadowing, and doesn't need the
 			// "draw only on text surface" hack.
 
 			_font->drawChar(&_vm->_textSurface, chr, x + 1, y + 1, 0);
-			_font->drawChar(_vm->_macScreen, chr, x + 1, y + 1, shadowColor);
+			_font->drawChar(_vm->_macScreen, chr, x + 1, y + 1 + 2 * _vm->_macScreenDrawOffset, shadowColor);
 		}
 	}
 
@@ -1953,14 +1953,14 @@ void CharsetRendererMac::printCharInternal(int chr, int color, bool shadow, int
 				for (int x0 = 0; x0 < _glyphSurface->w; x0++) {
 					if (_glyphSurface->getPixel(x0, y0)) {
 						int x1 = x + x0;
-						int y1 = y + y0;
+						int y1 = y + y0 + 2 * _vm->_macScreenDrawOffset;
 
 						_vm->_macScreen->setPixel(x1, y1, ((x1 + y1) & 1) ? 0 : 15);
 					}
 				}
 			}
 		} else {
-			_font->drawChar(_vm->_macScreen, chr, x, y, color);
+			_font->drawChar(_vm->_macScreen, chr, x, y + 2 * _vm->_macScreenDrawOffset, color);
 		}
 	}
 }
diff --git a/engines/scumm/gfx_mac.cpp b/engines/scumm/gfx_mac.cpp
index 37a11f22e8a..2492536e165 100644
--- a/engines/scumm/gfx_mac.cpp
+++ b/engines/scumm/gfx_mac.cpp
@@ -57,7 +57,7 @@ void ScummEngine::mac_drawStripToScreen(VirtScreen *vs, int top, int x, int y, i
 
 	const byte *pixels = vs->getPixels(x, top);
 	const byte *ts = (byte *)_textSurface.getBasePtr(x * 2, y * 2);
-	byte *mac = (byte *)_macScreen->getBasePtr(x * 2, y * 2);
+	byte *mac = (byte *)_macScreen->getBasePtr(x * 2, y * 2 + _macScreenDrawOffset * 2);
 
 	int pixelsPitch = vs->pitch;
 	int tsPitch = _textSurface.pitch;
@@ -112,7 +112,7 @@ void ScummEngine::mac_drawStripToScreen(VirtScreen *vs, int top, int x, int y, i
 		}
 	}
 
-	_system->copyRectToScreen(_macScreen->getBasePtr(x * 2, y * 2), _macScreen->pitch, x * 2, y * 2 + _macScreenDrawOffset * 2, width * 2, height * 2);
+	_system->copyRectToScreen(_macScreen->getBasePtr(x * 2, y * 2 + _macScreenDrawOffset * 2), _macScreen->pitch, x * 2, y * 2 + _macScreenDrawOffset * 2, width * 2, height * 2);
 }
 
 void ScummEngine::mac_drawIndy3TextBox() {
@@ -133,7 +133,7 @@ void ScummEngine::mac_drawIndy3TextBox() {
 	byte *ptr = (byte *)s->getBasePtr(0, 2);
 	int pitch = s->pitch;
 
-	_macScreen->copyRectToSurface(ptr, pitch, x, y, w, h);
+	_macScreen->copyRectToSurface(ptr, pitch, x, y + 2 * _macScreenDrawOffset, w, h + 2 * _macScreenDrawOffset);
 	_textSurface.fillRect(Common::Rect(x, y, x + w, y + h), 0);
 
 	mac_markScreenAsDirty(x, y, w, h);
@@ -147,7 +147,7 @@ void ScummEngine::mac_undrawIndy3TextBox() {
 	int w = s->w;
 	int h = s->h - 2;
 
-	_macScreen->fillRect(Common::Rect(x, y, x + w, y + h), 0);
+	_macScreen->fillRect(Common::Rect(x, y + 2 * _macScreenDrawOffset, x + w, y + h + 2 * _macScreenDrawOffset), 0);
 	_textSurface.fillRect(Common::Rect(x, y, x + w, y + h), CHARSET_MASK_TRANSPARENCY);
 
 	mac_markScreenAsDirty(x, y, w, h);


Commit: 4ec15a79326f2a7d61b710e970392a8ce2fb7428
    https://github.com/scummvm/scummvm/commit/4ec15a79326f2a7d61b710e970392a8ce2fb7428
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Move Mac STRS handling to macgui_strings.cpp

Changed paths:
  A engines/scumm/macgui/macgui_strings.cpp
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/macgui/macgui_impl.h
    engines/scumm/module.mk


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index f5d9833be67..e9e020c7a29 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -73,30 +73,6 @@ uint32 MacGuiImpl::getWhite() const {
 	return _windowManager->_colorWhite;
 }
 
-Common::String MacGuiImpl::readCString(uint8 *&data) {
-	Common::String result(reinterpret_cast<const char *>(data));
-	data += result.size() + 1;
-
-	while (data[0] == '\0') {
-		data++;
-	}
-
-	debug(8, "MacGuiImpl::readCString(): %s", result.c_str());
-	return result;
-}
-
-Common::String MacGuiImpl::readPascalString(uint8 *&data) {
-	Common::String result(reinterpret_cast<const char *>(&data[1]), (uint32)data[0]);
-	data += (uint32)data[0] + 1;
-
-	while (data[0] == '\0') {
-		data++;
-	}
-
-	debug(8, "MacGuiImpl::readPascalString(): %s", result.c_str());
-	return result;
-}
-
 int MacGuiImpl::toMacRoman(int unicode) const {
 	if (unicode >= 32 && unicode <= 127)
 		return unicode;
@@ -967,605 +943,4 @@ void MacGuiImpl::drawBitmap(Graphics::Surface *s, Common::Rect r, const uint16 *
 	}
 }
 
-#define SKIP_C(x) { MacGuiImpl::kMSISkip, "C",      x }
-#define SKIP_P(x) { MacGuiImpl::kMSISkip, "Pascal", x }
-
-static MacGuiImpl::MacSTRSParsingEntry strsIndy3Table[] = {
-	SKIP_C(6),
-	SKIP_P(2),
-	SKIP_C(2),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
-	SKIP_P(2),
-	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
-	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
-	SKIP_P(1),
-	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
-	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
-	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
-	SKIP_P(2),
-	SKIP_C(2),
-	SKIP_P(1),
-	SKIP_C(67),
-	SKIP_P(2),
-	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString3,               "C",      1 },
-	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
-	// SKIP_C(1),
-	// SKIP_P(4),
-	// SKIP_C(3),
-	// SKIP_P(2),
-	// SKIP_C(4),
-	// SKIP_P(1),
-	// SKIP_C(1),
-	// SKIP_P(5),
-};
-
-static MacGuiImpl::MacSTRSParsingEntry strsLoomTable[] = {
-	SKIP_C(6),
-	SKIP_P(2),
-	SKIP_C(2),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
-	SKIP_P(2),
-	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
-	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
-	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
-	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
-	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
-	SKIP_C(2),
-	SKIP_P(1),
-	SKIP_C(67),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString2,               "C",      1 },
-	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
-	// SKIP_C(1),
-	// SKIP_P(4),
-	// SKIP_C(3),
-	// SKIP_P(2),
-	// SKIP_C(4),
-	// SKIP_P(1),
-	// SKIP_C(1),
-	// SKIP_P(5),
-	// SKIP_C(7),
-};
-
-static MacGuiImpl::MacSTRSParsingEntry strsMI1Table[] = {
-	SKIP_C(93),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
-	SKIP_C(1),
-	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
-	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
-	SKIP_C(1),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
-	SKIP_C(1),
-	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
-	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
-	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
-	SKIP_C(6),
-	SKIP_P(2),
-	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
-	// SKIP_C(75)
-};
-
-static MacGuiImpl::MacSTRSParsingEntry strsMI2Variant1Table[] = {
-	SKIP_C(93),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
-	{ MacGuiImpl::kMSIRoughCommandMsg,            "C",      1 },
-	SKIP_C(1),
-	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
-	SKIP_C(1),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
-	SKIP_C(1),
-	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
-	SKIP_P(1),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
-	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
-	SKIP_C(6),
-	SKIP_P(2),
-	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString35,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString36,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString37,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString38,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString39,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString40,              "Pascal", 1 },
-	// SKIP_C(95)
-};
-
-static MacGuiImpl::MacSTRSParsingEntry strsMI2Variant2Table[] = {
-	SKIP_C(93),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
-	SKIP_C(2),
-	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
-	{ MacGuiImpl::kMSIRoughCommandMsg,            "C",      1 },
-	SKIP_C(1),
-	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
-	SKIP_C(1),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
-	SKIP_C(1),
-	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
-	SKIP_P(1),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
-	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
-	SKIP_C(6),
-	SKIP_P(2),
-	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString35,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString36,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString37,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString38,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString39,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString40,              "Pascal", 1 },
-	// SKIP_C(95)
-};
-
-static MacGuiImpl::MacSTRSParsingEntry strsIndy4CDVariant1Table[] = {
-	SKIP_C(144),
-	SKIP_P(1),
-	SKIP_C(2),
-	SKIP_P(10),
-	SKIP_C(51),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
-	SKIP_P(2),
-	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
-	{ MacGuiImpl::kMSIRoughCommandMsg,            "C",      1 },
-	SKIP_C(1),
-	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
-	SKIP_C(1),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
-	SKIP_C(1),
-	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
-	SKIP_P(1),
-	SKIP_P(1),
-	SKIP_P(1),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
-	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
-	SKIP_C(6),
-	SKIP_P(2),
-	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString35,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString36,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString37,              "Pascal", 1 },
-};
-
-static MacGuiImpl::MacSTRSParsingEntry strsIndy4FloppyVariant1Table[] = {
-	SKIP_C(93),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
-	{ MacGuiImpl::kMSIRoughCommandMsg,            "C",      1 },
-	SKIP_C(1),
-	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
-	SKIP_C(1),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
-	SKIP_C(1),
-	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
-	SKIP_P(1),
-	SKIP_P(1),
-	SKIP_P(1),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
-	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
-	SKIP_C(6),
-	SKIP_P(2),
-	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString38,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString35,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString36,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString37,              "Pascal", 1 },
-};
-
-static MacGuiImpl::MacSTRSParsingEntry strsIndy4FloppyVariant2Table[] = {
-	SKIP_C(93),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
-	SKIP_P(2),
-	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
-	{ MacGuiImpl::kMSIRoughCommandMsg,            "C",      1 },
-	SKIP_C(1),
-	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
-	SKIP_C(1),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
-	SKIP_C(1),
-	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
-	SKIP_P(1),
-	SKIP_P(1),
-	SKIP_P(1),
-	SKIP_P(1),
-	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
-	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
-	SKIP_C(6),
-	SKIP_P(2),
-	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString38,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString35,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString36,              "Pascal", 1 },
-	{ MacGuiImpl::kMSIAboutString37,              "Pascal", 1 },
-};
-
-#undef SKIP_C
-#undef SKIP_P
-
-void MacGuiImpl::readStrings() {
-	Common::MacResManager resource;
-	resource.open(_resourceFile);
-	uint32 strsLen = resource.getResLength(MKTAG('S', 'T', 'R', 'S'), 0);
-
-	if (strsLen <= 0)
-		return;
-
-	Common::SeekableReadStream *strsStream = resource.getResource(MKTAG('S', 'T', 'R', 'S'), 0);
-	uint8 *strsBlock = (uint8 *)malloc(strsLen);
-	strsStream->read(strsBlock, strsLen);
-
-	uint8 *strsData = strsBlock;
-	MacSTRSParsingEntry *parsingTable = nullptr;
-	int parsingTableSize = 0;
-
-	if (_vm->_game.id == GID_INDY3) {
-		switch (strsLen) {
-		case 2950:
-			// 1.7 8/17/90
-			parsingTable = strsIndy3Table;
-			parsingTableSize = ARRAYSIZE(strsIndy3Table);
-			break;
-		}
-	} else if (_vm->_game.id == GID_LOOM) {
-		switch (strsLen) {
-		case 3184:
-			// 1.2 25-JAN-91
-			parsingTable = strsLoomTable;
-			parsingTableSize = ARRAYSIZE(strsLoomTable);
-			break;
-		}
-	} else if (_vm->_game.id == GID_MONKEY) {
-		switch (strsLen) {
-		case 5986:
-			// version 2.4
-			parsingTable = strsMI1Table;
-			parsingTableSize = ARRAYSIZE(strsMI1Table);
-			break;
-		}
-	} else if (_vm->_game.id == GID_MONKEY2) {
-		switch (strsLen) {
-		case 6574:
-			parsingTable = strsMI2Variant1Table;
-			parsingTableSize = ARRAYSIZE(strsMI2Variant1Table);
-			break;
-		case 6602:
-			// v1.0 11/5/92 from the LucasArts Mac CD Game Pack II
-			parsingTable = strsMI2Variant2Table;
-			parsingTableSize = ARRAYSIZE(strsMI2Variant2Table);
-			break;
-		}
-	} else if (_vm->_game.id == GID_INDY4) {
-		switch (strsLen) {
-		case 6516:
-			parsingTable = strsIndy4FloppyVariant1Table;
-			parsingTableSize = ARRAYSIZE(strsIndy4FloppyVariant1Table);
-			break;
-		case 6612:
-			// V1.0 10-9-92 from the LucasArts Mac CD Game Pack II
-			parsingTable = strsIndy4FloppyVariant2Table;
-			parsingTableSize = ARRAYSIZE(strsIndy4FloppyVariant2Table);
-			break;
-		case 6836: // CD
-			// V1.0 10-9-92
-			parsingTable = strsIndy4CDVariant1Table;
-			parsingTableSize = ARRAYSIZE(strsIndy4CDVariant1Table);
-			break;
-		}
-	} else {
-		error("MacGuiImpl::readStrings(): String parsing table not defined for this game");
-	}
-
-	if (parsingTable)
-		parseSTRSBlock(strsData, parsingTable, parsingTableSize);
-	else
-		warning("MacGuiImpl::readStrings(): String parsing table not defined for this variant of the game; STRS resource %d bytes", strsLen);
-
-	free(strsBlock);
-	delete strsStream;
-}
-
-void MacGuiImpl::parseSTRSBlock(uint8 *strsData, MacSTRSParsingEntry *parsingTable, int parsingTableSize) {
-	_strsStrings.clear();
-	_strsStrings.reserve(128);
-	for (int i = 0; i < 128; i++) {
-		_strsStrings.emplace_back("");
-	} 
-
-	for (int i = 0; i < parsingTableSize; i++) {
-		MacSTRSParsingEntry entry = parsingTable[i];
-
-		if (entry.strId == kMSISkip) {
-			for (int j = 0; j < entry.numStrings; j++) {
-				entry.parsingMethod == "C" ? readCString(strsData) : readPascalString(strsData);
-			}
-		} else {
-			for (int j = 0; j < entry.numStrings; j++) {
-				if (entry.parsingMethod == "C") {
-					_strsStrings[entry.strId] = readCString(strsData);
-				} else if (entry.parsingMethod == "Pascal") {
-					_strsStrings[entry.strId] = readPascalString(strsData);
-				} else {
-					error("MacGuiImpl::parseSTRSBlock(): invalid parsing method encountered (%s)", entry.parsingMethod.c_str());
-				}
-			}
-		}
-	}
-}
-
 } // End of namespace Scumm
diff --git a/engines/scumm/macgui/macgui_impl.h b/engines/scumm/macgui/macgui_impl.h
index f660ff982e3..0565f800418 100644
--- a/engines/scumm/macgui/macgui_impl.h
+++ b/engines/scumm/macgui/macgui_impl.h
@@ -30,7 +30,10 @@
 #include "common/str.h"
 #include "common/str-array.h"
 
+#include "engines/engine.h"
+
 #include "graphics/font.h"
+#include "graphics/surface.h"
 
 class OSystem;
 
diff --git a/engines/scumm/macgui/macgui_strings.cpp b/engines/scumm/macgui/macgui_strings.cpp
new file mode 100644
index 00000000000..67de65f441a
--- /dev/null
+++ b/engines/scumm/macgui/macgui_strings.cpp
@@ -0,0 +1,654 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/macresman.h"
+
+#include "scumm/macgui/macgui_impl.h"
+#include "scumm/scumm.h"
+
+namespace Scumm {
+
+Common::String MacGuiImpl::readCString(uint8 *&data) {
+	Common::String result(reinterpret_cast<const char *>(data));
+	data += result.size() + 1;
+
+	while (data[0] == '\0') {
+		data++;
+	}
+
+	debug(8, "MacGuiImpl::readCString(): %s", result.c_str());
+	return result;
+}
+
+Common::String MacGuiImpl::readPascalString(uint8 *&data) {
+	Common::String result(reinterpret_cast<const char *>(&data[1]), (uint32)data[0]);
+	data += (uint32)data[0] + 1;
+
+	while (data[0] == '\0') {
+		data++;
+	}
+
+	debug(8, "MacGuiImpl::readPascalString(): %s", result.c_str());
+	return result;
+}
+
+#define SKIP_C(x) { MacGuiImpl::kMSISkip, "C",      x }
+#define SKIP_P(x) { MacGuiImpl::kMSISkip, "Pascal", x }
+
+static MacGuiImpl::MacSTRSParsingEntry strsIndy3Table[] = {
+	SKIP_C(6),
+	SKIP_P(2),
+	SKIP_C(2),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
+	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
+	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
+	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
+	SKIP_P(2),
+	SKIP_C(2),
+	SKIP_P(1),
+	SKIP_C(67),
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString3,               "C",      1 },
+	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
+	// SKIP_C(1),
+	// SKIP_P(4),
+	// SKIP_C(3),
+	// SKIP_P(2),
+	// SKIP_C(4),
+	// SKIP_P(1),
+	// SKIP_C(1),
+	// SKIP_P(5),
+};
+
+static MacGuiImpl::MacSTRSParsingEntry strsLoomTable[] = {
+	SKIP_C(6),
+	SKIP_P(2),
+	SKIP_C(2),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
+	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
+	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
+	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
+	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
+	SKIP_C(2),
+	SKIP_P(1),
+	SKIP_C(67),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString2,               "C",      1 },
+	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
+	// SKIP_C(1),
+	// SKIP_P(4),
+	// SKIP_C(3),
+	// SKIP_P(2),
+	// SKIP_C(4),
+	// SKIP_P(1),
+	// SKIP_C(1),
+	// SKIP_P(5),
+	// SKIP_C(7),
+};
+
+static MacGuiImpl::MacSTRSParsingEntry strsMI1Table[] = {
+	SKIP_C(93),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
+	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
+	SKIP_C(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
+	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
+	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
+	SKIP_C(6),
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
+	// SKIP_C(75)
+};
+
+static MacGuiImpl::MacSTRSParsingEntry strsMI2Variant1Table[] = {
+	SKIP_C(93),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
+	{ MacGuiImpl::kMSIRoughCommandMsg,            "C",      1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
+	SKIP_C(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
+	SKIP_P(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
+	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
+	SKIP_C(6),
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString35,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString36,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString37,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString38,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString39,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString40,              "Pascal", 1 },
+	// SKIP_C(95)
+};
+
+static MacGuiImpl::MacSTRSParsingEntry strsMI2Variant2Table[] = {
+	SKIP_C(93),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
+	SKIP_C(2),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
+	{ MacGuiImpl::kMSIRoughCommandMsg,            "C",      1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
+	SKIP_C(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
+	SKIP_P(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
+	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
+	SKIP_C(6),
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString35,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString36,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString37,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString38,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString39,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString40,              "Pascal", 1 },
+	// SKIP_C(95)
+};
+
+static MacGuiImpl::MacSTRSParsingEntry strsIndy4CDVariant1Table[] = {
+	SKIP_C(144),
+	SKIP_P(1),
+	SKIP_C(2),
+	SKIP_P(10),
+	SKIP_C(51),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
+	{ MacGuiImpl::kMSIRoughCommandMsg,            "C",      1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
+	SKIP_C(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
+	SKIP_P(1),
+	SKIP_P(1),
+	SKIP_P(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
+	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
+	SKIP_C(6),
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString35,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString36,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString37,              "Pascal", 1 },
+};
+
+static MacGuiImpl::MacSTRSParsingEntry strsIndy4FloppyVariant1Table[] = {
+	SKIP_C(93),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
+	{ MacGuiImpl::kMSIRoughCommandMsg,            "C",      1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
+	SKIP_C(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
+	SKIP_P(1),
+	SKIP_P(1),
+	SKIP_P(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
+	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
+	SKIP_C(6),
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString38,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString35,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString36,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString37,              "Pascal", 1 },
+};
+
+static MacGuiImpl::MacSTRSParsingEntry strsIndy4FloppyVariant2Table[] = {
+	SKIP_C(93),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIAboutGameName,              "Pascal", 1 },
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToQuit,    "C",      1 },
+	{ MacGuiImpl::kMSIRoughCommandMsg,            "C",      1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, "C",      1 },
+	SKIP_C(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSIGameName,                   "Pascal", 1 },
+	SKIP_C(1),
+	{ MacGuiImpl::kMSIOpenGameFile,               "Pascal", 1 },
+	SKIP_P(1),
+	SKIP_P(1),
+	SKIP_P(1),
+	SKIP_P(1),
+	{ MacGuiImpl::kMSISaveGameFileAs,             "Pascal", 1 },
+	{ MacGuiImpl::kMSIGameFile,                   "Pascal", 1 },
+	SKIP_C(6),
+	SKIP_P(2),
+	{ MacGuiImpl::kMSIAboutString1,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString2,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString3,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString4,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString5,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString6,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString7,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString8,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString9,               "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString10,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString11,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString12,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString13,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString14,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString15,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString16,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString17,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString18,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString19,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString20,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString21,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString22,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString23,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString38,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString24,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString25,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString26,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString27,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString28,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString29,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString30,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString31,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString32,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString33,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString34,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString35,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString36,              "Pascal", 1 },
+	{ MacGuiImpl::kMSIAboutString37,              "Pascal", 1 },
+};
+
+#undef SKIP_C
+#undef SKIP_P
+
+void MacGuiImpl::readStrings() {
+	Common::MacResManager resource;
+	resource.open(_resourceFile);
+	uint32 strsLen = resource.getResLength(MKTAG('S', 'T', 'R', 'S'), 0);
+
+	if (strsLen <= 0)
+		return;
+
+	Common::SeekableReadStream *strsStream = resource.getResource(MKTAG('S', 'T', 'R', 'S'), 0);
+	uint8 *strsBlock = (uint8 *)malloc(strsLen);
+	strsStream->read(strsBlock, strsLen);
+
+	uint8 *strsData = strsBlock;
+	MacSTRSParsingEntry *parsingTable = nullptr;
+	int parsingTableSize = 0;
+
+	if (_vm->_game.id == GID_INDY3) {
+		switch (strsLen) {
+		case 2950:
+			// 1.7 8/17/90
+			parsingTable = strsIndy3Table;
+			parsingTableSize = ARRAYSIZE(strsIndy3Table);
+			break;
+		}
+	} else if (_vm->_game.id == GID_LOOM) {
+		switch (strsLen) {
+		case 3184:
+			// 1.2 25-JAN-91
+			parsingTable = strsLoomTable;
+			parsingTableSize = ARRAYSIZE(strsLoomTable);
+			break;
+		}
+	} else if (_vm->_game.id == GID_MONKEY) {
+		switch (strsLen) {
+		case 5986:
+			// version 2.4
+			parsingTable = strsMI1Table;
+			parsingTableSize = ARRAYSIZE(strsMI1Table);
+			break;
+		}
+	} else if (_vm->_game.id == GID_MONKEY2) {
+		switch (strsLen) {
+		case 6574:
+			parsingTable = strsMI2Variant1Table;
+			parsingTableSize = ARRAYSIZE(strsMI2Variant1Table);
+			break;
+		case 6602:
+			// v1.0 11/5/92 from the LucasArts Mac CD Game Pack II
+			parsingTable = strsMI2Variant2Table;
+			parsingTableSize = ARRAYSIZE(strsMI2Variant2Table);
+			break;
+		}
+	} else if (_vm->_game.id == GID_INDY4) {
+		switch (strsLen) {
+		case 6516:
+			parsingTable = strsIndy4FloppyVariant1Table;
+			parsingTableSize = ARRAYSIZE(strsIndy4FloppyVariant1Table);
+			break;
+		case 6612:
+			// V1.0 10-9-92 from the LucasArts Mac CD Game Pack II
+			parsingTable = strsIndy4FloppyVariant2Table;
+			parsingTableSize = ARRAYSIZE(strsIndy4FloppyVariant2Table);
+			break;
+		case 6836: // CD
+			// V1.0 10-9-92
+			parsingTable = strsIndy4CDVariant1Table;
+			parsingTableSize = ARRAYSIZE(strsIndy4CDVariant1Table);
+			break;
+		}
+	} else {
+		error("MacGuiImpl::readStrings(): String parsing table not defined for this game");
+	}
+
+	if (parsingTable)
+		parseSTRSBlock(strsData, parsingTable, parsingTableSize);
+	else
+		warning("MacGuiImpl::readStrings(): String parsing table not defined for this variant of the game; STRS resource %d bytes", strsLen);
+
+	free(strsBlock);
+	delete strsStream;
+}
+
+void MacGuiImpl::parseSTRSBlock(uint8 *strsData, MacSTRSParsingEntry *parsingTable, int parsingTableSize) {
+	_strsStrings.clear();
+	_strsStrings.reserve(128);
+	for (int i = 0; i < 128; i++) {
+		_strsStrings.emplace_back("");
+	} 
+
+	for (int i = 0; i < parsingTableSize; i++) {
+		MacSTRSParsingEntry entry = parsingTable[i];
+
+		if (entry.strId == kMSISkip) {
+			for (int j = 0; j < entry.numStrings; j++) {
+				entry.parsingMethod == "C" ? readCString(strsData) : readPascalString(strsData);
+			}
+		} else {
+			for (int j = 0; j < entry.numStrings; j++) {
+				if (entry.parsingMethod == "C") {
+					_strsStrings[entry.strId] = readCString(strsData);
+				} else if (entry.parsingMethod == "Pascal") {
+					_strsStrings[entry.strId] = readPascalString(strsData);
+				} else {
+					error("MacGuiImpl::parseSTRSBlock(): invalid parsing method encountered (%s)", entry.parsingMethod.c_str());
+				}
+			}
+		}
+	}
+}
+
+} // End of namespace Scumm
diff --git a/engines/scumm/module.mk b/engines/scumm/module.mk
index 3d3682c6820..7551ffe08ea 100644
--- a/engines/scumm/module.mk
+++ b/engines/scumm/module.mk
@@ -44,6 +44,7 @@ MODULE_OBJS := \
 	macgui/macgui_impl.o \
 	macgui/macgui_indy3.o \
 	macgui/macgui_loom.o \
+	macgui/macgui_strings.o \
 	macgui/macgui_mi1.o \
 	macgui/macgui_widgets.o \
 	metaengine.o \


Commit: 1310dd09dffe38c4ae5d28d4ad06dd0ab1c08d9f
    https://github.com/scummvm/scummvm/commit/1310dd09dffe38c4ae5d28d4ad06dd0ab1c08d9f
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Rename MacMI1Gui to MacV5Gui and macgui_mi1.* to macgui_v5.*

Changed paths:
  A engines/scumm/macgui/macgui_v5.cpp
  A engines/scumm/macgui/macgui_v5.h
  R engines/scumm/macgui/macgui_mi1.cpp
  R engines/scumm/macgui/macgui_mi1.h
    engines/scumm/macgui/macgui.cpp
    engines/scumm/module.mk
    engines/scumm/scumm.h


diff --git a/engines/scumm/macgui/macgui.cpp b/engines/scumm/macgui/macgui.cpp
index 9fc9863c23d..6ca269c9731 100644
--- a/engines/scumm/macgui/macgui.cpp
+++ b/engines/scumm/macgui/macgui.cpp
@@ -26,7 +26,7 @@
 #include "scumm/macgui/macgui_impl.h"
 #include "scumm/macgui/macgui_indy3.h"
 #include "scumm/macgui/macgui_loom.h"
-#include "scumm/macgui/macgui_mi1.h"
+#include "scumm/macgui/macgui_v5.h"
 
 namespace Scumm {
 
@@ -43,7 +43,7 @@ MacGui::MacGui(ScummEngine *vm, const Common::Path &resourceFile) {
 	case GID_MONKEY:
 	case GID_MONKEY2:
 	case GID_INDY4:
-		_impl = new MacMI1Gui(vm, resourceFile);
+		_impl = new MacV5Gui(vm, resourceFile);
 		break;
 
 	default:
diff --git a/engines/scumm/macgui/macgui_mi1.cpp b/engines/scumm/macgui/macgui_v5.cpp
similarity index 96%
rename from engines/scumm/macgui/macgui_mi1.cpp
rename to engines/scumm/macgui/macgui_v5.cpp
index d19e00a9fdc..2e5bbfdd6ab 100644
--- a/engines/scumm/macgui/macgui_mi1.cpp
+++ b/engines/scumm/macgui/macgui_v5.cpp
@@ -33,7 +33,7 @@
 #include "scumm/scumm.h"
 #include "scumm/detection.h"
 #include "scumm/macgui/macgui_impl.h"
-#include "scumm/macgui/macgui_mi1.h"
+#include "scumm/macgui/macgui_v5.h"
 #include "scumm/music.h"
 #include "scumm/sound.h"
 #include "scumm/verbs.h"
@@ -44,21 +44,21 @@ namespace Scumm {
 // The Mac Monkey Island 1 GUI.
 // ===========================================================================
 
-MacMI1Gui::MacMI1Gui(ScummEngine *vm, const Common::Path &resourceFile) : MacGuiImpl(vm, resourceFile) {
+MacV5Gui::MacV5Gui(ScummEngine *vm, const Common::Path &resourceFile) : MacGuiImpl(vm, resourceFile) {
 	readStrings();
 }
 
-const Graphics::Font *MacMI1Gui::getFontByScummId(int32 id) {
+const Graphics::Font *MacV5Gui::getFontByScummId(int32 id) {
 	switch (id) {
 	case 0:
 		return getFont(kLoomFontLarge);
 
 	default:
-		error("MacMI1Gui::getFontByScummId: Invalid font id %d", id);
+		error("MacV5Gui::getFontByScummId: Invalid font id %d", id);
 	}
 }
 
-bool MacMI1Gui::getFontParams(FontId fontId, int &id, int &size, int &slant) const {
+bool MacV5Gui::getFontParams(FontId fontId, int &id, int &size, int &slant) const {
 	switch (fontId) {
 	case kAboutFontRegular:
 		id = Graphics::kMacFontGeneva;
@@ -100,7 +100,7 @@ bool MacMI1Gui::getFontParams(FontId fontId, int &id, int &size, int &slant) con
 	}
 }
 
-void MacMI1Gui::setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) {
+void MacV5Gui::setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) {
 	if (_vm->_game.id == GID_MONKEY) {
 		_windowManager->replaceCursor(Graphics::MacGUIConstants::kMacCursorArrow);
 	} else if (_vm->_game.version == 5) {
@@ -126,7 +126,7 @@ void MacMI1Gui::setupCursor(int &width, int &height, int &hotspotX, int &hotspot
 	}
 }
 
-bool MacMI1Gui::handleMenu(int id, Common::String &name) {
+bool MacV5Gui::handleMenu(int id, Common::String &name) {
 	if (MacGuiImpl::handleMenu(id, name))
 		return true;
 
@@ -151,7 +151,7 @@ bool MacMI1Gui::handleMenu(int id, Common::String &name) {
 	return false;
 }
 
-void MacMI1Gui::runAboutDialog() {
+void MacV5Gui::runAboutDialog() {
 	int width = 416;
 	int height = 166;
 	int x = (640 - width) / 2;
@@ -177,7 +177,7 @@ void MacMI1Gui::runAboutDialog() {
 	delete window;
 }
 
-void MacMI1Gui::runAboutDialogMI1(MacDialogWindow *window) {
+void MacV5Gui::runAboutDialogMI1(MacDialogWindow *window) {
 	Graphics::Surface *lucasArts = loadPict(5000);
 	Graphics::Surface *monkeys = loadPict(5001);
 
@@ -406,7 +406,7 @@ void MacMI1Gui::runAboutDialogMI1(MacDialogWindow *window) {
 	delete monkeys;
 }
 
-void MacMI1Gui::drawShadow(Graphics::Surface *s, int x, int y, int h, Common::Pair<int, int> *drawData) {
+void MacV5Gui::drawShadow(Graphics::Surface *s, int x, int y, int h, Common::Pair<int, int> *drawData) {
 	int y1 = y;
 	int y2 = y + h - 1;
 
@@ -430,7 +430,7 @@ void MacMI1Gui::drawShadow(Graphics::Surface *s, int x, int y, int h, Common::Pa
 	}
 }
 
-void MacMI1Gui::runAboutDialogMI2(MacDialogWindow *window) {
+void MacV5Gui::runAboutDialogMI2(MacDialogWindow *window) {
 	Graphics::Surface *s = window->innerSurface();
 
 	Graphics::Surface *lucasArts = loadPict(5000);
@@ -582,7 +582,7 @@ void MacMI1Gui::runAboutDialogMI2(MacDialogWindow *window) {
 	delete lucasArts;
 }
 
-void MacMI1Gui::runAboutDialogIndy4(MacDialogWindow *window) {
+void MacV5Gui::runAboutDialogIndy4(MacDialogWindow *window) {
 	bool isFloppyVersion = _vm->_game.variant && !strcmp(_vm->_game.variant, "Floppy");
 
 	Graphics::Surface *s = window->innerSurface();
@@ -770,7 +770,7 @@ void MacMI1Gui::runAboutDialogIndy4(MacDialogWindow *window) {
 // A standard file picker dialog doesn't really make sense in ScummVM, so we
 // make something that just looks similar to one.
 
-bool MacMI1Gui::runOpenDialog(int &saveSlotToHandle) {
+bool MacV5Gui::runOpenDialog(int &saveSlotToHandle) {
 	Common::Rect bounds(88, 28, 448, 210);
 
 	MacDialogWindow *window = createWindow(bounds);
@@ -817,7 +817,7 @@ bool MacMI1Gui::runOpenDialog(int &saveSlotToHandle) {
 	return ret;
 }
 
-bool MacMI1Gui::runSaveDialog(int &saveSlotToHandle, Common::String &name) {
+bool MacV5Gui::runSaveDialog(int &saveSlotToHandle, Common::String &name) {
 	uint32 black = getBlack();
 
 	Common::Rect bounds(110, 27, 470, 231);
@@ -900,7 +900,7 @@ bool MacMI1Gui::runSaveDialog(int &saveSlotToHandle, Common::String &name) {
 	return ret;
 }
 
-bool MacMI1Gui::runOptionsDialog() {
+bool MacV5Gui::runOptionsDialog() {
 	// Widgets:
 	//
 	// 0 - Okay button
@@ -986,12 +986,12 @@ bool MacMI1Gui::runOptionsDialog() {
 	return ret;
 }
 
-void MacMI1Gui::resetAfterLoad() {
+void MacV5Gui::resetAfterLoad() {
 	reset();
 	_windowManager->replaceCursor(Graphics::MacGUIConstants::kMacCursorArrow);
 }
 
-bool MacMI1Gui::handleEvent(Common::Event event) {
+bool MacV5Gui::handleEvent(Common::Event event) {
 	if (MacGuiImpl::handleEvent(event))
 		return true;
 
diff --git a/engines/scumm/macgui/macgui_mi1.h b/engines/scumm/macgui/macgui_v5.h
similarity index 91%
rename from engines/scumm/macgui/macgui_mi1.h
rename to engines/scumm/macgui/macgui_v5.h
index 51d1f6af8ef..f8085f4c018 100644
--- a/engines/scumm/macgui/macgui_mi1.h
+++ b/engines/scumm/macgui/macgui_v5.h
@@ -19,8 +19,8 @@
  *
  */
 
-#ifndef SCUMM_MACGUI_MACGUI_MI1_H
-#define SCUMM_MACGUI_MACGUI_MI1_H
+#ifndef SCUMM_MACGUI_MACGUI_V5_H
+#define SCUMM_MACGUI_MACGUI_V5_H
 
 #include "common/events.h"
 #include "common/rect.h"
@@ -30,10 +30,10 @@ namespace Scumm {
 
 class MacGuiImpl;
 
-class MacMI1Gui : public MacGuiImpl {
+class MacV5Gui : public MacGuiImpl {
 public:
-	MacMI1Gui(ScummEngine *vm, const Common::Path &resourceFile);
-	~MacMI1Gui() {}
+	MacV5Gui(ScummEngine *vm, const Common::Path &resourceFile);
+	~MacV5Gui() {}
 
 	const Common::String name() const { return "game"; }
 	int getNumColors() const override { return 256; }
diff --git a/engines/scumm/module.mk b/engines/scumm/module.mk
index 7551ffe08ea..8b862ea1be2 100644
--- a/engines/scumm/module.mk
+++ b/engines/scumm/module.mk
@@ -45,7 +45,7 @@ MODULE_OBJS := \
 	macgui/macgui_indy3.o \
 	macgui/macgui_loom.o \
 	macgui/macgui_strings.o \
-	macgui/macgui_mi1.o \
+	macgui/macgui_v5.o \
 	macgui/macgui_widgets.o \
 	metaengine.o \
 	midiparser_ro.o \
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index d83361cd0a5..ff14eeb0589 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -524,7 +524,7 @@ class ScummEngine : public Engine, public Common::Serializable {
 	friend class MacGuiImpl;
 	friend class MacIndy3Gui;
 	friend class MacLoomGui;
-	friend class MacMI1Gui;
+	friend class MacV5Gui;
 	friend class LogicHEBasketball;
 
 public:


Commit: 4c5410cff1935fa249e38dd12683991b64b64a96
    https://github.com/scummvm/scummvm/commit/4c5410cff1935fa249e38dd12683991b64b64a96
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Update macgui_v5 comment

Changed paths:
    engines/scumm/macgui/macgui_v5.cpp


diff --git a/engines/scumm/macgui/macgui_v5.cpp b/engines/scumm/macgui/macgui_v5.cpp
index 2e5bbfdd6ab..d057b6ed933 100644
--- a/engines/scumm/macgui/macgui_v5.cpp
+++ b/engines/scumm/macgui/macgui_v5.cpp
@@ -41,7 +41,7 @@
 namespace Scumm {
 
 // ===========================================================================
-// The Mac Monkey Island 1 GUI.
+// The Mac SCUMM v5 GUI.
 // ===========================================================================
 
 MacV5Gui::MacV5Gui(ScummEngine *vm, const Common::Path &resourceFile) : MacGuiImpl(vm, resourceFile) {


Commit: d91e4c354fcb777ec1e7d0faf9c864dd6475f9ea
    https://github.com/scummvm/scummvm/commit/d91e4c354fcb777ec1e7d0faf9c864dd6475f9ea
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Clean up the "extra bold" About style

There is nothing "extra" about it. It's just a bold version of a font
that looks bold to begin with. I probably experimented with Geneva bold
before arriving at this, but now the special drawing for it is no longer
needed.

Changed paths:
    engines/scumm/macgui/macgui_dialogwindow.cpp
    engines/scumm/macgui/macgui_impl.cpp


diff --git a/engines/scumm/macgui/macgui_dialogwindow.cpp b/engines/scumm/macgui/macgui_dialogwindow.cpp
index e2a77833f20..ec353a980ed 100644
--- a/engines/scumm/macgui/macgui_dialogwindow.cpp
+++ b/engines/scumm/macgui/macgui_dialogwindow.cpp
@@ -751,9 +751,6 @@ void MacGuiImpl::MacDialogWindow::drawTexts(Common::Rect r, const TextLine *line
 			f2->drawString(s, msg, x, y, width, bg, align);
 		} else {
 			f1->drawString(s, msg, x, y, width, fg, align);
-
-			if (lines[i].style == kStyleExtraBold)
-				f1->drawString(s, msg, x + 1, y, width, fg, align);
 		}
 	}
 }
diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index e9e020c7a29..d34505a7c02 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -544,22 +544,22 @@ bool MacGuiImpl::getFontParams(FontId fontId, int &id, int &size, int &slant) co
 		slant = Graphics::kMacFontItalic | Graphics::kMacFontBold | Graphics::kMacFontExtend;
 		return true;
 
-	case kAboutFontBold:
-		id = _gameFontId;
+	case kAboutFontRegular:
+		id = Graphics::kMacFontGeneva;
 		size = 9;
 		slant = Graphics::kMacFontRegular;
 		return true;
 
-	case kAboutFontExtraBold:
+	case kAboutFontBold:
 		id = _gameFontId;
 		size = 9;
-		slant = Graphics::kMacFontRegular | Graphics::kMacFontExtend;
+		slant = Graphics::kMacFontRegular;
 		return true;
 
-	case kAboutFontRegular:
-		id = Graphics::kMacFontGeneva;
+	case kAboutFontExtraBold:
+		id = _gameFontId;
 		size = 9;
-		slant = Graphics::kMacFontRegular;
+		slant = Graphics::kMacFontBold;
 		return true;
 
 	default:


Commit: 823942358c792232e4c65ac11369af97c1db7755
    https://github.com/scummvm/scummvm/commit/823942358c792232e4c65ac11369af97c1db7755
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Improve the rendering of "Monkey Island 2"

I think this is the correct rendering: Italics + Bold + Outline drawn
twice, once pixel apart. But ScummVM spaces the letters too closely
together. It could perhaps be fixed by adding Extended, but when I
mocked it up in a Mac emulator I didn't have to use that.

Changed paths:
    engines/scumm/macgui/macgui_dialogwindow.cpp
    engines/scumm/macgui/macgui_impl.h
    engines/scumm/macgui/macgui_indy3.cpp
    engines/scumm/macgui/macgui_loom.cpp
    engines/scumm/macgui/macgui_v5.cpp


diff --git a/engines/scumm/macgui/macgui_dialogwindow.cpp b/engines/scumm/macgui/macgui_dialogwindow.cpp
index ec353a980ed..a4f31427f2c 100644
--- a/engines/scumm/macgui/macgui_dialogwindow.cpp
+++ b/engines/scumm/macgui/macgui_dialogwindow.cpp
@@ -714,28 +714,41 @@ void MacGuiImpl::MacDialogWindow::drawTexts(Common::Rect r, const TextLine *line
 		const Graphics::Font *f2 = nullptr;
 
 		switch (lines[i].style) {
-		case kStyleHeader:
+		case kStyleHeader1:
 			f1 = _gui->getFont(kAboutFontHeaderOutside);
 			f2 = _gui->getFont(kAboutFontHeaderInside);
 			break;
+
+		case kStyleHeader2:
+			f1 = _gui->getFont(kAboutFontHeader);
+			break;
+
 		case kStyleHeaderSimple1:
 			f1 = _gui->getFont(kAboutFontHeaderSimple1);
 			break;
+
 		case kStyleHeaderSimple2:
 			f1 = _gui->getFont(kAboutFontHeaderSimple2);
 			break;
+
 		case kStyleBold:
 			f1 = _gui->getFont(kAboutFontBold);
 			break;
+
 		case kStyleBold2:
 			f1 = _gui->getFont(kAboutFontBold2);
 			break;
+
 		case kStyleExtraBold:
 			f1 = _gui->getFont(kAboutFontExtraBold);
 			break;
+
 		case kStyleRegular:
 			f1 = _gui->getFont(kAboutFontRegular);
 			break;
+
+		default:
+			return;
 		}
 
 		const char *msg = lines[i].str;
@@ -744,13 +757,22 @@ void MacGuiImpl::MacDialogWindow::drawTexts(Common::Rect r, const TextLine *line
 		Graphics::TextAlign align = lines[i].align;
 		int width = r.right - x;
 
-		if (lines[i].style == kStyleHeader) {
+		switch (lines[i].style) {
+		case kStyleHeader1:
 			f1->drawString(s, msg, x - 1, y + 1, width, fg, align);
 			f2->drawString(s, msg, x + 1, y + 1, width, fg, align);
 			f1->drawString(s, msg, x - 2, y, width, fg, align);
 			f2->drawString(s, msg, x, y, width, bg, align);
-		} else {
+			break;
+
+		case kStyleHeader2:
 			f1->drawString(s, msg, x, y, width, fg, align);
+			f1->drawString(s, msg, x + 1, y, width, fg, align);
+			break;
+
+		default:
+			f1->drawString(s, msg, x, y, width, fg, align);
+			break;
 		}
 	}
 }
diff --git a/engines/scumm/macgui/macgui_impl.h b/engines/scumm/macgui/macgui_impl.h
index 0565f800418..5019fc54326 100644
--- a/engines/scumm/macgui/macgui_impl.h
+++ b/engines/scumm/macgui/macgui_impl.h
@@ -143,6 +143,7 @@ protected:
 		kAboutFontExtraBold,
 		kAboutFontHeaderInside,
 		kAboutFontHeaderOutside,
+		kAboutFontHeader,
 		kAboutFontHeaderSimple1,
 		kAboutFontHeaderSimple2,
 
@@ -158,7 +159,8 @@ protected:
 	};
 
 	enum TextStyle {
-		kStyleHeader,
+		kStyleHeader1,
+		kStyleHeader2,
 		kStyleHeaderSimple1,
 		kStyleHeaderSimple2,
 		kStyleBold,
diff --git a/engines/scumm/macgui/macgui_indy3.cpp b/engines/scumm/macgui/macgui_indy3.cpp
index 316716c1560..990beb51e5d 100644
--- a/engines/scumm/macgui/macgui_indy3.cpp
+++ b/engines/scumm/macgui/macgui_indy3.cpp
@@ -1162,7 +1162,7 @@ void MacIndy3Gui::runAboutDialog() {
 	Common::String version = Common::String::format(_strsStrings[kMSIAboutString3].c_str(), subVers, '5', '1', '6');
 
 	const TextLine page1[] = {
-		{ 0, 4, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString1].c_str() }, // "Indiana Jones and the Last Crusade"
+		{ 0, 4, kStyleHeader1, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString1].c_str() }, // "Indiana Jones and the Last Crusade"
 		{ 0, 22, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString2].c_str() }, // "The Graphic Adventure"
 		{ 0, 49, kStyleBold, Graphics::kTextAlignCenter, version.c_str() }, // "Mac 1.7 8/17/90, Interpreter version 5.1.6"
 		{ 1, 82, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString4].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company.  All rights reserved."
@@ -1171,34 +1171,34 @@ void MacIndy3Gui::runAboutDialog() {
 
 	const TextLine page2[] = {
 		{ 1, 7, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString5].c_str() }, // "Macintosh version by"
-		{ 70, 21, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString7].c_str() }, // "Eric Johnston"
+		{ 70, 21, kStyleHeader1, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString7].c_str() }, // "Eric Johnston"
 		{ 194, 32, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString6].c_str() }, // "and"
-		{ 216, 41, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString8].c_str() }, // "Dan Filner"
+		{ 216, 41, kStyleHeader1, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString8].c_str() }, // "Dan Filner"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page3[] = {
 		{ 1, 7, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString9].c_str() }, // "Macintosh scripting by"
-		{ 75, 21, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString11].c_str() }, // "Ron Baldwin"
+		{ 75, 21, kStyleHeader1, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString11].c_str() }, // "Ron Baldwin"
 		{ 186, 32, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString10].c_str() }, // "and"
-		{ 214, 41, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString12].c_str() }, // "David Fox"
+		{ 214, 41, kStyleHeader1, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString12].c_str() }, // "David Fox"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page4[] = {
 		{ 1, 7, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString13].c_str() }, // "Designed and scripted by"
-		{ 77, 24, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString14].c_str() }, // "Noah Falstein"
-		{ 134, 44, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString15].c_str() }, // "David Fox"
-		{ 167, 64, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString16].c_str() }, // "Ron Gilbert"
+		{ 77, 24, kStyleHeader1, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString14].c_str() }, // "Noah Falstein"
+		{ 134, 44, kStyleHeader1, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString15].c_str() }, // "David Fox"
+		{ 167, 64, kStyleHeader1, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString16].c_str() }, // "Ron Gilbert"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page5[] = {
 		{ 1, 7, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString17].c_str() }, // "SCUMM Story System"
 		{ 1, 17, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString18].c_str() }, // "created by"
-		{ 107, 36, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString20].c_str() }, // "Ron Gilbert"
+		{ 107, 36, kStyleHeader1, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString20].c_str() }, // "Ron Gilbert"
 		{ 170, 52, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString19].c_str() }, // "and"
-		{ 132, 66, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString21].c_str() }, // "Aric Wilmunder"
+		{ 132, 66, kStyleHeader1, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString21].c_str() }, // "Aric Wilmunder"
 		TEXT_END_MARKER
 	};
 
diff --git a/engines/scumm/macgui/macgui_loom.cpp b/engines/scumm/macgui/macgui_loom.cpp
index 5e33694387c..cee3f0aa876 100644
--- a/engines/scumm/macgui/macgui_loom.cpp
+++ b/engines/scumm/macgui/macgui_loom.cpp
@@ -188,32 +188,32 @@ void MacLoomGui::runAboutDialog() {
 
 	const TextLine page3[] = {
 		{ 1, 11, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString4].c_str() }, // "Macintosh version by"
-		{ 0, 25, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString6].c_str() }, // "Eric Johnston"
+		{ 0, 25, kStyleHeader1, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString6].c_str() }, // "Eric Johnston"
 		{ 0, 49, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString5].c_str() }, // "Macintosh scripting by"
-		{ 1, 63, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString7].c_str() }, // "Ron Baldwin"
+		{ 1, 63, kStyleHeader1, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString7].c_str() }, // "Ron Baldwin"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page4[] = {
 		{ 0, 26, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString8].c_str() }, // "Original game created by"
-		{ 1, 40, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString9].c_str() }, // "Brian Moriarty"
+		{ 1, 40, kStyleHeader1, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString9].c_str() }, // "Brian Moriarty"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page5[] = {
 		{ 1, 11, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString10].c_str() }, // "Produced by"
-		{ 0, 25, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString12].c_str() }, // "Gregory D. Hammond"
+		{ 0, 25, kStyleHeader1, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString12].c_str() }, // "Gregory D. Hammond"
 		{ 0, 49, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString11].c_str() }, // "Macintosh Version Produced by"
-		{ 1, 63, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString13].c_str() }, // "David Fox"
+		{ 1, 63, kStyleHeader1, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString13].c_str() }, // "David Fox"
 		TEXT_END_MARKER
 	};
 
 	const TextLine page6[] = {
 		{ 1, 6, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString14].c_str() }, // "SCUMM Story System"
 		{1, 16, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString15].c_str()}, // "created by"
-		{ 97, 35, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString17].c_str() }, // "Ron Gilbert"
+		{ 97, 35, kStyleHeader1, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString17].c_str() }, // "Ron Gilbert"
 		{ 1, 51, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString16].c_str() }, // "and"
-		{ 122, 65, kStyleHeader, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString18].c_str() }, // "Aric Wilmunder"
+		{ 122, 65, kStyleHeader1, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString18].c_str() }, // "Aric Wilmunder"
 		TEXT_END_MARKER
 	};
 
diff --git a/engines/scumm/macgui/macgui_v5.cpp b/engines/scumm/macgui/macgui_v5.cpp
index d057b6ed933..a2d5ca47d42 100644
--- a/engines/scumm/macgui/macgui_v5.cpp
+++ b/engines/scumm/macgui/macgui_v5.cpp
@@ -65,36 +65,37 @@ bool MacV5Gui::getFontParams(FontId fontId, int &id, int &size, int &slant) cons
 		size = 9;
 		slant = Graphics::kMacFontRegular;
 		return true;
+
 	case kAboutFontBold:
 		id = Graphics::kMacFontGeneva;
 		size = 9;
 		slant = Graphics::kMacFontBold;
 		return true;
+
 	case kAboutFontBold2:
 		id = Graphics::kMacFontTimes;
 		size = 10;
 		slant = Graphics::kMacFontBold;
 		return true;
-	case kAboutFontHeaderOutside:
+
+	case kAboutFontHeader:
 		id = Graphics::kMacFontTimes;
 		size = 18;
 		slant = Graphics::kMacFontBold | Graphics::kMacFontItalic | Graphics::kMacFontOutline;
 		return true;
-	case kAboutFontHeaderInside:
-		id = Graphics::kMacFontTimes;
-		size = 18;
-		slant = Graphics::kMacFontItalic | Graphics::kMacFontBold | Graphics::kMacFontExtend;
-		return true;
+
 	case kAboutFontHeaderSimple1:
 		id = Graphics::kMacFontGeneva;
 		size = 12;
 		slant = Graphics::kMacFontBold | Graphics::kMacFontItalic | Graphics::kMacFontOutline;
 		return true;
+
 	case kAboutFontHeaderSimple2:
 		id = Graphics::kMacFontChicago;
 		size = 12;
 		slant = Graphics::kMacFontBold | Graphics::kMacFontItalic | Graphics::kMacFontOutline;
 		return true;
+
 	default:
 		return MacGuiImpl::getFontParams(fontId, id, size, slant);
 	}
@@ -442,7 +443,7 @@ void MacV5Gui::runAboutDialogMI2(MacDialogWindow *window) {
 
 	const TextLine page5[] = {
 		{ 1, 16, kStyleBold2, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString3].c_str() }, // "LeChuck\xD5s Revenge"
-		{ 1, 31, kStyleHeader, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString4].c_str() }, // "Monkey Island 2"
+		{ 1, 31, kStyleHeader2, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString4].c_str() }, // "Monkey Island 2"
 		{ 176, 125, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString6].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company."
 		{ 310, 138, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString7].c_str() }, // "All rights reserved."
 		TEXT_END_MARKER


Commit: 0dff9ec14e5072b0f186af241b302bc0e226754f
    https://github.com/scummvm/scummvm/commit/0dff9ec14e5072b0f186af241b302bc0e226754f
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Cheat to make "Monkey Island 2" look correct

We should't have to use the Extended style to do this, but for now it
will look correct if we do.

Changed paths:
    engines/scumm/macgui/macgui_v5.cpp


diff --git a/engines/scumm/macgui/macgui_v5.cpp b/engines/scumm/macgui/macgui_v5.cpp
index a2d5ca47d42..9edcbdd3877 100644
--- a/engines/scumm/macgui/macgui_v5.cpp
+++ b/engines/scumm/macgui/macgui_v5.cpp
@@ -81,7 +81,10 @@ bool MacV5Gui::getFontParams(FontId fontId, int &id, int &size, int &slant) cons
 	case kAboutFontHeader:
 		id = Graphics::kMacFontTimes;
 		size = 18;
-		slant = Graphics::kMacFontBold | Graphics::kMacFontItalic | Graphics::kMacFontOutline;
+		// TODO: This is WRONG! We shouldn't use the Extended style
+		// here, but apparently ScummVM doesn't handle character
+		// spacing correctly for Mac fonts.
+		slant = Graphics::kMacFontBold | Graphics::kMacFontItalic | Graphics::kMacFontOutline | Graphics::kMacFontExtend;
 		return true;
 
 	case kAboutFontHeaderSimple1:
@@ -442,8 +445,8 @@ void MacV5Gui::runAboutDialogMI2(MacDialogWindow *window) {
 	};
 
 	const TextLine page5[] = {
-		{ 1, 16, kStyleBold2, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString3].c_str() }, // "LeChuck\xD5s Revenge"
-		{ 1, 31, kStyleHeader2, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString4].c_str() }, // "Monkey Island 2"
+		{ 152, 16, kStyleBold2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString3].c_str() }, // "LeChuck\xD5s Revenge"
+		{ 114, 31, kStyleHeader2, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString4].c_str() }, // "Monkey Island 2"
 		{ 176, 125, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString6].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company."
 		{ 310, 138, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString7].c_str() }, // "All rights reserved."
 		TEXT_END_MARKER


Commit: 24d41f5bb1eeadb31827971dcd99be057f53aadf
    https://github.com/scummvm/scummvm/commit/24d41f5bb1eeadb31827971dcd99be057f53aadf
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Fix memory leaks

Changed paths:
    engines/scumm/macgui/macgui_v5.cpp


diff --git a/engines/scumm/macgui/macgui_v5.cpp b/engines/scumm/macgui/macgui_v5.cpp
index 9edcbdd3877..a3fa4a53d57 100644
--- a/engines/scumm/macgui/macgui_v5.cpp
+++ b/engines/scumm/macgui/macgui_v5.cpp
@@ -406,6 +406,9 @@ void MacV5Gui::runAboutDialogMI1(MacDialogWindow *window) {
 		page++;
 	}
 
+	lucasArts->free();
+	monkeys->free();
+
 	delete lucasArts;
 	delete monkeys;
 }
@@ -583,6 +586,8 @@ void MacV5Gui::runAboutDialogMI2(MacDialogWindow *window) {
 		page++;
 	}
 
+	lucasArts->free();
+
 	delete lucasArts;
 }
 
@@ -767,6 +772,9 @@ void MacV5Gui::runAboutDialogIndy4(MacDialogWindow *window) {
 		page++;
 	}
 
+	lucasArts->free();
+	indianaJones->free();
+
 	delete lucasArts;
 	delete indianaJones;
 }


Commit: da21a245d180001f48ec84f71a8a7a8c522536ef
    https://github.com/scummvm/scummvm/commit/da21a245d180001f48ec84f71a8a7a8c522536ef
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Disable some main menu (and other stuff) for _macGui games

Changed paths:
    engines/scumm/input.cpp


diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index d164316e689..74585bb34d3 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -1175,7 +1175,9 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) {
 			if (isSegaCD) {
 				// We map the GMM to F5, while SPACE (which acts as our pause button) calls the original menu...
 				openMainMenuDialog();
-			} else {
+			} else if (_macGui) {
+				openMainMenuDialog(); // Mac games have their own menu so let's just call the GMM...
+			} else  {
 				showMainMenu();
 			}
 			return;
@@ -1235,7 +1237,7 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) {
 			} else if (_game.version >= 4 && lastKeyHit.keycode == Common::KEYCODE_j && lastKeyHit.hasFlags(Common::KBD_SHIFT)) {
 				if (_game.version == 4) {
 					showOldStyleBannerAndPause(getGUIString(gsRecalJoystick), 2, 90);
-				} else {
+				} else if (!_macGui) {
 					showBannerAndPause(0, 90, getGUIString(gsRecalJoystick));
 				}
 				return;
@@ -1249,7 +1251,7 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) {
 			if (_game.version >= 4 && lastKeyHit.keycode == Common::KEYCODE_m && lastKeyHit.hasFlags(Common::KBD_SHIFT)) {
 				if (_game.version == 4) {
 					showOldStyleBannerAndPause(getGUIString(gsMouseMode), 2, 90);
-				} else {
+				} else if (!_macGui) {
 					showBannerAndPause(0, 90, getGUIString(gsMouseMode));
 				}
 				return;


Commit: 144c0449e87180ce12495e6b1387c6c72a03730d
    https://github.com/scummvm/scummvm/commit/144c0449e87180ce12495e6b1387c6c72a03730d
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Fix uninitialized variable in Monkey Island 1

Changed paths:
    engines/scumm/macgui/macgui_v5.cpp


diff --git a/engines/scumm/macgui/macgui_v5.cpp b/engines/scumm/macgui/macgui_v5.cpp
index a3fa4a53d57..48fd568112e 100644
--- a/engines/scumm/macgui/macgui_v5.cpp
+++ b/engines/scumm/macgui/macgui_v5.cpp
@@ -107,6 +107,11 @@ bool MacV5Gui::getFontParams(FontId fontId, int &id, int &size, int &slant) cons
 void MacV5Gui::setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) {
 	if (_vm->_game.id == GID_MONKEY) {
 		_windowManager->replaceCursor(Graphics::MacGUIConstants::kMacCursorArrow);
+		width = 11;
+		height = 16;
+		hotspotX = 1;
+		hotspotY = 3;
+		animate = 0;
 	} else if (_vm->_game.version == 5) {
 		Common::MacResManager resource;
 		Graphics::MacCursor macCursor;


Commit: cf74d2db74aeb7a921010e6b5affaa38c3dd23af
    https://github.com/scummvm/scummvm/commit/cf74d2db74aeb7a921010e6b5affaa38c3dd23af
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Fix invalid read at end of string parsing

Instead of reading the string, then skipping to the next non-empty one,
skip the empty ones first. The result should be the same, and as long as
the final string in the table isn't empty (why should it be?) the result
ought to be the same but without the invalid read.

Changed paths:
    engines/scumm/macgui/macgui_strings.cpp


diff --git a/engines/scumm/macgui/macgui_strings.cpp b/engines/scumm/macgui/macgui_strings.cpp
index 67de65f441a..7d175543954 100644
--- a/engines/scumm/macgui/macgui_strings.cpp
+++ b/engines/scumm/macgui/macgui_strings.cpp
@@ -27,25 +27,25 @@
 namespace Scumm {
 
 Common::String MacGuiImpl::readCString(uint8 *&data) {
-	Common::String result(reinterpret_cast<const char *>(data));
-	data += result.size() + 1;
-
 	while (data[0] == '\0') {
 		data++;
 	}
 
+	Common::String result(reinterpret_cast<const char *>(data));
+	data += result.size() + 1;
+
 	debug(8, "MacGuiImpl::readCString(): %s", result.c_str());
 	return result;
 }
 
 Common::String MacGuiImpl::readPascalString(uint8 *&data) {
-	Common::String result(reinterpret_cast<const char *>(&data[1]), (uint32)data[0]);
-	data += (uint32)data[0] + 1;
-
 	while (data[0] == '\0') {
 		data++;
 	}
 
+	Common::String result(reinterpret_cast<const char *>(&data[1]), (uint32)data[0]);
+	data += (uint32)data[0] + 1;
+
 	debug(8, "MacGuiImpl::readPascalString(): %s", result.c_str());
 	return result;
 }
@@ -628,7 +628,7 @@ void MacGuiImpl::parseSTRSBlock(uint8 *strsData, MacSTRSParsingEntry *parsingTab
 	_strsStrings.reserve(128);
 	for (int i = 0; i < 128; i++) {
 		_strsStrings.emplace_back("");
-	} 
+	}
 
 	for (int i = 0; i < parsingTableSize; i++) {
 		MacSTRSParsingEntry entry = parsingTable[i];


Commit: 6d2b4e63ffabdc0da3194c8ea6f620bb698b4340
    https://github.com/scummvm/scummvm/commit/6d2b4e63ffabdc0da3194c8ea6f620bb698b4340
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Remove special palette case for Macintosh black-and-white

Both color and black-and-white now use the same EGA palette anyway for
the Mac.

Changed paths:
    engines/scumm/palette.cpp


diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index d45c6c0ac29..ae1e949c12c 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -224,10 +224,6 @@ void ScummEngine::resetPalette() {
 	} else if (_game.features & GF_16COLOR) {
 		switch (_renderMode) {
 		case Common::kRenderEGA:
-		case Common::kRenderMacintoshBW:
-			// Use EGA palette for MacintoshBW, because that makes
-			// white 0xFFFFFF there. The Mac EGA palette, would
-			// make it 0xFCFCFC.
 			setPaletteFromTable(tableEGAPalette, sizeof(tableEGAPalette) / 3);
 			break;
 


Commit: 1c3d41edf781977c9c676dd4900c6971056aa475
    https://github.com/scummvm/scummvm/commit/1c3d41edf781977c9c676dd4900c6971056aa475
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Move default save/load into macgui_impl.cpp

Plus some other minor cleanups. As far as I can tell, Last Crusade is
the only one of the games that doesn't use the system save/load dialogs,
so it makes sense to me to let the base GUI implement it.

Changed paths:
    engines/scumm/macgui/macgui_dialogwindow.cpp
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/macgui/macgui_impl.h
    engines/scumm/macgui/macgui_indy3.cpp
    engines/scumm/macgui/macgui_indy3.h
    engines/scumm/macgui/macgui_loom.cpp
    engines/scumm/macgui/macgui_loom.h
    engines/scumm/macgui/macgui_v5.cpp
    engines/scumm/macgui/macgui_v5.h


diff --git a/engines/scumm/macgui/macgui_dialogwindow.cpp b/engines/scumm/macgui/macgui_dialogwindow.cpp
index a4f31427f2c..0bb8ffdab1e 100644
--- a/engines/scumm/macgui/macgui_dialogwindow.cpp
+++ b/engines/scumm/macgui/macgui_dialogwindow.cpp
@@ -326,7 +326,14 @@ void MacGuiImpl::MacDialogWindow::drawDottedHLine(int x0, int y, int x1) {
 
 	uint32 color[2];
 
-	if (_gui->_vm->_renderMode == Common::kRenderMacintoshBW) {
+	// The dotted line is used by the default save/load dialogs as a
+	// separator between buttons. Surprisingly, this is only drawn using
+	// shades of gray in 16 color mode. Not, as you might think, in 256
+	// color mode.
+	//
+	// At least not in the version of MacOS that was used for reference.
+
+	if (_gui->_vm->_renderMode == Common::kRenderMacintoshBW || !(_gui->_vm->_game.features & GF_16COLOR)) {
 		color[0] = _black;
 		color[1] = _white;
 	} else {
diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index d34505a7c02..3dff95cdd4e 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -798,6 +798,139 @@ MacGuiImpl::MacDialogWindow *MacGuiImpl::createDialog(int dialogId) {
 // Standard dialogs
 // ---------------------------------------------------------------------------
 
+// A standard file picker dialog doesn't really make sense in ScummVM, so we
+// make something that just looks similar to one.
+
+bool MacGuiImpl::runOpenDialog(int &saveSlotToHandle) {
+	Common::Rect bounds(88, 28, 448, 210);
+
+	MacDialogWindow *window = createWindow(bounds);
+
+	window->addButton(Common::Rect(254, 137, 334, 157), "Open", true);
+	window->addButton(Common::Rect(254, 106, 334, 126), "Cancel", true);
+	window->addButton(Common::Rect(254, 62, 334, 82), "Desktop", false);
+	window->addButton(Common::Rect(254, 34, 334, 54), "Eject", false);
+
+	window->drawDottedHLine(253, 93, 334);
+
+	bool availSlots[100];
+	int slotIds[100];
+	Common::StringArray savegameNames;
+	prepareSaveLoad(savegameNames, availSlots, slotIds, ARRAYSIZE(availSlots));
+
+	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, name().c_str(), Graphics::kTextAlignLeft);
+	drawFakeDriveLabel(window, Common::Rect(242, 10, 340, 28), _hardDriveIcon, "ScummVM", Graphics::kTextAlignLeft);
+
+	window->addListBox(Common::Rect(14, 31, 232, 161), savegameNames, true);
+
+	window->setDefaultWidget(0);
+
+	// When quitting, the default action is to not open a saved game
+	bool ret = false;
+	Common::Array<int> deferredActionsIds;
+
+	while (!_vm->shouldQuit()) {
+		int clicked = window->runDialog(deferredActionsIds);
+
+		if (clicked == 0 || clicked == 6) {
+			saveSlotToHandle =
+				window->getWidgetValue(6) < ARRAYSIZE(slotIds) ?
+				slotIds[window->getWidgetValue(6)] : -1;
+			ret = true;
+			break;
+		}
+
+		if (clicked == 1)
+			break;
+	}
+
+	delete window;
+	return ret;
+}
+
+bool MacGuiImpl::runSaveDialog(int &saveSlotToHandle, Common::String &saveName) {
+	uint32 black = getBlack();
+
+	Common::Rect bounds(110, 27, 470, 231);
+
+	MacDialogWindow *window = createWindow(bounds);
+
+	window->addButton(Common::Rect(254, 163, 334, 183), "Save", true);
+	window->addButton(Common::Rect(254, 132, 334, 152), "Cancel", true);
+	window->addButton(Common::Rect(254, 90, 334, 110), "New", false);
+	window->addButton(Common::Rect(254, 62, 334, 82), "Desktop", false);
+	window->addButton(Common::Rect(254, 34, 334, 54), "Eject", false);
+
+	bool busySlots[100];
+	int slotIds[100];
+	Common::StringArray savegameNames;
+	prepareSaveLoad(savegameNames, busySlots, slotIds, ARRAYSIZE(busySlots));
+
+	Common::String saveGameFileAsResStr = _strsStrings[kMSISaveGameFileAs].c_str();
+	Common::String gameFileResStr = _strsStrings[kMSIGameFile].c_str();
+
+	int firstAvailableSlot = -1;
+	for (int i = 1; i < ARRAYSIZE(busySlots); i++) { // Skip the autosave slot
+		if (!busySlots[i]) {
+			firstAvailableSlot = i;
+			break;
+		}
+	}
+
+	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, name().c_str(), Graphics::kTextAlignLeft);
+	drawFakeDriveLabel(window, Common::Rect(242, 10, 340, 28), _hardDriveIcon, "ScummVM", Graphics::kTextAlignLeft);
+
+	window->addListBox(Common::Rect(14, 31, 232, 129), savegameNames, true, true);
+
+	MacGuiImpl::MacEditText *editText = window->addEditText(Common::Rect(16, 159, 229, 175), gameFileResStr, true);
+
+	Graphics::Surface *s = window->innerSurface();
+	const Graphics::Font *font = getFont(kSystemFont);
+
+	s->frameRect(Common::Rect(14, 156, 232, 178), black);
+
+	window->drawDottedHLine(253, 121, 334);
+
+	font->drawString(s, saveGameFileAsResStr, 14, 138, 218, black, Graphics::kTextAlignLeft, 4);
+
+	window->setDefaultWidget(0);
+	editText->selectAll();
+
+	// When quitting, the default action is to not open a saved game
+	bool ret = false;
+	Common::Array<int> deferredActionsIds;
+
+	while (!_vm->shouldQuit()) {
+		int clicked = window->runDialog(deferredActionsIds);
+
+		if (clicked == 0) {
+			ret = true;
+			saveName = editText->getText();
+			saveSlotToHandle = firstAvailableSlot;
+			break;
+		}
+
+		if (clicked == 1)
+			break;
+
+		if (clicked == -2) {
+			// Cycle through deferred actions
+			for (uint i = 0; i < deferredActionsIds.size(); i++) {
+				// Edit text widget
+				if (deferredActionsIds[i] == 4) {
+					MacGuiImpl::MacWidget *wid = window->getWidget(deferredActionsIds[i]);
+
+					// Disable "Save" button when text is empty
+					window->getWidget(0)->setEnabled(!wid->getText().empty());
+				}
+			}
+		}
+	}
+
+	delete window;
+	return ret;
+}
+
 void MacGuiImpl::prepareSaveLoad(Common::StringArray &savegameNames, bool *availSlots, int *slotIds, int size) {
 	int saveCounter = 0;
 
diff --git a/engines/scumm/macgui/macgui_impl.h b/engines/scumm/macgui/macgui_impl.h
index 5019fc54326..a8749881bfc 100644
--- a/engines/scumm/macgui/macgui_impl.h
+++ b/engines/scumm/macgui/macgui_impl.h
@@ -248,8 +248,8 @@ protected:
 	virtual bool handleMenu(int id, Common::String &name);
 
 	virtual void runAboutDialog() = 0;
-	virtual bool runOpenDialog(int &saveSlotToHandle) = 0;
-	virtual bool runSaveDialog(int &saveSlotToHandle, Common::String &name) = 0;
+	virtual bool runOpenDialog(int &saveSlotToHandle);
+	virtual bool runSaveDialog(int &saveSlotToHandle, Common::String &saveName);
 	virtual bool runOptionsDialog() = 0;
 	void prepareSaveLoad(Common::StringArray &savegameNames, bool *availSlots, int *slotIds, int size);
 
diff --git a/engines/scumm/macgui/macgui_indy3.cpp b/engines/scumm/macgui/macgui_indy3.cpp
index 990beb51e5d..f5d6148d2c5 100644
--- a/engines/scumm/macgui/macgui_indy3.cpp
+++ b/engines/scumm/macgui/macgui_indy3.cpp
@@ -1404,7 +1404,7 @@ bool MacIndy3Gui::runOpenDialog(int &saveSlotToHandle) {
 	return ret;
 }
 
-bool MacIndy3Gui::runSaveDialog(int &saveSlotToHandle, Common::String &name) {
+bool MacIndy3Gui::runSaveDialog(int &saveSlotToHandle, Common::String &saveName) {
 	// Widgets:
 	//
 	// 0 - Save button
@@ -1452,7 +1452,7 @@ bool MacIndy3Gui::runSaveDialog(int &saveSlotToHandle, Common::String &name) {
 
 		if (clicked == 0) {
 			ret = true;
-			name = window->getWidget(6)->getText(); // Edit text widget
+			saveName = window->getWidget(6)->getText(); // Edit text widget
 			saveSlotToHandle = firstAvailableSlot;
 			break;
 		}
diff --git a/engines/scumm/macgui/macgui_indy3.h b/engines/scumm/macgui/macgui_indy3.h
index 4b210a2e94f..42065800b65 100644
--- a/engines/scumm/macgui/macgui_indy3.h
+++ b/engines/scumm/macgui/macgui_indy3.h
@@ -82,7 +82,7 @@ protected:
 
 	void runAboutDialog() override;
 	bool runOpenDialog(int &saveSlotToHandle) override;
-	bool runSaveDialog(int &saveSlotToHandle, Common::String &name) override;
+	bool runSaveDialog(int &saveSlotToHandle, Common::String &saveName) override;
 	bool runOptionsDialog() override;
 	bool runIqPointsDialog();
 
diff --git a/engines/scumm/macgui/macgui_loom.cpp b/engines/scumm/macgui/macgui_loom.cpp
index cee3f0aa876..38f2387f284 100644
--- a/engines/scumm/macgui/macgui_loom.cpp
+++ b/engines/scumm/macgui/macgui_loom.cpp
@@ -486,137 +486,6 @@ void MacLoomGui::runDraftsInventory() {
 	delete window;
 }
 
-// A standard file picker dialog doesn't really make sense in ScummVM, so we
-// make something that just looks similar to one.
-
-bool MacLoomGui::runOpenDialog(int &saveSlotToHandle) {
-	Common::Rect bounds(88, 28, 448, 210);
-
-	MacDialogWindow *window = createWindow(bounds);
-
-	window->addButton(Common::Rect(254, 137, 334, 157), "Open", true);
-	window->addButton(Common::Rect(254, 106, 334, 126), "Cancel", true);
-	window->addButton(Common::Rect(254, 62, 334, 82), "Desktop", false);
-	window->addButton(Common::Rect(254, 34, 334, 54), "Eject", false);
-
-	window->drawDottedHLine(253, 93, 334);
-
-	bool availSlots[100];
-	int slotIds[100];
-	Common::StringArray savegameNames;
-	prepareSaveLoad(savegameNames, availSlots, slotIds, ARRAYSIZE(availSlots));
-
-	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, "Loom", Graphics::kTextAlignLeft);
-	drawFakeDriveLabel(window, Common::Rect(242, 10, 340, 28), _hardDriveIcon, "ScummVM", Graphics::kTextAlignLeft);
-
-	window->addListBox(Common::Rect(14, 31, 232, 161), savegameNames, true);
-
-	window->setDefaultWidget(0);
-
-	// When quitting, the default action is to not open a saved game
-	bool ret = false;
-	Common::Array<int> deferredActionsIds;
-
-	while (!_vm->shouldQuit()) {
-		int clicked = window->runDialog(deferredActionsIds);
-
-		if (clicked == 0 || clicked == 6) {
-			saveSlotToHandle =
-				window->getWidgetValue(6) < ARRAYSIZE(slotIds) ?
-				slotIds[window->getWidgetValue(6)] : -1;
-			ret = true;
-			break;
-		}
-
-		if (clicked == 1)
-			break;
-	}
-
-	delete window;
-	return ret;
-}
-
-bool MacLoomGui::runSaveDialog(int &saveSlotToHandle, Common::String &name) {
-	Common::Rect bounds(110, 27, 470, 231);
-
-	MacDialogWindow *window = createWindow(bounds);
-
-	window->addButton(Common::Rect(254, 163, 334, 183), "Save", true);
-	window->addButton(Common::Rect(254, 132, 334, 152), "Cancel", true);
-	window->addButton(Common::Rect(254, 90, 334, 110), "New", false);
-	window->addButton(Common::Rect(254, 62, 334, 82), "Desktop", false);
-	window->addButton(Common::Rect(254, 34, 334, 54), "Eject", false);
-
-	bool busySlots[100];
-	int slotIds[100];
-	Common::StringArray savegameNames;
-	prepareSaveLoad(savegameNames, busySlots, slotIds, ARRAYSIZE(busySlots));
-
-	Common::String saveGameFileAsResStr = _strsStrings[kMSISaveGameFileAs].c_str();
-	Common::String gameFileResStr = _strsStrings[kMSIGameFile].c_str();
-
-	int firstAvailableSlot = -1;
-	for (int i = 1; i < ARRAYSIZE(busySlots); i++) { // Skip the autosave slot
-		if (!busySlots[i]) {
-			firstAvailableSlot = i;
-			break;
-		}
-	}
-
-	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, "Loom", Graphics::kTextAlignLeft);
-	drawFakeDriveLabel(window, Common::Rect(242, 10, 340, 28), _hardDriveIcon, "ScummVM", Graphics::kTextAlignLeft);
-
-	window->addListBox(Common::Rect(14, 31, 232, 129), savegameNames, true, true);
-
-	MacGuiImpl::MacEditText *editText = window->addEditText(Common::Rect(16, 159, 229, 175), gameFileResStr, true);
-
-	Graphics::Surface *s = window->innerSurface();
-	const Graphics::Font *font = getFont(kSystemFont);
-
-	s->frameRect(Common::Rect(14, 156, 232, 178), kBlack);
-
-	window->drawDottedHLine(253, 121, 334);
-
-	font->drawString(s, saveGameFileAsResStr, 14, 138, 218, kBlack, Graphics::kTextAlignLeft, 4);
-
-	window->setDefaultWidget(0);
-	editText->selectAll();
-
-	// When quitting, the default action is to not open a saved game
-	bool ret = false;
-	Common::Array<int> deferredActionsIds;
-
-	while (!_vm->shouldQuit()) {
-		int clicked = window->runDialog(deferredActionsIds);
-
-		if (clicked == 0) {
-			ret = true;
-			name = editText->getText();
-			saveSlotToHandle = firstAvailableSlot;
-			break;
-		}
-
-		if (clicked == 1)
-			break;
-
-		if (clicked == -2) {
-			// Cycle through deferred actions
-			for (uint i = 0; i < deferredActionsIds.size(); i++) {
-				// Edit text widget
-				if (deferredActionsIds[i] == 4) {
-					MacGuiImpl::MacWidget *wid = window->getWidget(deferredActionsIds[i]);
-
-					// Disable "Save" button when text is empty
-					window->getWidget(0)->setEnabled(!wid->getText().empty());
-				}
-			}
-		}
-	}
-
-	delete window;
-	return ret;
-}
-
 bool MacLoomGui::runOptionsDialog() {
 	// Widgets:
 	//
diff --git a/engines/scumm/macgui/macgui_loom.h b/engines/scumm/macgui/macgui_loom.h
index 6a8f4d7325a..e54231f3c87 100644
--- a/engines/scumm/macgui/macgui_loom.h
+++ b/engines/scumm/macgui/macgui_loom.h
@@ -55,8 +55,6 @@ protected:
 	bool handleMenu(int id, Common::String &name) override;
 
 	void runAboutDialog() override;
-	bool runOpenDialog(int &saveSlotToHandle) override;
-	bool runSaveDialog(int &saveSlotToHandle, Common::String &name) override;
 	bool runOptionsDialog() override;
 
 private:
diff --git a/engines/scumm/macgui/macgui_v5.cpp b/engines/scumm/macgui/macgui_v5.cpp
index 48fd568112e..ed3ce015f43 100644
--- a/engines/scumm/macgui/macgui_v5.cpp
+++ b/engines/scumm/macgui/macgui_v5.cpp
@@ -49,13 +49,8 @@ MacV5Gui::MacV5Gui(ScummEngine *vm, const Common::Path &resourceFile) : MacGuiIm
 }
 
 const Graphics::Font *MacV5Gui::getFontByScummId(int32 id) {
-	switch (id) {
-	case 0:
-		return getFont(kLoomFontLarge);
-
-	default:
-		error("MacV5Gui::getFontByScummId: Invalid font id %d", id);
-	}
+	// V5 games do not use CharsetRendererMac
+	return nullptr;
 }
 
 bool MacV5Gui::getFontParams(FontId fontId, int &id, int &size, int &slant) const {
@@ -784,139 +779,6 @@ void MacV5Gui::runAboutDialogIndy4(MacDialogWindow *window) {
 	delete indianaJones;
 }
 
-// A standard file picker dialog doesn't really make sense in ScummVM, so we
-// make something that just looks similar to one.
-
-bool MacV5Gui::runOpenDialog(int &saveSlotToHandle) {
-	Common::Rect bounds(88, 28, 448, 210);
-
-	MacDialogWindow *window = createWindow(bounds);
-
-	window->addButton(Common::Rect(254, 137, 334, 157), "Open", true);
-	window->addButton(Common::Rect(254, 106, 334, 126), "Cancel", true);
-	window->addButton(Common::Rect(254, 62, 334, 82), "Desktop", false);
-	window->addButton(Common::Rect(254, 34, 334, 54), "Eject", false);
-
-	window->drawDottedHLine(253, 93, 334);
-
-	bool availSlots[100];
-	int slotIds[100];
-	Common::StringArray savegameNames;
-	prepareSaveLoad(savegameNames, availSlots, slotIds, ARRAYSIZE(availSlots));
-
-	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, _strsStrings[kMSIGameName].c_str(), Graphics::kTextAlignLeft);
-	drawFakeDriveLabel(window, Common::Rect(242, 10, 340, 28), _hardDriveIcon, "ScummVM", Graphics::kTextAlignLeft);
-
-	window->addListBox(Common::Rect(14, 31, 232, 161), savegameNames, true);
-
-	window->setDefaultWidget(0);
-
-	// When quitting, the default action is to not open a saved game
-	bool ret = false;
-	Common::Array<int> deferredActionsIds;
-
-	while (!_vm->shouldQuit()) {
-		int clicked = window->runDialog(deferredActionsIds);
-
-		if (clicked == 0 || clicked == 6) {
-			saveSlotToHandle =
-				window->getWidgetValue(6) < ARRAYSIZE(slotIds) ?
-				slotIds[window->getWidgetValue(6)] : -1;
-			ret = true;
-			break;
-		}
-
-		if (clicked == 1)
-			break;
-	}
-
-	delete window;
-	return ret;
-}
-
-bool MacV5Gui::runSaveDialog(int &saveSlotToHandle, Common::String &name) {
-	uint32 black = getBlack();
-
-	Common::Rect bounds(110, 27, 470, 231);
-
-	MacDialogWindow *window = createWindow(bounds);
-
-	window->addButton(Common::Rect(254, 163, 334, 183), "Save", true);
-	window->addButton(Common::Rect(254, 132, 334, 152), "Cancel", true);
-	window->addButton(Common::Rect(254, 90, 334, 110), "New", false);
-	window->addButton(Common::Rect(254, 62, 334, 82), "Desktop", false);
-	window->addButton(Common::Rect(254, 34, 334, 54), "Eject", false);
-
-	bool busySlots[100];
-	int slotIds[100];
-	Common::StringArray savegameNames;
-	prepareSaveLoad(savegameNames, busySlots, slotIds, ARRAYSIZE(busySlots));
-
-	Common::String saveGameFileAsResStr = _strsStrings[kMSISaveGameFileAs].c_str();
-	Common::String gameFileResStr = _strsStrings[kMSIGameFile].c_str();
-
-	int firstAvailableSlot = -1;
-	for (int i = 1; i < ARRAYSIZE(busySlots); i++) { // Skip the autosave slot
-		if (!busySlots[i]) {
-			firstAvailableSlot = i;
-			break;
-		}
-	}
-
-	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, _strsStrings[kMSIGameName].c_str(), Graphics::kTextAlignLeft);
-	drawFakeDriveLabel(window, Common::Rect(242, 10, 340, 28), _hardDriveIcon, "ScummVM", Graphics::kTextAlignLeft);
-
-	window->addListBox(Common::Rect(14, 31, 232, 129), savegameNames, true, true);
-
-	MacGuiImpl::MacEditText *editText = window->addEditText(Common::Rect(16, 159, 229, 175), gameFileResStr, true);
-
-	Graphics::Surface *s = window->innerSurface();
-	const Graphics::Font *font = getFont(kSystemFont);
-
-	s->frameRect(Common::Rect(14, 156, 232, 178), black);
-
-	window->drawDottedHLine(253, 121, 334);
-
-	font->drawString(s, saveGameFileAsResStr, 14, 138, 218, black, Graphics::kTextAlignLeft, 4);
-
-	window->setDefaultWidget(0);
-	editText->selectAll();
-
-	// When quitting, the default action is to not open a saved game
-	bool ret = false;
-	Common::Array<int> deferredActionsIds;
-
-	while (!_vm->shouldQuit()) {
-		int clicked = window->runDialog(deferredActionsIds);
-
-		if (clicked == 0) {
-			ret = true;
-			name = editText->getText();
-			saveSlotToHandle = firstAvailableSlot;
-			break;
-		}
-
-		if (clicked == 1)
-			break;
-
-		if (clicked == -2) {
-			// Cycle through deferred actions
-			for (uint i = 0; i < deferredActionsIds.size(); i++) {
-				// Edit text widget
-				if (deferredActionsIds[i] == 4) {
-					MacGuiImpl::MacWidget *wid = window->getWidget(deferredActionsIds[i]);
-
-					// Disable "Save" button when text is empty
-					window->getWidget(0)->setEnabled(!wid->getText().empty());
-				}
-			}
-		}
-	}
-
-	delete window;
-	return ret;
-}
-
 bool MacV5Gui::runOptionsDialog() {
 	// Widgets:
 	//
diff --git a/engines/scumm/macgui/macgui_v5.h b/engines/scumm/macgui/macgui_v5.h
index f8085f4c018..d6023867c83 100644
--- a/engines/scumm/macgui/macgui_v5.h
+++ b/engines/scumm/macgui/macgui_v5.h
@@ -35,27 +35,25 @@ public:
 	MacV5Gui(ScummEngine *vm, const Common::Path &resourceFile);
 	~MacV5Gui() {}
 
-	const Common::String name() const { return "game"; }
+	const Common::String name() const override { return _strsStrings[kMSIGameName]; }
 	int getNumColors() const override { return 256; }
 
-	bool handleEvent(Common::Event event);
+	bool handleEvent(Common::Event event) override;
 
 	const Graphics::Font *getFontByScummId(int32 id);
 
-	void setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate);
+	void setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) override;
 
-	void resetAfterLoad();
-	void update(int delta) {}
+	void resetAfterLoad() override;
+	void update(int delta) override {}
 
 protected:
-	bool getFontParams(FontId fontId, int &id, int &size, int &slant) const;
+	bool getFontParams(FontId fontId, int &id, int &size, int &slant) const override;
 
-	bool handleMenu(int id, Common::String &name);
+	bool handleMenu(int id, Common::String &name) override;
 
-	void runAboutDialog();
-	bool runOpenDialog(int &saveSlotToHandle);
-	bool runSaveDialog(int &saveSlotToHandle, Common::String &name);
-	bool runOptionsDialog();
+	void runAboutDialog() override;
+	bool runOptionsDialog() override;
 
 private:
 	struct AboutPage {


Commit: 001e43d12c5e5300977e410a42d9d40772d26dc2
    https://github.com/scummvm/scummvm/commit/001e43d12c5e5300977e410a42d9d40772d26dc2
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Fix Speech settings menu

Patch by eriktorbjorn

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 3dff95cdd4e..5d5e9a3bc06 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -20,6 +20,7 @@
  */
 
 #include "common/system.h"
+#include "common/config-manager.h"
 #include "common/enc-internal.h"
 #include "common/macresman.h"
 
@@ -364,18 +365,21 @@ bool MacGuiImpl::handleMenu(int id, Common::String &name) {
 		return true;
 
 	case 500: // Voice Only
-		_vm->_voiceMode = 0;
-		_vm->_v5VoiceMode = 0;
+		ConfMan.setBool("subtitles", false);
+		ConfMan.setBool("speech_mute", false);
+		ConfMan.flushToDisk();
 		_vm->syncSoundSettings();
 		return true;
 	case 501: // Text Only
-		_vm->_voiceMode = 2;
-		_vm->_v5VoiceMode = 2;
+		ConfMan.setBool("subtitles", true);
+		ConfMan.setBool("speech_mute", true);
+		ConfMan.flushToDisk();
 		_vm->syncSoundSettings();
 		return true;
 	case 502: // Voice and Text
-		_vm->_voiceMode = 1;
-		_vm->_v5VoiceMode = 1;
+		ConfMan.setBool("subtitles", true);
+		ConfMan.setBool("speech_mute", false);
+		ConfMan.flushToDisk();
 		_vm->syncSoundSettings();
 		return true;
 	}


Commit: 2194bcab96d833461a6e23462f2fddb210fc0fea
    https://github.com/scummvm/scummvm/commit/2194bcab96d833461a6e23462f2fddb210fc0fea
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Fix cursor handling when saving/loading

Changed paths:
    engines/scumm/macgui/macgui_v5.cpp
    engines/scumm/saveload.cpp


diff --git a/engines/scumm/macgui/macgui_v5.cpp b/engines/scumm/macgui/macgui_v5.cpp
index ed3ce015f43..36a73a6842e 100644
--- a/engines/scumm/macgui/macgui_v5.cpp
+++ b/engines/scumm/macgui/macgui_v5.cpp
@@ -867,7 +867,9 @@ bool MacV5Gui::runOptionsDialog() {
 
 void MacV5Gui::resetAfterLoad() {
 	reset();
-	_windowManager->replaceCursor(Graphics::MacGUIConstants::kMacCursorArrow);
+
+	int dummyW, dummyH, dummyHX, dummyHY, dummyAnimate;
+	setupCursor(dummyW, dummyH, dummyHX, dummyHY, dummyAnimate);
 }
 
 bool MacV5Gui::handleEvent(Common::Event event) {
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index f23e2a745c6..78c9c9bf1a9 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -1649,6 +1649,10 @@ void ScummEngine::saveLoadWithSerializer(Common::Serializer &s) {
 		} else if (_textSurfaceMultiplier == 2 || _renderMode == Common::kRenderCGA_BW || _enableEGADithering) {
 			x *= 2;
 			y *= 2;
+		} else if (_macScreen) {
+			y += _macScreenDrawOffset;
+			x *= 2;
+			y *= 2;
 		}
 
 		updateCursor();


Commit: 16f24b9cfda8c2b325affc9e4749bc5672c8065d
    https://github.com/scummvm/scummvm/commit/16f24b9cfda8c2b325affc9e4749bc5672c8065d
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Improved the fake save/load "widgets"

The "dropdown" is now only as wide as it needs to be, and the "drive
label" is centered. I've also changed the images to bitmaps which, so
that they can be stored in a more compact form. Plus some other cleanups
and simplifications.

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/macgui/macgui_impl.h
    engines/scumm/macgui/macgui_indy3.cpp


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 5d5e9a3bc06..6e5fdb04f4e 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -733,7 +733,7 @@ MacGuiImpl::MacDialogWindow *MacGuiImpl::createDialog(int dialogId) {
 				if (!doNotDraw) {
 					window->innerSurface()->frameRect(r, black);
 				} else if (_vm->_game.id == GID_INDY3 && i == 3) {
-					drawFakeDriveLabel(window, Common::Rect(r.left + 9, r.top, r.right, r.bottom), _hardDriveIcon, "ScummVM", Graphics::kTextAlignLeft);
+					drawFakeDriveLabel(window, Common::Rect(r.left + 5, r.top, r.right, r.bottom), "ScummVM");
 				}
 
 				break;
@@ -822,8 +822,8 @@ bool MacGuiImpl::runOpenDialog(int &saveSlotToHandle) {
 	Common::StringArray savegameNames;
 	prepareSaveLoad(savegameNames, availSlots, slotIds, ARRAYSIZE(availSlots));
 
-	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, name().c_str(), Graphics::kTextAlignLeft);
-	drawFakeDriveLabel(window, Common::Rect(242, 10, 340, 28), _hardDriveIcon, "ScummVM", Graphics::kTextAlignLeft);
+	drawFakePathList(window, Common::Rect(14, 8, 232, 27), name().c_str());
+	drawFakeDriveLabel(window, Common::Rect(232, 10, 344, 28), "ScummVM");
 
 	window->addListBox(Common::Rect(14, 31, 232, 161), savegameNames, true);
 
@@ -881,8 +881,8 @@ bool MacGuiImpl::runSaveDialog(int &saveSlotToHandle, Common::String &saveName)
 		}
 	}
 
-	drawFakePathList(window, Common::Rect(14, 8, 232, 26), _folderIcon, name().c_str(), Graphics::kTextAlignLeft);
-	drawFakeDriveLabel(window, Common::Rect(242, 10, 340, 28), _hardDriveIcon, "ScummVM", Graphics::kTextAlignLeft);
+	drawFakePathList(window, Common::Rect(14, 8, 232, 27), name().c_str());
+	drawFakeDriveLabel(window, Common::Rect(232, 10, 344, 28), "ScummVM");
 
 	window->addListBox(Common::Rect(14, 31, 232, 129), savegameNames, true, true);
 
@@ -997,44 +997,72 @@ bool MacGuiImpl::runOkCancelDialog(Common::String text) {
 	return ret;
 }
 
-void MacGuiImpl::drawFakePathList(MacDialogWindow *window, Common::Rect r, byte *icon, const char *text, Graphics::TextAlign alignment) {
+void MacGuiImpl::drawFakePathList(MacDialogWindow *window, Common::Rect r, const char *text) {
 	uint32 black = getBlack();
+	const Graphics::Font *font = getFont(kSystemFont);
 
 	// Draw the text...
-	window->addStaticText(Common::Rect(r.left + 22, r.top + 2, r.right - 21, r.bottom - 1), text, true, alignment);
+	int x0 = r.left + 23;
+	int x1 = r.right - 23;
+
+	font->drawString(window->innerSurface(), text, x0 + 1, r.top + 2, x1 - x0, black, Graphics::kTextAlignCenter, 0, true);
+
+	int width = font->getStringWidth(text);
+
+	if (width < x1 - x0) {
+		int middle = (x0 + x1) / 2;
+		x0 = middle - width / 2;
+		x1 = middle + width / 2;
+	}
+
+	Common::Rect iconRect(16, 16);
+
+	const uint16 folderIcon[16] = {
+		0x0000,	0x0000,	0x0000,	0x0000,	0x1E00,	0x21FC,	0x2002,	0xFFE2,
+		0x8012,	0x4012,	0x400A,	0x200A,	0x2006,	0x1FFE,	0x0000,	0x0000
+	};
+
+	const uint16 arrowDownIcon[16] = {
+		0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3FF8, 0x1FF0, 0x0FE0,
+		0x07C0, 0x0380, 0x0100, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
+	};
 
 	// Draw the icon...
-	Graphics::Surface *iconSurf = new Graphics::Surface();
-	iconSurf->create(16, 16, Graphics::PixelFormat::createFormatCLUT8());
-	iconSurf->setPixels(icon);
-	window->drawSprite(iconSurf, r.left + 4, r.top + 1);
-	delete iconSurf;
+	iconRect.moveTo(x0 - 19, r.top + 1);
+	drawBitmap(window->innerSurface(), iconRect, folderIcon, black);
 
 	// Draw the arrow...
-	Graphics::Surface *arrowSurf = new Graphics::Surface();
-	arrowSurf->create(16, 16, Graphics::PixelFormat::createFormatCLUT8());
-	arrowSurf->setPixels(_arrowDownIcon);
-	window->drawSprite(arrowSurf, r.right - 19, r.top + 1);
-	delete arrowSurf;
+	iconRect.moveTo(x1 + 4, r.top + 1);
+	drawBitmap(window->innerSurface(), iconRect, arrowDownIcon, black);
 
 	// Draw the black frame...
-	window->innerSurface()->frameRect(r, black);
+	window->innerSurface()->frameRect(Common::Rect(x0 - 23, r.top, x1 + 23, r.bottom - 1), black);
 
 	// Draw the shadows...
-	window->innerSurface()->hLine(r.left + 3, r.bottom, r.right, black);
-	window->innerSurface()->vLine(r.right, r.top + 3, r.bottom, black);
+	window->innerSurface()->hLine(x0 - 20, r.bottom - 1, x1 + 23, black);
+	window->innerSurface()->vLine(x1 + 23, r.top + 3, r.bottom - 1, black);
 }
 
-void MacGuiImpl::drawFakeDriveLabel(MacDialogWindow *window, Common::Rect r, byte *icon, const char *text, Graphics::TextAlign alignment) {
-	// Draw the text...
-	window->addStaticText(Common::Rect(r.left + 25, r.top, r.right, r.bottom), text, true, alignment);
+void MacGuiImpl::drawFakeDriveLabel(MacDialogWindow *window, Common::Rect r, const char *text) {
+	uint32 black = getBlack();
+	const Graphics::Font *font = getFont(kSystemFont);
 
-	// Draw the icon...
-	Graphics::Surface *surf = new Graphics::Surface();
-	surf->create(16, 16, Graphics::PixelFormat::createFormatCLUT8());
-	surf->setPixels(icon);
-	window->drawSprite(surf, r.left + 6, r.top);
-	delete surf;
+	font->drawString(window->innerSurface(), text, r.left, r.top, r.width(), black, Graphics::kTextAlignCenter, 9, true);
+
+	const uint16 hardDriveIcon[16] = {
+		0x0000,	0x0000,	0x0000,	0x0000,	0x0000,	0x7FFE,	0x8001,	0x8001,
+		0xA001,	0x8001,	0x7FFE,	0x0000,	0x0000,	0x0000,	0x0000, 0x0000
+	};
+
+	Common::Rect iconRect(16, 16);
+	int width = font->getStringWidth(text);
+
+	if (width < r.width())
+		iconRect.moveTo((r.left + r.right - width - 20) / 2, r.top);
+	else
+		iconRect.moveTo(r.left, r.top);
+
+	drawBitmap(window->innerSurface(), iconRect, hardDriveIcon, black);
 }
 
 bool MacGuiImpl::runQuitDialog() {
diff --git a/engines/scumm/macgui/macgui_impl.h b/engines/scumm/macgui/macgui_impl.h
index a8749881bfc..fe41bf034b8 100644
--- a/engines/scumm/macgui/macgui_impl.h
+++ b/engines/scumm/macgui/macgui_impl.h
@@ -182,63 +182,6 @@ protected:
 		kStyleRounded
 	};
 
-	byte _hardDriveIcon[16 * 16] = {
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F,
-		0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00,
-		0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00,
-		0x00, 0x0F, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00,
-		0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00,
-		0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F
-	};
-
-	byte _folderIcon[16 * 16] = {
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x0F,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x0F,
-		0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x0F, 0x0F, 0x00, 0x0F,
-		0x0F, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x0F, 0x0F, 0x00, 0x0F,
-		0x0F, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x0F, 0x00, 0x0F,
-		0x0F, 0x0F, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x0F, 0x00, 0x0F,
-		0x0F, 0x0F, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F
-	};
-
-	byte _arrowDownIcon[16 * 16] = {
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
-		0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F
-	};
-
 	MacGuiImpl::DelayStatus delay(uint32 ms = 0);
 
 	virtual bool getFontParams(FontId fontId, int &id, int &size, int &slant) const;
@@ -259,8 +202,8 @@ protected:
 	void parseSTRSBlock(uint8 *strsData, MacSTRSParsingEntry *parsingTable, int parsingTableSize);
 
 	// These are non interactable, no point in having them as widgets for now...
-	void drawFakePathList(MacDialogWindow *window, Common::Rect r, byte *icon, const char *text, Graphics::TextAlign alignment);
-	void drawFakeDriveLabel(MacDialogWindow *window, Common::Rect r, byte *icon, const char *text, Graphics::TextAlign alignment);
+	void drawFakePathList(MacDialogWindow *window, Common::Rect r, const char *text);
+	void drawFakeDriveLabel(MacDialogWindow *window, Common::Rect r, const char *text);
 
 public:
 	class MacGuiObject {
diff --git a/engines/scumm/macgui/macgui_indy3.cpp b/engines/scumm/macgui/macgui_indy3.cpp
index f5d6148d2c5..75d0bf6d970 100644
--- a/engines/scumm/macgui/macgui_indy3.cpp
+++ b/engines/scumm/macgui/macgui_indy3.cpp
@@ -1378,7 +1378,7 @@ bool MacIndy3Gui::runOpenDialog(int &saveSlotToHandle) {
 	Common::StringArray savegameNames;
 	prepareSaveLoad(savegameNames, availSlots, slotIds, ARRAYSIZE(availSlots));
 
-	drawFakePathList(window, Common::Rect(14, 18, 231, 36), _folderIcon, "Indy and The Last Crusade", Graphics::kTextAlignLeft);
+	drawFakePathList(window, Common::Rect(14, 18, 231, 37), "Indy Last Crusade");
 
 	MacGuiImpl::MacListBox *listBox = window->addListBox(Common::Rect(14, 41, 232, 187), savegameNames, true);
 
@@ -1431,7 +1431,7 @@ bool MacIndy3Gui::runSaveDialog(int &saveSlotToHandle, Common::String &saveName)
 	Common::StringArray savegameNames;
 	prepareSaveLoad(savegameNames, busySlots, slotIds, ARRAYSIZE(busySlots));
 
-	drawFakePathList(window, Common::Rect(16, 8, 198, 26), _folderIcon, "Indy and The Last ...", Graphics::kTextAlignLeft);
+	drawFakePathList(window, Common::Rect(16, 8, 198, 27), "Indy Last Crusade");
 
 	int firstAvailableSlot = -1;
 	for (int i = 0; i < ARRAYSIZE(busySlots); i++) {


Commit: 261b4019d53288246043b4352d298caaf3007ef1
    https://github.com/scummvm/scummvm/commit/261b4019d53288246043b4352d298caaf3007ef1
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Scribble on the fake Mac menu bar when opening dialogs

On a real Mac, the menu bar remains interactive while dialogs are shown.
This is only useful for the Edit menu during the Save dialog, and we
don't implement the Edit menu anyway. Ours is just decorative, but now
it looks a bit more like the original: Menus are grayed out or, for
About dialogs, the Apple menu is still highlighted.

Changed paths:
    engines/scumm/macgui/macgui_dialogwindow.cpp
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/macgui/macgui_impl.h
    engines/scumm/macgui/macgui_indy3.cpp
    engines/scumm/macgui/macgui_loom.cpp
    engines/scumm/macgui/macgui_v5.cpp


diff --git a/engines/scumm/macgui/macgui_dialogwindow.cpp b/engines/scumm/macgui/macgui_dialogwindow.cpp
index 0bb8ffdab1e..69c6ccf1f97 100644
--- a/engines/scumm/macgui/macgui_dialogwindow.cpp
+++ b/engines/scumm/macgui/macgui_dialogwindow.cpp
@@ -39,7 +39,13 @@ namespace Scumm {
 // drawing area (about and pause). It can not be dragged.
 // ---------------------------------------------------------------------------
 
-MacGuiImpl::MacDialogWindow::MacDialogWindow(MacGuiImpl *gui, OSystem *system, Graphics::Surface *from, Common::Rect bounds, MacDialogWindowStyle style) : _gui(gui), _system(system), _from(from), _bounds(bounds) {
+MacGuiImpl::MacDialogWindow::MacDialogWindow(MacGuiImpl *gui, OSystem *system, Graphics::Surface *from, Common::Rect bounds, MacDialogWindowStyle windowStyle, MacDialogMenuStyle menuStyle) : _gui(gui), _system(system), _from(from), _bounds(bounds) {
+	// Only apply menu style if the menu is open.
+	Graphics::MacMenu *menu = _gui->_windowManager->getMenu();
+
+	if (!menu->_active)
+		menuStyle = kMenuStyleNone;
+
 	_black = _gui->getBlack();
 	_white = _gui->getWhite();
 
@@ -56,7 +62,7 @@ MacGuiImpl::MacDialogWindow::MacDialogWindow(MacGuiImpl *gui, OSystem *system, G
 	_backup->create(bounds.width(), bounds.height(), Graphics::PixelFormat::createFormatCLUT8());
 	_backup->copyRectToSurface(*_from, 0, 0, bounds);
 
-	_margin = (style == kStyleNormal) ? 6 : 4;
+	_margin = (windowStyle == kWindowStyleNormal) ? 6 : 4;
 
 	_surface = _from->getSubArea(bounds);
 	bounds.grow(-_margin);
@@ -70,7 +76,7 @@ MacGuiImpl::MacDialogWindow::MacDialogWindow(MacGuiImpl *gui, OSystem *system, G
 	r.grow(-1);
 	s->fillRect(r, _white);
 
-	if (style == kStyleNormal) {
+	if (windowStyle == kWindowStyleNormal) {
 		int growths[] = { 1, -3, -1 };
 
 		for (int i = 0; i < ARRAYSIZE(growths); i++) {
@@ -81,7 +87,7 @@ MacGuiImpl::MacDialogWindow::MacDialogWindow(MacGuiImpl *gui, OSystem *system, G
 			s->vLine(r.left, r.top + 1, r.bottom - 2, _black);
 			s->vLine(r.right - 1, r.top + 1, r.bottom - 2, _black);
 		}
-	} else if (style == kStyleRounded) {
+	} else if (windowStyle == kWindowStyleRounded) {
 		r.grow(1);
 
 		for (int i = 0; i < 2; i++) {
@@ -97,16 +103,40 @@ MacGuiImpl::MacDialogWindow::MacDialogWindow(MacGuiImpl *gui, OSystem *system, G
 		}
 	}
 
-	// The menu bar isn't part of the Mac screen. We copy it to the Mac
-	// screen so that the beam cursor is correctly drawn if it ever moves
-	// that far up. There's no reason for it to, but it can happen.
+	if (menuStyle != kMenuStyleNone) {
+		// The menu bar isn't part of the Mac screen. We copy it to the
+		// Mac screen so that the beam cursor is correctly drawn if it
+		// ever moves that far up. There's no reason for it to, but it
+		// can happen.
 
-	Graphics::Surface *screen = _gui->surface();
-	Graphics::Surface *realScreen = _system->lockScreen();
+		Graphics::Surface *screen = _gui->surface();
+		Graphics::Surface *realScreen = _system->lockScreen();
+
+		// On a real Mac, the menu stays interactable. But the only
+		// thing that is actually used for is the Edit menu, which we
+		// don't implement. In ScummVM, the menu bar is just a drawing
+		// at the point, so we can retouch it to look correct.
+
+		if (menuStyle == kMenuStyleDisabled) {
+			for (int y = 0; y < 19; y++) {
+				for (int x = 5; x < 635; x++) {
+					if (((x + y) & 1) == 0)
+						realScreen->setPixel(x, y, _white);
+				}
+			}
+		} else if (menuStyle == kMenuStyleApple) {
+			for (int y = 1; y < 19; y++) {
+				for (int x = 10; x < 38; x++) {
+					uint32 color = realScreen->getPixel(x, y);
+					realScreen->setPixel(x, y, _gui->_windowManager->inverter(color));
+				}
+			}
+		}
 
-	screen->copyRectToSurface(*realScreen, 0, 0, Common::Rect(0, 0, 640, 19));
+		screen->copyRectToSurface(*realScreen, 0, 0, Common::Rect(0, 0, 640, 19));
 
-	_system->unlockScreen();
+		_system->unlockScreen();
+	}
 }
 
 MacGuiImpl::MacDialogWindow::~MacDialogWindow() {
diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 6e5fdb04f4e..f2020877b4a 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -631,7 +631,7 @@ Graphics::Surface *MacGuiImpl::loadPict(int id) {
 // Window handling
 // ---------------------------------------------------------------------------
 
-MacGuiImpl::MacDialogWindow *MacGuiImpl::createWindow(Common::Rect bounds, MacDialogWindowStyle style) {
+MacGuiImpl::MacDialogWindow *MacGuiImpl::createWindow(Common::Rect bounds, MacDialogWindowStyle windowStyle, MacDialogMenuStyle menuStyle) {
 	if (bounds.left < 0 || bounds.top < 0 || bounds.right >= 640 || bounds.bottom >= 400) {
 		// This happens with the Last Crusade file dialogs.
 		bounds.moveTo((640 - bounds.width()) / 2, 27);
@@ -644,7 +644,7 @@ MacGuiImpl::MacDialogWindow *MacGuiImpl::createWindow(Common::Rect bounds, MacDi
 
 	bounds.translate(0, 2 * _vm->_macScreenDrawOffset);
 
-	return new MacDialogWindow(this, _system, _surface, bounds, style);
+	return new MacDialogWindow(this, _system, _surface, bounds, windowStyle, menuStyle);
 }
 
 Common::String MacGuiImpl::getDialogString(Common::SeekableReadStream *res, int len) {
@@ -1079,7 +1079,7 @@ void MacGuiImpl::drawBanner(char *message) {
 
 	_bannerWindow = createWindow(
 		Common::Rect(70, 189, 570, 211),
-		kStyleRounded);
+		kWindowStyleRounded, kMenuStyleNone);
 	const Graphics::Font *font = getFont(_vm->_game.id == GID_INDY3 ? kIndy3FontMedium : kLoomFontMedium);
 
 	Graphics::Surface *s = _bannerWindow->innerSurface();
diff --git a/engines/scumm/macgui/macgui_impl.h b/engines/scumm/macgui/macgui_impl.h
index fe41bf034b8..8d6eeea999e 100644
--- a/engines/scumm/macgui/macgui_impl.h
+++ b/engines/scumm/macgui/macgui_impl.h
@@ -178,8 +178,14 @@ protected:
 	};
 
 	enum MacDialogWindowStyle {
-		kStyleNormal,
-		kStyleRounded
+		kWindowStyleNormal,
+		kWindowStyleRounded
+	};
+
+	enum MacDialogMenuStyle {
+		kMenuStyleNone,
+		kMenuStyleDisabled,
+		kMenuStyleApple
 	};
 
 	MacGuiImpl::DelayStatus delay(uint32 ms = 0);
@@ -596,7 +602,7 @@ public:
 		OSystem *_system;
 		MacGuiImpl *_gui;
 
-		MacDialogWindow(MacGuiImpl *gui, OSystem *system, Graphics::Surface *from, Common::Rect bounds, MacDialogWindowStyle style = kStyleNormal);
+		MacDialogWindow(MacGuiImpl *gui, OSystem *system, Graphics::Surface *from, Common::Rect bounds, MacDialogWindowStyle windowStyle = kWindowStyleNormal, MacDialogMenuStyle menuStyle = kMenuStyleDisabled);
 		~MacDialogWindow();
 
 		Graphics::Surface *surface() { return &_surface; }
@@ -702,7 +708,7 @@ public:
 	virtual void initTextAreaForActor(Actor *a, byte color) {}
 	virtual void printCharToTextArea(int chr, int x, int y, int color) {}
 
-	MacDialogWindow *createWindow(Common::Rect bounds, MacDialogWindowStyle style = kStyleNormal);
+	MacDialogWindow *createWindow(Common::Rect bounds, MacDialogWindowStyle style = kWindowStyleNormal, MacDialogMenuStyle menuStyle = kMenuStyleDisabled);
 	MacDialogWindow *createDialog(int dialogId);
 	void drawBanner(char *message);
 	void undrawBanner();
diff --git a/engines/scumm/macgui/macgui_indy3.cpp b/engines/scumm/macgui/macgui_indy3.cpp
index 75d0bf6d970..2f7c889eef2 100644
--- a/engines/scumm/macgui/macgui_indy3.cpp
+++ b/engines/scumm/macgui/macgui_indy3.cpp
@@ -1120,7 +1120,7 @@ void MacIndy3Gui::runAboutDialog() {
 	int y = (400 - height) / 2;
 
 	Common::Rect bounds(x, y, x + width, y + height);
-	MacDialogWindow *window = createWindow(bounds);
+	MacDialogWindow *window = createWindow(bounds, kWindowStyleNormal, kMenuStyleApple);
 	Graphics::Surface *pict = loadPict(2000);
 
 	// For the background of the sprites to match the background of the
diff --git a/engines/scumm/macgui/macgui_loom.cpp b/engines/scumm/macgui/macgui_loom.cpp
index 38f2387f284..1a87ceed4d9 100644
--- a/engines/scumm/macgui/macgui_loom.cpp
+++ b/engines/scumm/macgui/macgui_loom.cpp
@@ -168,7 +168,7 @@ void MacLoomGui::runAboutDialog() {
 	int y = (400 - height) / 2;
 
 	Common::Rect bounds(x, y, x + width, y + height);
-	MacDialogWindow *window = createWindow(bounds);
+	MacDialogWindow *window = createWindow(bounds, kWindowStyleNormal, kMenuStyleApple);
 	Graphics::Surface *lucasFilm = loadPict(5000);
 	Graphics::Surface *loom = loadPict(5001);
 
diff --git a/engines/scumm/macgui/macgui_v5.cpp b/engines/scumm/macgui/macgui_v5.cpp
index 36a73a6842e..00e401afeab 100644
--- a/engines/scumm/macgui/macgui_v5.cpp
+++ b/engines/scumm/macgui/macgui_v5.cpp
@@ -162,7 +162,7 @@ void MacV5Gui::runAboutDialog() {
 	int y = (400 - height) / 2;
 
 	Common::Rect bounds(x, y, x + width, y + height);
-	MacDialogWindow *window = createWindow(bounds);
+	MacDialogWindow *window = createWindow(bounds, kWindowStyleNormal, kMenuStyleApple);
 
 	switch (_vm->_game.id) {
 	case GID_MONKEY:


Commit: b48c875817751985b0997d5d5b55295620e2c0c6
    https://github.com/scummvm/scummvm/commit/b48c875817751985b0997d5d5b55295620e2c0c6
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Minor cosmetic fixes for the menu

When pausing the game from the menu, remove the menu before displaying
the pause message. When opening the Loom drafts inventory from the Apple
menu, use the Apple menu style for it.

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/macgui/macgui_loom.cpp


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index f2020877b4a..daaf40ccc6d 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -337,6 +337,8 @@ bool MacGuiImpl::handleMenu(int id, Common::String &name) {
 
 	case 203:	// Pause
 		if (!_vm->_messageBannerActive) {
+			menu->closeMenu();
+
 			if (_vm->_game.version == 3)
 				_vm->mac_showOldStyleBannerAndPause(_vm->getGUIString(gsPause), -1);
 			else
diff --git a/engines/scumm/macgui/macgui_loom.cpp b/engines/scumm/macgui/macgui_loom.cpp
index 1a87ceed4d9..cc812a39fdd 100644
--- a/engines/scumm/macgui/macgui_loom.cpp
+++ b/engines/scumm/macgui/macgui_loom.cpp
@@ -416,7 +416,7 @@ void MacLoomGui::runDraftsInventory() {
 	const char *notes = "cdefgabC";
 
 	// ACT 1: Draw the Mac dialog window
-	MacGuiImpl::MacDialogWindow *window = createWindow(Common::Rect(110, 20, 540, 252));
+	MacGuiImpl::MacDialogWindow *window = createWindow(Common::Rect(110, 20, 540, 252), kWindowStyleNormal, kMenuStyleApple);
 	const Graphics::Font *font = getFont(kSystemFont);
 
 	Graphics::Surface *s = window->innerSurface();


Commit: cc9624ec3c8c91632880fad1d889154551a4f121
    https://github.com/scummvm/scummvm/commit/cc9624ec3c8c91632880fad1d889154551a4f121
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Fix Open dialog regression

We use the widget index to refer to widgets (not ideal), and after
rewriting the fake widgets the index for the file list changed. So it
was trying to get the save file from the wrong widget.

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index daaf40ccc6d..8f4c858df82 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -838,10 +838,10 @@ bool MacGuiImpl::runOpenDialog(int &saveSlotToHandle) {
 	while (!_vm->shouldQuit()) {
 		int clicked = window->runDialog(deferredActionsIds);
 
-		if (clicked == 0 || clicked == 6) {
+		if (clicked == 0 || clicked == 4) {
 			saveSlotToHandle =
-				window->getWidgetValue(6) < ARRAYSIZE(slotIds) ?
-				slotIds[window->getWidgetValue(6)] : -1;
+				window->getWidgetValue(4) < ARRAYSIZE(slotIds) ?
+				slotIds[window->getWidgetValue(4)] : -1;
 			ret = true;
 			break;
 		}


Commit: 5afeb4854e5a2d85174fc337286c880f1b127623
    https://github.com/scummvm/scummvm/commit/5afeb4854e5a2d85174fc337286c880f1b127623
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: GFX: Remove dissolve effect from Mac versions

This should now match the original, and fix some nasty
glitches.

Changed paths:
    engines/scumm/gfx.cpp


diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 0faf8321e2b..5d35500af48 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -4603,6 +4603,10 @@ void ScummEngine::transitionEffect(int a) {
  * dissolveEffect(virtsrc[0].width, 1) produces a line-by-line dissolve
  */
 void ScummEngine::dissolveEffect(int width, int height) {
+	// Apparently Mac versions discarded this effect
+	if (_macScreen && _macGui)
+		return;
+
 	VirtScreen *vs = &_virtscr[kMainVirtScreen];
 	int *offsets;
 	int blitsBeforeRefresh, blits, blitsToFreeze;


Commit: 74c57ebc4ef02e6b61f4a396e86b0009a17e750a
    https://github.com/scummvm/scummvm/commit/74c57ebc4ef02e6b61f4a396e86b0009a17e750a
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Make standard open/close dialogs more robust

Widget IDs are now assigned immediately when adding a widget to a
dialog, and we no longer hard-code widget IDs for those dialogs.

Changed paths:
    engines/scumm/macgui/macgui_dialogwindow.cpp
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/macgui/macgui_impl.h


diff --git a/engines/scumm/macgui/macgui_dialogwindow.cpp b/engines/scumm/macgui/macgui_dialogwindow.cpp
index 69c6ccf1f97..fcb8289bd70 100644
--- a/engines/scumm/macgui/macgui_dialogwindow.cpp
+++ b/engines/scumm/macgui/macgui_dialogwindow.cpp
@@ -202,39 +202,44 @@ int MacGuiImpl::MacDialogWindow::findWidget(int x, int y) const {
 	return -1;
 }
 
+void MacGuiImpl::MacDialogWindow::addWidget(MacWidget *widget) {
+	widget->setId(_widgets.size());
+	_widgets.push_back(widget);
+}
+
 MacGuiImpl::MacButton *MacGuiImpl::MacDialogWindow::addButton(Common::Rect bounds, Common::String text, bool enabled) {
 	MacGuiImpl::MacButton *button = new MacButton(this, bounds, text, enabled);
-	_widgets.push_back(button);
+	addWidget(button);
 	return button;
 }
 
 MacGuiImpl::MacCheckbox *MacGuiImpl::MacDialogWindow::addCheckbox(Common::Rect bounds, Common::String text, bool enabled) {
 	MacGuiImpl::MacCheckbox *checkbox = new MacCheckbox(this, bounds, text, enabled);
-	_widgets.push_back(checkbox);
+	addWidget(checkbox);
 	return checkbox;
 }
 
 MacGuiImpl::MacStaticText *MacGuiImpl::MacDialogWindow::addStaticText(Common::Rect bounds, Common::String text, bool enabled, Graphics::TextAlign alignment) {
 	MacGuiImpl::MacStaticText *staticText = new MacStaticText(this, bounds, text, enabled, alignment);
-	_widgets.push_back(staticText);
+	addWidget(staticText);
 	return staticText;
 }
 
 MacGuiImpl::MacEditText *MacGuiImpl::MacDialogWindow::addEditText(Common::Rect bounds, Common::String text, bool enabled) {
 	MacGuiImpl::MacEditText *editText = new MacEditText(this, bounds, text, enabled);
-	_widgets.push_back(editText);
+	addWidget(editText);
 	return editText;
 }
 
 MacGuiImpl::MacPicture *MacGuiImpl::MacDialogWindow::addPicture(Common::Rect bounds, int id, bool enabled) {
 	MacGuiImpl::MacPicture *picture = new MacPicture(this, bounds, id, false);
-	_widgets.push_back(picture);
+	addWidget(picture);
 	return picture;
 }
 
 MacGuiImpl::MacSlider *MacGuiImpl::MacDialogWindow::addSlider(int x, int y, int h, int minValue, int maxValue, int pageSize, bool enabled) {
 	MacGuiImpl::MacSlider *slider = new MacSlider(this, Common::Rect(x, y, x + 16, y + h), minValue, maxValue, pageSize, enabled);
-	_widgets.push_back(slider);
+	addWidget(slider);
 	return slider;
 }
 
@@ -246,20 +251,20 @@ MacGuiImpl::MacPictureSlider *MacGuiImpl::MacDialogWindow::addPictureSlider(int
 	handle->setVisible(false);
 
 	MacGuiImpl::MacPictureSlider *slider = new MacPictureSlider(this, background, handle, enabled, minX, maxX, minValue, maxValue, leftMargin, rightMargin);
-	_widgets.push_back(slider);
+	addWidget(slider);
 	return slider;
 }
 
-void MacGuiImpl::MacDialogWindow::markRectAsDirty(Common::Rect r) {
-	_dirtyRects.push_back(r);
-}
-
 MacGuiImpl::MacListBox *MacGuiImpl::MacDialogWindow::addListBox(Common::Rect bounds, Common::StringArray texts, bool enabled, bool contentUntouchable) {
 	MacGuiImpl::MacListBox *listBox = new MacListBox(this, bounds, texts, enabled, contentUntouchable);
-	_widgets.push_back(listBox);
+	addWidget(listBox);
 	return listBox;
 }
 
+void MacGuiImpl::MacDialogWindow::markRectAsDirty(Common::Rect r) {
+	_dirtyRects.push_back(r);
+}
+
 void MacGuiImpl::MacDialogWindow::drawBeamCursor() {
 	int x0 = _beamCursorPos.x - _beamCursorHotspotX;
 	int y0 = _beamCursorPos.y - _beamCursorHotspotY;
@@ -405,8 +410,6 @@ int MacGuiImpl::MacDialogWindow::runDialog(Common::Array<int> &deferredActionIds
 		Common::Rect windowBounds(_innerSurface.w, _innerSurface.h);
 
 		for (uint i = 0; i < _widgets.size(); i++) {
-			_widgets[i]->setId(i);
-
 			if (_widgets[i]->isVisible()) {
 				_widgets[i]->setRedraw(true);
 				_widgets[i]->draw();
diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 8f4c858df82..c6aa341712a 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -812,8 +812,8 @@ bool MacGuiImpl::runOpenDialog(int &saveSlotToHandle) {
 
 	MacDialogWindow *window = createWindow(bounds);
 
-	window->addButton(Common::Rect(254, 137, 334, 157), "Open", true);
-	window->addButton(Common::Rect(254, 106, 334, 126), "Cancel", true);
+	MacButton *openButton = window->addButton(Common::Rect(254, 137, 334, 157), "Open", true);
+	MacButton *cancelButton = window->addButton(Common::Rect(254, 106, 334, 126), "Cancel", true);
 	window->addButton(Common::Rect(254, 62, 334, 82), "Desktop", false);
 	window->addButton(Common::Rect(254, 34, 334, 54), "Eject", false);
 
@@ -827,9 +827,9 @@ bool MacGuiImpl::runOpenDialog(int &saveSlotToHandle) {
 	drawFakePathList(window, Common::Rect(14, 8, 232, 27), name().c_str());
 	drawFakeDriveLabel(window, Common::Rect(232, 10, 344, 28), "ScummVM");
 
-	window->addListBox(Common::Rect(14, 31, 232, 161), savegameNames, true);
+	MacListBox *listBox = window->addListBox(Common::Rect(14, 31, 232, 161), savegameNames, true);
 
-	window->setDefaultWidget(0);
+	window->setDefaultWidget(openButton->getId());
 
 	// When quitting, the default action is to not open a saved game
 	bool ret = false;
@@ -838,15 +838,15 @@ bool MacGuiImpl::runOpenDialog(int &saveSlotToHandle) {
 	while (!_vm->shouldQuit()) {
 		int clicked = window->runDialog(deferredActionsIds);
 
-		if (clicked == 0 || clicked == 4) {
+		if (clicked == openButton->getId() || clicked == listBox->getId()) {
 			saveSlotToHandle =
-				window->getWidgetValue(4) < ARRAYSIZE(slotIds) ?
-				slotIds[window->getWidgetValue(4)] : -1;
+				listBox->getValue() < ARRAYSIZE(slotIds) ?
+				slotIds[listBox->getValue()] : -1;
 			ret = true;
 			break;
 		}
 
-		if (clicked == 1)
+		if (clicked == cancelButton->getId())
 			break;
 	}
 
@@ -861,8 +861,8 @@ bool MacGuiImpl::runSaveDialog(int &saveSlotToHandle, Common::String &saveName)
 
 	MacDialogWindow *window = createWindow(bounds);
 
-	window->addButton(Common::Rect(254, 163, 334, 183), "Save", true);
-	window->addButton(Common::Rect(254, 132, 334, 152), "Cancel", true);
+	MacButton *saveButton = window->addButton(Common::Rect(254, 163, 334, 183), "Save", true);
+	MacButton *cancelButton = window->addButton(Common::Rect(254, 132, 334, 152), "Cancel", true);
 	window->addButton(Common::Rect(254, 90, 334, 110), "New", false);
 	window->addButton(Common::Rect(254, 62, 334, 82), "Desktop", false);
 	window->addButton(Common::Rect(254, 34, 334, 54), "Eject", false);
@@ -899,7 +899,7 @@ bool MacGuiImpl::runSaveDialog(int &saveSlotToHandle, Common::String &saveName)
 
 	font->drawString(s, saveGameFileAsResStr, 14, 138, 218, black, Graphics::kTextAlignLeft, 4);
 
-	window->setDefaultWidget(0);
+	window->setDefaultWidget(saveButton->getId());
 	editText->selectAll();
 
 	// When quitting, the default action is to not open a saved game
@@ -909,25 +909,22 @@ bool MacGuiImpl::runSaveDialog(int &saveSlotToHandle, Common::String &saveName)
 	while (!_vm->shouldQuit()) {
 		int clicked = window->runDialog(deferredActionsIds);
 
-		if (clicked == 0) {
+		if (clicked == saveButton->getId()) {
 			ret = true;
 			saveName = editText->getText();
 			saveSlotToHandle = firstAvailableSlot;
 			break;
 		}
 
-		if (clicked == 1)
+		if (clicked == cancelButton->getId())
 			break;
 
 		if (clicked == -2) {
 			// Cycle through deferred actions
 			for (uint i = 0; i < deferredActionsIds.size(); i++) {
-				// Edit text widget
-				if (deferredActionsIds[i] == 4) {
-					MacGuiImpl::MacWidget *wid = window->getWidget(deferredActionsIds[i]);
-
+				if (deferredActionsIds[i] == editText->getId()) {
 					// Disable "Save" button when text is empty
-					window->getWidget(0)->setEnabled(!wid->getText().empty());
+					saveButton->setEnabled(!editText->getText().empty());
 				}
 			}
 		}
diff --git a/engines/scumm/macgui/macgui_impl.h b/engines/scumm/macgui/macgui_impl.h
index 8d6eeea999e..d31a29a07c1 100644
--- a/engines/scumm/macgui/macgui_impl.h
+++ b/engines/scumm/macgui/macgui_impl.h
@@ -598,6 +598,8 @@ public:
 
 		void copyToScreen(Graphics::Surface *s = nullptr) const;
 
+		void addWidget(MacWidget *widget);
+
 	public:
 		OSystem *_system;
 		MacGuiImpl *_gui;


Commit: 95ad13f67830b9a1b803c606de956363b76df5d7
    https://github.com/scummvm/scummvm/commit/95ad13f67830b9a1b803c606de956363b76df5d7
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Eliminate more hard-coded widget IDs

Instead of referring to widgets by their ID (really just an index into
an array), now we ask the dialog for the Nth instance of a widget of a
particular type. So we still need to know in which order buttons and
such are defined, but it should still be a lot easier to read and a lot
less prone to error.

Changed paths:
    engines/scumm/macgui/macgui_dialogwindow.cpp
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/macgui/macgui_impl.h
    engines/scumm/macgui/macgui_indy3.cpp
    engines/scumm/macgui/macgui_loom.cpp
    engines/scumm/macgui/macgui_v5.cpp


diff --git a/engines/scumm/macgui/macgui_dialogwindow.cpp b/engines/scumm/macgui/macgui_dialogwindow.cpp
index fcb8289bd70..780611e5447 100644
--- a/engines/scumm/macgui/macgui_dialogwindow.cpp
+++ b/engines/scumm/macgui/macgui_dialogwindow.cpp
@@ -202,44 +202,45 @@ int MacGuiImpl::MacDialogWindow::findWidget(int x, int y) const {
 	return -1;
 }
 
-void MacGuiImpl::MacDialogWindow::addWidget(MacWidget *widget) {
+void MacGuiImpl::MacDialogWindow::addWidget(MacWidget *widget, MacWidgetType type) {
 	widget->setId(_widgets.size());
+	widget->setType(type);
 	_widgets.push_back(widget);
 }
 
 MacGuiImpl::MacButton *MacGuiImpl::MacDialogWindow::addButton(Common::Rect bounds, Common::String text, bool enabled) {
 	MacGuiImpl::MacButton *button = new MacButton(this, bounds, text, enabled);
-	addWidget(button);
+	addWidget(button, kWidgetButton);
 	return button;
 }
 
 MacGuiImpl::MacCheckbox *MacGuiImpl::MacDialogWindow::addCheckbox(Common::Rect bounds, Common::String text, bool enabled) {
 	MacGuiImpl::MacCheckbox *checkbox = new MacCheckbox(this, bounds, text, enabled);
-	addWidget(checkbox);
+	addWidget(checkbox, kWidgetCheckbox);
 	return checkbox;
 }
 
 MacGuiImpl::MacStaticText *MacGuiImpl::MacDialogWindow::addStaticText(Common::Rect bounds, Common::String text, bool enabled, Graphics::TextAlign alignment) {
 	MacGuiImpl::MacStaticText *staticText = new MacStaticText(this, bounds, text, enabled, alignment);
-	addWidget(staticText);
+	addWidget(staticText, kWidgetStaticText);
 	return staticText;
 }
 
 MacGuiImpl::MacEditText *MacGuiImpl::MacDialogWindow::addEditText(Common::Rect bounds, Common::String text, bool enabled) {
 	MacGuiImpl::MacEditText *editText = new MacEditText(this, bounds, text, enabled);
-	addWidget(editText);
+	addWidget(editText, kWidgetEditText);
 	return editText;
 }
 
 MacGuiImpl::MacPicture *MacGuiImpl::MacDialogWindow::addPicture(Common::Rect bounds, int id, bool enabled) {
 	MacGuiImpl::MacPicture *picture = new MacPicture(this, bounds, id, false);
-	addWidget(picture);
+	addWidget(picture, kWidgetPicture);
 	return picture;
 }
 
 MacGuiImpl::MacSlider *MacGuiImpl::MacDialogWindow::addSlider(int x, int y, int h, int minValue, int maxValue, int pageSize, bool enabled) {
 	MacGuiImpl::MacSlider *slider = new MacSlider(this, Common::Rect(x, y, x + 16, y + h), minValue, maxValue, pageSize, enabled);
-	addWidget(slider);
+	addWidget(slider, kWidgetSlider);
 	return slider;
 }
 
@@ -251,13 +252,13 @@ MacGuiImpl::MacPictureSlider *MacGuiImpl::MacDialogWindow::addPictureSlider(int
 	handle->setVisible(false);
 
 	MacGuiImpl::MacPictureSlider *slider = new MacPictureSlider(this, background, handle, enabled, minX, maxX, minValue, maxValue, leftMargin, rightMargin);
-	addWidget(slider);
+	addWidget(slider, kWidgetPictureSlider);
 	return slider;
 }
 
 MacGuiImpl::MacListBox *MacGuiImpl::MacDialogWindow::addListBox(Common::Rect bounds, Common::StringArray texts, bool enabled, bool contentUntouchable) {
 	MacGuiImpl::MacListBox *listBox = new MacListBox(this, bounds, texts, enabled, contentUntouchable);
-	addWidget(listBox);
+	addWidget(listBox, kWidgetListBox);
 	return listBox;
 }
 
@@ -663,6 +664,18 @@ void MacGuiImpl::MacDialogWindow::updateCursor() {
 	}
 }
 
+MacGuiImpl::MacWidget *MacGuiImpl::MacDialogWindow::getWidget(MacWidgetType type, int nr) const {
+	for (uint i = 0; i < _widgets.size(); i++) {
+		if (_widgets[i]->getType() == type) {
+			if (nr == 0)
+				return _widgets[i];
+			nr--;
+		}
+	}
+
+	return nullptr;
+}
+
 void MacGuiImpl::MacDialogWindow::drawSprite(const Graphics::Surface *sprite, int x, int y) {
 	_innerSurface.copyRectToSurface(*sprite, x, y, Common::Rect(sprite->w, sprite->h));
 	markRectAsDirty(Common::Rect(x, y, x + sprite->w, y + sprite->h));
diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index c6aa341712a..1286ed0f60d 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -829,7 +829,7 @@ bool MacGuiImpl::runOpenDialog(int &saveSlotToHandle) {
 
 	MacListBox *listBox = window->addListBox(Common::Rect(14, 31, 232, 161), savegameNames, true);
 
-	window->setDefaultWidget(openButton->getId());
+	window->setDefaultWidget(openButton);
 
 	// When quitting, the default action is to not open a saved game
 	bool ret = false;
@@ -899,7 +899,7 @@ bool MacGuiImpl::runSaveDialog(int &saveSlotToHandle, Common::String &saveName)
 
 	font->drawString(s, saveGameFileAsResStr, 14, 138, 218, black, Graphics::kTextAlignLeft, 4);
 
-	window->setDefaultWidget(saveButton->getId());
+	window->setDefaultWidget(saveButton);
 	editText->selectAll();
 
 	// When quitting, the default action is to not open a saved game
@@ -972,9 +972,13 @@ bool MacGuiImpl::runOkCancelDialog(Common::String text) {
 	window->setDefaultWidget(0);
 	window->addSubstitution(text);
 
-	MacStaticText *widget = (MacStaticText *)window->getWidget(2);
+	MacStaticText *widget = (MacStaticText *)window->getWidget(kWidgetStaticText);
 	widget->setWordWrap(true);
 
+	MacButton *buttonOk = (MacButton *)window->getWidget(kWidgetButton, 0);
+	MacButton *buttonCancel = (MacButton *)window->getWidget(kWidgetButton, 1);
+
+
 	// When quitting, the default action is to quit
 	bool ret = true;
 
@@ -983,10 +987,10 @@ bool MacGuiImpl::runOkCancelDialog(Common::String text) {
 	while (!_vm->shouldQuit()) {
 		int clicked = window->runDialog(deferredActionsIds);
 
-		if (clicked == 0)
+		if (clicked == buttonOk->getId())
 			break;
 
-		if (clicked == 1) {
+		if (clicked == buttonCancel->getId()) {
 			ret = false;
 			break;
 		}
diff --git a/engines/scumm/macgui/macgui_impl.h b/engines/scumm/macgui/macgui_impl.h
index d31a29a07c1..e705447614e 100644
--- a/engines/scumm/macgui/macgui_impl.h
+++ b/engines/scumm/macgui/macgui_impl.h
@@ -109,6 +109,18 @@ public:
 		int numStrings;
 	};
 
+	enum MacWidgetType {
+		kWidgetUnknown,
+		kWidgetButton,
+		kWidgetCheckbox,
+		kWidgetStaticText,
+		kWidgetEditText,
+		kWidgetPicture,
+		kWidgetSlider,
+		kWidgetListBox,
+		kWidgetPictureSlider
+	};
+
 protected:
 	ScummEngine *_vm = nullptr;
 	OSystem *_system = nullptr;
@@ -236,6 +248,7 @@ public:
 		uint32 _white;
 
 		int _id = -1;
+		MacWidgetType _type = kWidgetUnknown;
 
 		bool _fullRedraw = false;
 
@@ -252,6 +265,9 @@ public:
 		void setId(int id) { _id = id; }
 		int getId() const { return _id; }
 
+		void setType(MacWidgetType type) { _type = type; }
+		MacWidgetType getType() { return _type; }
+
 		// Visibility never changes after initialization, so it does
 		// not trigger a redraw.
 		void setVisible(bool visible) { _visible = visible; }
@@ -598,7 +614,7 @@ public:
 
 		void copyToScreen(Graphics::Surface *s = nullptr) const;
 
-		void addWidget(MacWidget *widget);
+		void addWidget(MacWidget *widget, MacWidgetType type);
 
 	public:
 		OSystem *_system;
@@ -616,8 +632,9 @@ public:
 		int runDialog(Common::Array<int> &deferredActionIds);
 		void updateCursor();
 
-		MacWidget *getWidget(int nr) const { return _widgets[nr]; }
-		void setDefaultWidget(int nr) { _defaultWidget = _widgets[nr]; }
+		MacWidget *getWidget(MacWidgetType type, int nr = 0) const;
+
+		void setDefaultWidget(MacWidget *widget) { _defaultWidget = widget; }
 		MacWidget *getDefaultWidget() const { return _defaultWidget; }
 
 		void setFocusedWidget(int x, int y);
@@ -626,13 +643,7 @@ public:
 		Common::Point getFocusClick() const { return _focusClick; }
 		Common::Point getMousePos() const { return _mousePos; }
 
-		void setWidgetEnabled(int nr, bool enabled) { _widgets[nr]->setEnabled(enabled); }
-		bool isWidgetEnabled(int nr) const { return _widgets[nr]->isEnabled(); }
-		void setWidgetVisible(int nr, bool visible) { _widgets[nr]->setVisible(visible); }
-		int getWidgetValue(int nr) const { return _widgets[nr]->getValue(); }
-		void setWidgetValue(int nr, int value) { _widgets[nr]->setValue(value); }
 		int findWidget(int x, int y) const;
-		void redrawWidget(int nr) { _widgets[nr]->setRedraw(true); }
 
 		MacGuiImpl::MacButton *addButton(Common::Rect bounds, Common::String text, bool enabled);
 		MacGuiImpl::MacCheckbox *addCheckbox(Common::Rect bounds, Common::String text, bool enabled);
diff --git a/engines/scumm/macgui/macgui_indy3.cpp b/engines/scumm/macgui/macgui_indy3.cpp
index 2f7c889eef2..b3920af77b2 100644
--- a/engines/scumm/macgui/macgui_indy3.cpp
+++ b/engines/scumm/macgui/macgui_indy3.cpp
@@ -1380,7 +1380,9 @@ bool MacIndy3Gui::runOpenDialog(int &saveSlotToHandle) {
 
 	drawFakePathList(window, Common::Rect(14, 18, 231, 37), "Indy Last Crusade");
 
-	MacGuiImpl::MacListBox *listBox = window->addListBox(Common::Rect(14, 41, 232, 187), savegameNames, true);
+	MacButton *saveButton = (MacButton *)window->getWidget(kWidgetButton, 0);
+	MacButton *cancelButton = (MacButton *)window->getWidget(kWidgetButton, 1);
+	MacListBox *listBox = window->addListBox(Common::Rect(14, 41, 232, 187), savegameNames, true);
 
 	// When quitting, the default action is to not open a saved game
 	bool ret = false;
@@ -1389,14 +1391,14 @@ bool MacIndy3Gui::runOpenDialog(int &saveSlotToHandle) {
 	while (!_vm->shouldQuit()) {
 		int clicked = window->runDialog(deferredActionsIds);
 
-		if (clicked == 0 || clicked == 12) {
+		if (clicked == saveButton->getId() || clicked == listBox->getId()) {
 			ret = true;
 			saveSlotToHandle =
 				listBox->getValue() < ARRAYSIZE(slotIds) ? slotIds[listBox->getValue()] : -1;
 			break;
 		}
 
-		if (clicked == 2)
+		if (clicked == cancelButton->getId())
 			break;
 	}
 
@@ -1447,28 +1449,29 @@ bool MacIndy3Gui::runSaveDialog(int &saveSlotToHandle, Common::String &saveName)
 	bool ret = false;
 	Common::Array<int> deferredActionsIds;
 
+	MacButton *saveButton = (MacButton *)window->getWidget(kWidgetButton, 0);
+	MacButton *cancelButton = (MacButton *)window->getWidget(kWidgetButton, 1);
+	MacEditText *editText = (MacEditText *)window->getWidget(kWidgetEditText);
+
 	while (!_vm->shouldQuit()) {
 		int clicked = window->runDialog(deferredActionsIds);
 
-		if (clicked == 0) {
+		if (clicked == saveButton->getId()) {
 			ret = true;
-			saveName = window->getWidget(6)->getText(); // Edit text widget
+			saveName = editText->getText();
 			saveSlotToHandle = firstAvailableSlot;
 			break;
 		}
 
-		if (clicked == 1)
+		if (clicked == cancelButton->getId())
 			break;
 
 		if (clicked == -2) {
 			// Cycle through deferred actions
 			for (uint i = 0; i < deferredActionsIds.size(); i++) {
-				// Edit text widget
-				if (deferredActionsIds[i] == 5) {
-					MacGuiImpl::MacWidget *wid = window->getWidget(deferredActionsIds[i]);
-
+				if (deferredActionsIds[i] == editText->getId()) {
 					// Disable "Save" button when text is empty
-					window->getWidget(0)->setEnabled(!wid->getText().empty());
+					saveButton->setEnabled(!editText->getText().empty());
 				}
 			}
 		}
@@ -1499,15 +1502,22 @@ bool MacIndy3Gui::runOptionsDialog() {
 
 	MacDialogWindow *window = createDialog(1000);
 
-	window->setWidgetValue(2, sound);
-	window->setWidgetValue(3, music);
-	window->setWidgetValue(8, scrolling);
+	MacButton *buttonOk = (MacButton *)window->getWidget(kWidgetButton, 0);
+	MacButton *buttonCancel = (MacButton *)window->getWidget(kWidgetButton, 1);
+
+	MacCheckbox *checkboxSound = (MacCheckbox *)window->getWidget(kWidgetCheckbox, 0);
+	MacCheckbox *checkboxMusic = (MacCheckbox *)window->getWidget(kWidgetCheckbox, 1);
+	MacCheckbox *checkboxScrolling = (MacCheckbox *)window->getWidget(kWidgetCheckbox, 2);
+
+	checkboxSound->setValue(sound);
+	checkboxMusic->setValue(music);
+	checkboxScrolling->setValue(scrolling);
 
 	if (!sound)
-		window->setWidgetEnabled(3, false);
+		checkboxMusic->setEnabled(false);
 
-	window->addPictureSlider(4, 5, true, 5, 105, 0, 9);
-	window->setWidgetValue(9, textSpeed);
+	MacPictureSlider *sliderTextSpeed = window->addPictureSlider(4, 5, true, 5, 105, 0, 9);
+	sliderTextSpeed->setValue(textSpeed);
 
 	window->addSubstitution(Common::String::format("%d", _vm->VAR(_vm->VAR_MACHINE_SPEED)));
 
@@ -1518,23 +1528,23 @@ bool MacIndy3Gui::runOptionsDialog() {
 	while (!_vm->shouldQuit()) {
 		int clicked = window->runDialog(deferredActionsIds);
 
-		if (clicked == 0) {
+		if (clicked == buttonOk->getId()) {
 			ret = true;
 			break;
 		}
 
-		if (clicked == 1)
+		if (clicked == buttonCancel->getId())
 			break;
 
-		if (clicked == 2)
-			window->setWidgetEnabled(3, window->getWidgetValue(2) != 0);
+		if (clicked == checkboxSound->getId())
+			checkboxMusic->setEnabled(checkboxSound->getValue() != 0);
 	}
 
 	if (ret) {
 		// Update settings
 
 		// TEXT SPEED
-		_vm->_defaultTextSpeed = CLIP<int>(window->getWidgetValue(9), 0, 9);
+		_vm->_defaultTextSpeed = CLIP<int>(sliderTextSpeed->getValue(), 0, 9);
 		ConfMan.setInt("original_gui_text_speed", _vm->_defaultTextSpeed);
 		_vm->setTalkSpeed(_vm->_defaultTextSpeed);
 
@@ -1542,8 +1552,8 @@ bool MacIndy3Gui::runOptionsDialog() {
 		// 0 - Sound&Music on
 		// 1 - Sound on, music off
 		// 2 - Sound&Music off
-		bool disableSound = window->getWidgetValue(2) == 0;
-		bool disableMusic = window->getWidgetValue(3) == 0;
+		bool disableSound = checkboxSound->getValue() == 0;
+		bool disableMusic = checkboxMusic->getValue() == 0;
 
 		_vm->_musicEngine->toggleMusic(!disableMusic);
 		_vm->_musicEngine->toggleSoundEffects(!disableSound);
@@ -1554,7 +1564,7 @@ bool MacIndy3Gui::runOptionsDialog() {
 		_vm->syncSoundSettings();
 
 		// SCROLLING ACTIVATION
-		_vm->_snapScroll = window->getWidgetValue(8) == 0;		
+		_vm->_snapScroll = checkboxScrolling->getValue() == 0;
 	}
 
 	delete window;
@@ -1573,6 +1583,11 @@ bool MacIndy3Gui::runIqPointsDialog() {
 
 	MacDialogWindow *window = createDialog((_vm->_renderMode == Common::kRenderMacintoshBW) ? 1001 : 1002);
 
+	MacButton *buttonOk = (MacButton *)window->getWidget(kWidgetButton, 0);
+	MacButton *buttonCancel = (MacButton *)window->getWidget(kWidgetButton, 1);
+
+	MacStaticText *textSeriesIQ = (MacStaticText *)window->getWidget(kWidgetStaticText, 2);
+
 	((ScummEngine_v4 *)_vm)->updateIQPoints();
 	window->addSubstitution(Common::String::format("%d", _vm->VAR(244)));
 	window->addSubstitution(Common::String::format("%d", _vm->VAR(245)));
@@ -1582,14 +1597,14 @@ bool MacIndy3Gui::runIqPointsDialog() {
 	while (!_vm->shouldQuit()) {
 		int clicked = window->runDialog(deferredActionsIds);
 
-		if (clicked == 0)
+		if (clicked == buttonOk->getId())
 			break;
 
-		if (clicked == 1) {
+		if (clicked == buttonCancel->getId()) {
 			if (!_vm->enhancementEnabled(kEnhUIUX) || runOkCancelDialog("Are you sure you want to reset the series IQ score?")) {
 				((ScummEngine_v4 *)_vm)->clearSeriesIQPoints();
 				window->replaceSubstitution(1, Common::String::format("%d", _vm->VAR(245)));
-				window->redrawWidget(4);
+				textSeriesIQ->setRedraw(true);
 			}
 		}
 	}
diff --git a/engines/scumm/macgui/macgui_loom.cpp b/engines/scumm/macgui/macgui_loom.cpp
index cc812a39fdd..c0fe37a8710 100644
--- a/engines/scumm/macgui/macgui_loom.cpp
+++ b/engines/scumm/macgui/macgui_loom.cpp
@@ -515,19 +515,27 @@ bool MacLoomGui::runOptionsDialog() {
 
 	MacDialogWindow *window = createDialog(1000);
 
-	window->setWidgetValue(2, sound);
-	window->setWidgetValue(3, music);
-	window->setWidgetValue(6, scrolling);
-	window->setWidgetValue(7, fullAnimation);
+	MacButton *buttonOk = (MacButton *)window->getWidget(kWidgetButton, 0);
+	MacButton *buttonCancel = (MacButton *)window->getWidget(kWidgetButton, 1);
+
+	MacCheckbox *checkboxSound = (MacCheckbox *)window->getWidget(kWidgetCheckbox, 0);
+	MacCheckbox *checkboxMusic = (MacCheckbox *)window->getWidget(kWidgetCheckbox, 1);
+	MacCheckbox *checkboxScrolling = (MacCheckbox *)window->getWidget(kWidgetCheckbox, 2);
+	MacCheckbox *checkboxFullAnimation = (MacCheckbox *)window->getWidget(kWidgetCheckbox, 3);
+
+	checkboxSound->setValue(sound);
+	checkboxMusic->setValue(music);
+	checkboxScrolling->setValue(scrolling);
+	checkboxFullAnimation->setValue(fullAnimation);
 
 	if (!sound)
-		window->setWidgetEnabled(3, false);
+		checkboxMusic->setEnabled(false);
 
-	window->addPictureSlider(4, 5, true, 5, 105, 0, 9);
-	window->setWidgetValue(11, textSpeed);
+	MacPictureSlider *sliderTextSpeed = window->addPictureSlider(4, 5, true, 5, 105, 0, 9);
+	sliderTextSpeed->setValue(textSpeed);
 
-	window->addPictureSlider(8, 9, true, 5, 69, 0, 2, 6, 4);
-	window->setWidgetValue(12, musicQualityOption);
+	MacPictureSlider *sliderMusicQuality = window->addPictureSlider(8, 9, true, 5, 69, 0, 2, 6, 4);
+	sliderMusicQuality->setValue(musicQualityOption);
 
 	// Machine rating
 	window->addSubstitution(Common::String::format("%d", _vm->VAR(53)));
@@ -539,23 +547,23 @@ bool MacLoomGui::runOptionsDialog() {
 	while (!_vm->shouldQuit()) {
 		int clicked = window->runDialog(deferredActionsIds);
 
-		if (clicked == 0) {
+		if (clicked == buttonOk->getId()) {
 			ret = true;
 			break;
 		}
 
-		if (clicked == 1)
+		if (clicked == buttonCancel->getId())
 			break;
 
-		if (clicked == 2)
-			window->setWidgetEnabled(3, window->getWidgetValue(2) != 0);
+		if (clicked == checkboxSound->getId())
+			checkboxMusic->setEnabled(checkboxSound->getValue() != 0);
 	}
 
 	if (ret) {
 		// Update settings
 
 		// TEXT SPEED
-		_vm->_defaultTextSpeed = CLIP<int>(window->getWidgetValue(11), 0, 9);
+		_vm->_defaultTextSpeed = CLIP<int>(sliderTextSpeed->getValue(), 0, 9);
 		ConfMan.setInt("original_gui_text_speed", _vm->_defaultTextSpeed);
 		_vm->setTalkSpeed(_vm->_defaultTextSpeed);
 
@@ -565,9 +573,9 @@ bool MacLoomGui::runOptionsDialog() {
 		// 2 - Sound&Music off
 		int musicVariableValue = 0;
 
-		if (window->getWidgetValue(2) == 0)
+		if (checkboxSound->getValue() == 0)
 			musicVariableValue = 2;
-		else if (window->getWidgetValue(2) == 1 && window->getWidgetValue(3) == 0)
+		else if (checkboxSound->getValue() == 1 && checkboxMusic->getValue() == 0)
 			musicVariableValue = 1;
 
 		_vm->_musicEngine->toggleMusic(musicVariableValue == 0);
@@ -576,16 +584,16 @@ bool MacLoomGui::runOptionsDialog() {
 		ConfMan.setBool("mute", musicVariableValue == 2);
 
 		// SCROLLING ACTIVATION
-		_vm->_snapScroll = window->getWidgetValue(6) == 0;
+		_vm->_snapScroll = checkboxScrolling->getValue() == 0;
 
 		if (_vm->VAR_CAMERA_FAST_X != 0xFF)
 			_vm->VAR(_vm->VAR_CAMERA_FAST_X) = _vm->_snapScroll;
 
 		// FULL ANIMATION ACTIVATION
-		_vm->VAR(_vm->VAR_MACHINE_SPEED) = window->getWidgetValue(7) == 1 ? 0 : 1;
+		_vm->VAR(_vm->VAR_MACHINE_SPEED) = checkboxFullAnimation->getValue() == 1 ? 0 : 1;
 
 		// MUSIC QUALITY SELECTOR
-		musicQuality = musicQuality * 3 + 1 + window->getWidgetValue(12);
+		musicQuality = musicQuality * 3 + 1 + sliderMusicQuality->getValue();
 		_vm->_musicEngine->setQuality(musicQuality);
 		ConfMan.setInt("mac_snd_quality", musicQuality);
 
diff --git a/engines/scumm/macgui/macgui_v5.cpp b/engines/scumm/macgui/macgui_v5.cpp
index 00e401afeab..b0fd471b4cc 100644
--- a/engines/scumm/macgui/macgui_v5.cpp
+++ b/engines/scumm/macgui/macgui_v5.cpp
@@ -805,17 +805,23 @@ bool MacV5Gui::runOptionsDialog() {
 
 	MacDialogWindow *window = createDialog(1000);
 
-	window->setWidgetValue(2, sound);
-	window->setWidgetValue(3, music);
+	MacButton *buttonOk = (MacButton *)window->getWidget(kWidgetButton, 0);
+	MacButton *buttonCancel = (MacButton *)window->getWidget(kWidgetButton, 1);
+
+	MacCheckbox *checkboxSound = (MacCheckbox *)window->getWidget(kWidgetCheckbox, 0);
+	MacCheckbox *checkboxMusic = (MacCheckbox *)window->getWidget(kWidgetCheckbox, 1);
+
+	checkboxSound->setValue(sound);
+	checkboxMusic->setValue(music);
 
 	if (!sound)
-		window->setWidgetEnabled(3, false);
+		checkboxMusic->setEnabled(false);
 
-	window->addPictureSlider(4, 5, true, 5, 105, 0, 9);
-	window->setWidgetValue(11, textSpeed);
+	MacPictureSlider *sliderTextSpeed = window->addPictureSlider(4, 5, true, 5, 105, 0, 9);
+	sliderTextSpeed->setValue(textSpeed);
 
-	window->addPictureSlider(8, 9, true, 5, 69, 0, 2, 6, 4);
-	window->setWidgetValue(12, musicQualityOption);
+	MacPictureSlider *sliderMusicQuality = window->addPictureSlider(8, 9, true, 5, 69, 0, 2, 6, 4);
+	sliderMusicQuality->setValue(musicQualityOption);
 
 	// When quitting, the default action is not to not apply options
 	bool ret = false;
@@ -824,17 +830,17 @@ bool MacV5Gui::runOptionsDialog() {
 	while (!_vm->shouldQuit()) {
 		int clicked = window->runDialog(deferredActionsIds);
 
-		if (clicked == 0) {
+		if (clicked == buttonOk->getId()) {
 			ret = true;
 			break;
 		}
 
-		if (clicked == 1)
+		if (clicked == buttonCancel->getId())
 			break;
 
-		if (clicked == 2) {
-			window->setWidgetEnabled(3, window->getWidgetValue(2) != 0);
-			window->setWidgetValue(3, window->getWidgetValue(2) != 0 ? 1 : 0);
+		if (clicked == checkboxSound->getId()) {
+			checkboxMusic->setEnabled(checkboxSound->getValue() != 0);
+			checkboxMusic->setValue(checkboxSound->getValue() != 0 ? 1 : 0);
 		}
 	}
 
@@ -842,18 +848,18 @@ bool MacV5Gui::runOptionsDialog() {
 		// Update settings
 
 		// TEXT SPEED
-		_vm->_defaultTextSpeed = CLIP<int>(window->getWidgetValue(11), 0, 9);
+		_vm->_defaultTextSpeed = CLIP<int>(sliderTextSpeed->getValue(), 0, 9);
 		ConfMan.setInt("original_gui_text_speed", _vm->_defaultTextSpeed);
 		_vm->setTalkSpeed(_vm->_defaultTextSpeed);
 
 		// SOUND&MUSIC ACTIVATION
-		_vm->_musicEngine->toggleMusic(window->getWidgetValue(2) != 0 && (window->getWidgetValue(2) != 1 || window->getWidgetValue(3) != 0));
-		_vm->_musicEngine->toggleSoundEffects(window->getWidgetValue(2) != 0);
-		ConfMan.setBool("music_mute", window->getWidgetValue(2) == 0 || (window->getWidgetValue(2) == 1 && window->getWidgetValue(3) == 0));
-		ConfMan.setBool("mute", window->getWidgetValue(2) == 0);
+		_vm->_musicEngine->toggleMusic(checkboxSound->getValue() != 0 && (checkboxSound->getValue() != 1 || checkboxMusic->getValue() != 0));
+		_vm->_musicEngine->toggleSoundEffects(checkboxSound->getValue() != 0);
+		ConfMan.setBool("music_mute", checkboxSound->getValue() == 0 || (checkboxSound->getValue() == 1 && checkboxMusic->getValue() == 0));
+		ConfMan.setBool("mute", checkboxSound->getValue() == 0);
 
 		// MUSIC QUALITY SELECTOR
-		musicQuality = musicQuality * 3 + 1 + window->getWidgetValue(12);
+		musicQuality = musicQuality * 3 + 1 + sliderMusicQuality->getValue();
 		_vm->_musicEngine->setQuality(musicQuality);
 		ConfMan.setInt("mac_snd_quality", musicQuality);
 


Commit: d5b656555651da9709374538174979e7a39dc4e3
    https://github.com/scummvm/scummvm/commit/d5b656555651da9709374538174979e7a39dc4e3
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Update widget list comment for V5 options dialog

Changed paths:
    engines/scumm/macgui/macgui_v5.cpp


diff --git a/engines/scumm/macgui/macgui_v5.cpp b/engines/scumm/macgui/macgui_v5.cpp
index b0fd471b4cc..29ea03a449f 100644
--- a/engines/scumm/macgui/macgui_v5.cpp
+++ b/engines/scumm/macgui/macgui_v5.cpp
@@ -788,13 +788,16 @@ bool MacV5Gui::runOptionsDialog() {
 	// 3 - Music checkbox
 	// 4 - Picture (text speed background)
 	// 5 - Picture (text speed handle)
-	// 6 - Scrolling checkbox
-	// 7 - Full Animation checkbox
+	// 6 - Checkbox (dummy?)
+	// 7 - Checkbox (dummy?)
 	// 8 - Picture (music quality background)
 	// 9 - Picture (music quality handle)
-	// 10 - "Machine Speed:  ^0" text
-	// 11 - Text speed slider (manually created)
-	// 12 - Music quality slider (manually created)
+	// 10 - Static text (dummy?)
+	//
+	// Note: While the widget list is the same, Monkey Island 1 shows
+	//       individual checkboxes for Sound and Music, while Monkey Island
+	//       2 and Fate of Atlantis show a single Music and Sound Effects
+	//       checkbox.
 
 	int sound = (!ConfMan.hasKey("mute") || !ConfMan.getBool("mute")) ? 1 : 0;
 	int music = (!ConfMan.hasKey("music_mute") || !ConfMan.getBool("music_mute")) ? 1 : 0;


Commit: 15daa77e033093970982b85ceb5f36579101c524
    https://github.com/scummvm/scummvm/commit/15daa77e033093970982b85ceb5f36579101c524
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Add defines for some magic numbers

Changed paths:
    engines/scumm/macgui/macgui_dialogwindow.cpp
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/macgui/macgui_impl.h
    engines/scumm/macgui/macgui_indy3.cpp


diff --git a/engines/scumm/macgui/macgui_dialogwindow.cpp b/engines/scumm/macgui/macgui_dialogwindow.cpp
index 780611e5447..3b21ae22378 100644
--- a/engines/scumm/macgui/macgui_dialogwindow.cpp
+++ b/engines/scumm/macgui/macgui_dialogwindow.cpp
@@ -616,7 +616,7 @@ int MacGuiImpl::MacDialogWindow::runDialog(Common::Array<int> &deferredActionIds
 				}
 
 				if (!deferredActionIds.empty())
-					return -2;
+					return kDialogWantsAttention;
 
 				break;
 
@@ -640,7 +640,7 @@ int MacGuiImpl::MacDialogWindow::runDialog(Common::Array<int> &deferredActionIds
 		_system->updateScreen();
 	}
 
-	return -1;
+	return kDialogQuit;
 }
 
 void MacGuiImpl::MacDialogWindow::updateCursor() {
diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 1286ed0f60d..1c8ee90ae53 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -919,7 +919,7 @@ bool MacGuiImpl::runSaveDialog(int &saveSlotToHandle, Common::String &saveName)
 		if (clicked == cancelButton->getId())
 			break;
 
-		if (clicked == -2) {
+		if (clicked == kDialogWantsAttention) {
 			// Cycle through deferred actions
 			for (uint i = 0; i < deferredActionsIds.size(); i++) {
 				if (deferredActionsIds[i] == editText->getId()) {
diff --git a/engines/scumm/macgui/macgui_impl.h b/engines/scumm/macgui/macgui_impl.h
index e705447614e..b143edba442 100644
--- a/engines/scumm/macgui/macgui_impl.h
+++ b/engines/scumm/macgui/macgui_impl.h
@@ -35,6 +35,11 @@
 #include "graphics/font.h"
 #include "graphics/surface.h"
 
+// Use negative values for these. Zero and upwards are reserved for widget IDs.
+
+#define kDialogQuit           -1
+#define kDialogWantsAttention -2
+
 class OSystem;
 
 namespace Graphics {
diff --git a/engines/scumm/macgui/macgui_indy3.cpp b/engines/scumm/macgui/macgui_indy3.cpp
index b3920af77b2..f72b2b7bbc9 100644
--- a/engines/scumm/macgui/macgui_indy3.cpp
+++ b/engines/scumm/macgui/macgui_indy3.cpp
@@ -1466,7 +1466,7 @@ bool MacIndy3Gui::runSaveDialog(int &saveSlotToHandle, Common::String &saveName)
 		if (clicked == cancelButton->getId())
 			break;
 
-		if (clicked == -2) {
+		if (clicked == kDialogWantsAttention) {
 			// Cycle through deferred actions
 			for (uint i = 0; i < deferredActionsIds.size(); i++) {
 				if (deferredActionsIds[i] == editText->getId()) {


Commit: f4725a7207e39391ce2d15e53837c9e51d85ffcc
    https://github.com/scummvm/scummvm/commit/f4725a7207e39391ce2d15e53837c9e51d85ffcc
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Rename some variables for consistency

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 1c8ee90ae53..026fe9982c9 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -812,8 +812,8 @@ bool MacGuiImpl::runOpenDialog(int &saveSlotToHandle) {
 
 	MacDialogWindow *window = createWindow(bounds);
 
-	MacButton *openButton = window->addButton(Common::Rect(254, 137, 334, 157), "Open", true);
-	MacButton *cancelButton = window->addButton(Common::Rect(254, 106, 334, 126), "Cancel", true);
+	MacButton *buttonOpen = window->addButton(Common::Rect(254, 137, 334, 157), "Open", true);
+	MacButton *buttonCancel = window->addButton(Common::Rect(254, 106, 334, 126), "Cancel", true);
 	window->addButton(Common::Rect(254, 62, 334, 82), "Desktop", false);
 	window->addButton(Common::Rect(254, 34, 334, 54), "Eject", false);
 
@@ -829,7 +829,7 @@ bool MacGuiImpl::runOpenDialog(int &saveSlotToHandle) {
 
 	MacListBox *listBox = window->addListBox(Common::Rect(14, 31, 232, 161), savegameNames, true);
 
-	window->setDefaultWidget(openButton);
+	window->setDefaultWidget(buttonOpen);
 
 	// When quitting, the default action is to not open a saved game
 	bool ret = false;
@@ -838,7 +838,7 @@ bool MacGuiImpl::runOpenDialog(int &saveSlotToHandle) {
 	while (!_vm->shouldQuit()) {
 		int clicked = window->runDialog(deferredActionsIds);
 
-		if (clicked == openButton->getId() || clicked == listBox->getId()) {
+		if (clicked == buttonOpen->getId() || clicked == listBox->getId()) {
 			saveSlotToHandle =
 				listBox->getValue() < ARRAYSIZE(slotIds) ?
 				slotIds[listBox->getValue()] : -1;
@@ -846,7 +846,7 @@ bool MacGuiImpl::runOpenDialog(int &saveSlotToHandle) {
 			break;
 		}
 
-		if (clicked == cancelButton->getId())
+		if (clicked == buttonCancel->getId())
 			break;
 	}
 
@@ -861,8 +861,8 @@ bool MacGuiImpl::runSaveDialog(int &saveSlotToHandle, Common::String &saveName)
 
 	MacDialogWindow *window = createWindow(bounds);
 
-	MacButton *saveButton = window->addButton(Common::Rect(254, 163, 334, 183), "Save", true);
-	MacButton *cancelButton = window->addButton(Common::Rect(254, 132, 334, 152), "Cancel", true);
+	MacButton *buttonSave = window->addButton(Common::Rect(254, 163, 334, 183), "Save", true);
+	MacButton *buttonCancel = window->addButton(Common::Rect(254, 132, 334, 152), "Cancel", true);
 	window->addButton(Common::Rect(254, 90, 334, 110), "New", false);
 	window->addButton(Common::Rect(254, 62, 334, 82), "Desktop", false);
 	window->addButton(Common::Rect(254, 34, 334, 54), "Eject", false);
@@ -899,7 +899,7 @@ bool MacGuiImpl::runSaveDialog(int &saveSlotToHandle, Common::String &saveName)
 
 	font->drawString(s, saveGameFileAsResStr, 14, 138, 218, black, Graphics::kTextAlignLeft, 4);
 
-	window->setDefaultWidget(saveButton);
+	window->setDefaultWidget(buttonSave);
 	editText->selectAll();
 
 	// When quitting, the default action is to not open a saved game
@@ -909,14 +909,14 @@ bool MacGuiImpl::runSaveDialog(int &saveSlotToHandle, Common::String &saveName)
 	while (!_vm->shouldQuit()) {
 		int clicked = window->runDialog(deferredActionsIds);
 
-		if (clicked == saveButton->getId()) {
+		if (clicked == buttonSave->getId()) {
 			ret = true;
 			saveName = editText->getText();
 			saveSlotToHandle = firstAvailableSlot;
 			break;
 		}
 
-		if (clicked == cancelButton->getId())
+		if (clicked == buttonCancel->getId())
 			break;
 
 		if (clicked == kDialogWantsAttention) {
@@ -924,7 +924,7 @@ bool MacGuiImpl::runSaveDialog(int &saveSlotToHandle, Common::String &saveName)
 			for (uint i = 0; i < deferredActionsIds.size(); i++) {
 				if (deferredActionsIds[i] == editText->getId()) {
 					// Disable "Save" button when text is empty
-					saveButton->setEnabled(!editText->getText().empty());
+					buttonSave->setEnabled(!editText->getText().empty());
 				}
 			}
 		}


Commit: 90094b99b232648c32557fcf2843a0b4bf01d5b7
    https://github.com/scummvm/scummvm/commit/90094b99b232648c32557fcf2843a0b4bf01d5b7
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Tiny cleanup

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index 026fe9982c9..c910f00c533 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -145,8 +145,11 @@ MacGuiImpl::DelayStatus MacGuiImpl::delay(uint32 ms) {
 // This does not seem very friendly to touch devices, so we instead use the
 // "mouse over" method in the Mac Window Manager class.
 //
-// TODO: Ideally we should handle both, but I don't know if there's a way for
-//       them to coexist.
+// Later games added clicking to open the menu, and even an option to keep the
+// menu bar always visible.
+//
+// TODO: Ideally we should perhaps implement some of these behaviors, but I'm
+//       not sure which one can sensibly coexist.
 // --------------------------------------------------------------------------
 
 void MacGuiImpl::menuCallback(int id, Common::String &name, void *data) {
@@ -585,7 +588,6 @@ Graphics::Surface *MacGuiImpl::loadPict(int id) {
 
 	Common::SeekableReadStream *res = resource.getResource(MKTAG('P', 'I', 'C', 'T'), id);
 
-	// IQ logos are PICT v2
 	Image::PICTDecoder pict;
 	if (pict.loadStream(*res)) {
 		const Graphics::Surface *s1 = pict.getSurface();
@@ -620,7 +622,6 @@ Graphics::Surface *MacGuiImpl::loadPict(int id) {
 			}
 		} else
 			s->copyFrom(*s1);
-
 	}
 
 	delete res;


Commit: 4e6dd93969ec76081f932702d75e8ee88963046e
    https://github.com/scummvm/scummvm/commit/4e6dd93969ec76081f932702d75e8ee88963046e
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Fix default widget for several dialogs

This was another function that changed from taking an index to taking an
object. But in this case, the compiler didn't notice that I hadn't
updated a couple of calls to it so they still used 0.

Changed paths:
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/macgui/macgui_indy3.cpp


diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index c910f00c533..b808ae4320b 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -970,15 +970,14 @@ bool MacGuiImpl::runOkCancelDialog(Common::String text) {
 
 	MacDialogWindow *window = createDialog(502);
 
-	window->setDefaultWidget(0);
-	window->addSubstitution(text);
-
-	MacStaticText *widget = (MacStaticText *)window->getWidget(kWidgetStaticText);
-	widget->setWordWrap(true);
-
 	MacButton *buttonOk = (MacButton *)window->getWidget(kWidgetButton, 0);
 	MacButton *buttonCancel = (MacButton *)window->getWidget(kWidgetButton, 1);
+	MacStaticText *textWidget = (MacStaticText *)window->getWidget(kWidgetStaticText);
 
+	textWidget->setWordWrap(true);
+
+	window->setDefaultWidget(buttonOk);
+	window->addSubstitution(text);
 
 	// When quitting, the default action is to quit
 	bool ret = true;
diff --git a/engines/scumm/macgui/macgui_indy3.cpp b/engines/scumm/macgui/macgui_indy3.cpp
index f72b2b7bbc9..5a2efff3271 100644
--- a/engines/scumm/macgui/macgui_indy3.cpp
+++ b/engines/scumm/macgui/macgui_indy3.cpp
@@ -1369,7 +1369,10 @@ bool MacIndy3Gui::runOpenDialog(int &saveSlotToHandle) {
 
 	MacDialogWindow *window = createDialog((_vm->_renderMode == Common::kRenderMacintoshBW) ? 4000 : 4001);
 
-	window->setDefaultWidget(0);
+	MacButton *buttonSave = (MacButton *)window->getWidget(kWidgetButton, 0);
+	MacButton *buttonCancel = (MacButton *)window->getWidget(kWidgetButton, 1);
+
+	window->setDefaultWidget(buttonSave);
 	window->addSubstitution(Common::String::format("%d", _vm->VAR(244)));
 	window->addSubstitution(Common::String::format("%d", _vm->VAR(245)));
 
@@ -1378,12 +1381,10 @@ bool MacIndy3Gui::runOpenDialog(int &saveSlotToHandle) {
 	Common::StringArray savegameNames;
 	prepareSaveLoad(savegameNames, availSlots, slotIds, ARRAYSIZE(availSlots));
 
-	drawFakePathList(window, Common::Rect(14, 18, 231, 37), "Indy Last Crusade");
-
-	MacButton *saveButton = (MacButton *)window->getWidget(kWidgetButton, 0);
-	MacButton *cancelButton = (MacButton *)window->getWidget(kWidgetButton, 1);
 	MacListBox *listBox = window->addListBox(Common::Rect(14, 41, 232, 187), savegameNames, true);
 
+	drawFakePathList(window, Common::Rect(14, 18, 231, 37), "Indy Last Crusade");
+
 	// When quitting, the default action is to not open a saved game
 	bool ret = false;
 	Common::Array<int> deferredActionsIds;
@@ -1391,14 +1392,14 @@ bool MacIndy3Gui::runOpenDialog(int &saveSlotToHandle) {
 	while (!_vm->shouldQuit()) {
 		int clicked = window->runDialog(deferredActionsIds);
 
-		if (clicked == saveButton->getId() || clicked == listBox->getId()) {
+		if (clicked == buttonSave->getId() || clicked == listBox->getId()) {
 			ret = true;
 			saveSlotToHandle =
 				listBox->getValue() < ARRAYSIZE(slotIds) ? slotIds[listBox->getValue()] : -1;
 			break;
 		}
 
-		if (clicked == cancelButton->getId())
+		if (clicked == buttonCancel->getId())
 			break;
 	}
 
@@ -1424,7 +1425,11 @@ bool MacIndy3Gui::runSaveDialog(int &saveSlotToHandle, Common::String &saveName)
 
 	MacDialogWindow *window = createDialog((_vm->_renderMode == Common::kRenderMacintoshBW) ? 3998 : 3999);
 
-	window->setDefaultWidget(0);
+	MacButton *buttonSave = (MacButton *)window->getWidget(kWidgetButton, 0);
+	MacButton *buttonCancel = (MacButton *)window->getWidget(kWidgetButton, 1);
+	MacEditText *editText = (MacEditText *)window->getWidget(kWidgetEditText);
+
+	window->setDefaultWidget(buttonSave);
 	window->addSubstitution(Common::String::format("%d", _vm->VAR(244)));
 	window->addSubstitution(Common::String::format("%d", _vm->VAR(245)));
 
@@ -1449,21 +1454,17 @@ bool MacIndy3Gui::runSaveDialog(int &saveSlotToHandle, Common::String &saveName)
 	bool ret = false;
 	Common::Array<int> deferredActionsIds;
 
-	MacButton *saveButton = (MacButton *)window->getWidget(kWidgetButton, 0);
-	MacButton *cancelButton = (MacButton *)window->getWidget(kWidgetButton, 1);
-	MacEditText *editText = (MacEditText *)window->getWidget(kWidgetEditText);
-
 	while (!_vm->shouldQuit()) {
 		int clicked = window->runDialog(deferredActionsIds);
 
-		if (clicked == saveButton->getId()) {
+		if (clicked == buttonSave->getId()) {
 			ret = true;
 			saveName = editText->getText();
 			saveSlotToHandle = firstAvailableSlot;
 			break;
 		}
 
-		if (clicked == cancelButton->getId())
+		if (clicked == buttonCancel->getId())
 			break;
 
 		if (clicked == kDialogWantsAttention) {
@@ -1471,7 +1472,7 @@ bool MacIndy3Gui::runSaveDialog(int &saveSlotToHandle, Common::String &saveName)
 			for (uint i = 0; i < deferredActionsIds.size(); i++) {
 				if (deferredActionsIds[i] == editText->getId()) {
 					// Disable "Save" button when text is empty
-					saveButton->setEnabled(!editText->getText().empty());
+					buttonSave->setEnabled(!editText->getText().empty());
 				}
 			}
 		}


Commit: fe184d5ea50d1dd6a6fc0637bfa3b206e0172761
    https://github.com/scummvm/scummvm/commit/fe184d5ea50d1dd6a6fc0637bfa3b206e0172761
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: LOOM (Mac): Use iris fade instead of dissolveEffect

This matches the original

Changed paths:
    engines/scumm/gfx.cpp


diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 5d35500af48..85ed4da5a5e 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -4892,6 +4892,8 @@ void ScummEngine::dissolveEffectSelector() {
 		dissolveEffect(1, 1);
 	else if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine)
 		dissolveEffect(8, 8);
+	else if (_game.id == GID_LOOM && _game.platform == Common::kPlatformMacintosh)
+		transitionEffect(0);
 	else
 		dissolveEffect(8, 4);
 }


Commit: 28cf83aee11de5584e3d83d4af36392da3b3e466
    https://github.com/scummvm/scummvm/commit/28cf83aee11de5584e3d83d4af36392da3b3e466
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MACGUI: Handle differences in options dialog for V5 games

Only Monkey Island 1 has separate checkboxes for music and sound. Monkey
Island 2 and Fate of Atlantis have just one checkbox for both.

Changed paths:
    engines/scumm/macgui/macgui_v5.cpp


diff --git a/engines/scumm/macgui/macgui_v5.cpp b/engines/scumm/macgui/macgui_v5.cpp
index 29ea03a449f..69d18b539a0 100644
--- a/engines/scumm/macgui/macgui_v5.cpp
+++ b/engines/scumm/macgui/macgui_v5.cpp
@@ -799,31 +799,40 @@ bool MacV5Gui::runOptionsDialog() {
 	//       2 and Fate of Atlantis show a single Music and Sound Effects
 	//       checkbox.
 
-	int sound = (!ConfMan.hasKey("mute") || !ConfMan.getBool("mute")) ? 1 : 0;
-	int music = (!ConfMan.hasKey("music_mute") || !ConfMan.getBool("music_mute")) ? 1 : 0;
-	int textSpeed = _vm->_defaultTextSpeed;
-	int musicQuality = ConfMan.hasKey("mac_snd_quality") ? ConfMan.getInt("mac_snd_quality") : 0;
-	int musicQualityOption = (musicQuality == 0) ? 1 : (musicQuality - 1) % 3;
-	musicQuality = (musicQuality == 0) ? (_vm->VAR(_vm->VAR_SOUNDCARD) == 10 ? 0 : 2) : (musicQuality - 1) / 3;
-
 	MacDialogWindow *window = createDialog(1000);
 
 	MacButton *buttonOk = (MacButton *)window->getWidget(kWidgetButton, 0);
 	MacButton *buttonCancel = (MacButton *)window->getWidget(kWidgetButton, 1);
 
 	MacCheckbox *checkboxSound = (MacCheckbox *)window->getWidget(kWidgetCheckbox, 0);
-	MacCheckbox *checkboxMusic = (MacCheckbox *)window->getWidget(kWidgetCheckbox, 1);
+	MacCheckbox *checkboxMusic = nullptr;
 
-	checkboxSound->setValue(sound);
-	checkboxMusic->setValue(music);
+	MacPictureSlider *sliderTextSpeed = window->addPictureSlider(4, 5, true, 5, 105, 0, 9);
+	MacPictureSlider *sliderMusicQuality = window->addPictureSlider(8, 9, true, 5, 69, 0, 2, 6, 4);
+
+	bool sound = !ConfMan.hasKey("mute") || !ConfMan.getBool("mute");
+	bool music;
+	int textSpeed = _vm->_defaultTextSpeed;
+	int musicQuality = ConfMan.hasKey("mac_snd_quality") ? ConfMan.getInt("mac_snd_quality") : 0;
+	int musicQualityOption = (musicQuality == 0) ? 1 : (musicQuality - 1) % 3;
+	musicQuality = (musicQuality == 0) ? (_vm->VAR(_vm->VAR_SOUNDCARD) == 10 ? 0 : 2) : (musicQuality - 1) / 3;
 
-	if (!sound)
-		checkboxMusic->setEnabled(false);
+	if (_vm->_game.id == GID_MONKEY) {
+		checkboxMusic = (MacCheckbox *)window->getWidget(kWidgetCheckbox, 1);
+		music = !ConfMan.hasKey("music_mute") || !ConfMan.getBool("music_mute");
+		checkboxMusic->setValue(music);
 
-	MacPictureSlider *sliderTextSpeed = window->addPictureSlider(4, 5, true, 5, 105, 0, 9);
-	sliderTextSpeed->setValue(textSpeed);
+		if (!sound) {
+			checkboxMusic->setEnabled(false);
+			music = false;
+		}
+	} else {
+		checkboxMusic = nullptr;
+		music = sound;
+	}
 
-	MacPictureSlider *sliderMusicQuality = window->addPictureSlider(8, 9, true, 5, 69, 0, 2, 6, 4);
+	checkboxSound->setValue(sound);
+	sliderTextSpeed->setValue(textSpeed);
 	sliderMusicQuality->setValue(musicQualityOption);
 
 	// When quitting, the default action is not to not apply options
@@ -841,10 +850,8 @@ bool MacV5Gui::runOptionsDialog() {
 		if (clicked == buttonCancel->getId())
 			break;
 
-		if (clicked == checkboxSound->getId()) {
+		if (clicked == checkboxSound->getId() && checkboxMusic)
 			checkboxMusic->setEnabled(checkboxSound->getValue() != 0);
-			checkboxMusic->setValue(checkboxSound->getValue() != 0 ? 1 : 0);
-		}
 	}
 
 	if (ret) {
@@ -856,10 +863,16 @@ bool MacV5Gui::runOptionsDialog() {
 		_vm->setTalkSpeed(_vm->_defaultTextSpeed);
 
 		// SOUND&MUSIC ACTIVATION
-		_vm->_musicEngine->toggleMusic(checkboxSound->getValue() != 0 && (checkboxSound->getValue() != 1 || checkboxMusic->getValue() != 0));
-		_vm->_musicEngine->toggleSoundEffects(checkboxSound->getValue() != 0);
-		ConfMan.setBool("music_mute", checkboxSound->getValue() == 0 || (checkboxSound->getValue() == 1 && checkboxMusic->getValue() == 0));
-		ConfMan.setBool("mute", checkboxSound->getValue() == 0);
+		sound = checkboxSound->getValue();
+		music = checkboxMusic ? checkboxMusic->getValue() : sound;
+
+		if (!sound)
+			music = false;
+
+		_vm->_musicEngine->toggleMusic(music);
+		_vm->_musicEngine->toggleSoundEffects(sound);
+		ConfMan.setBool("music_mute", !music);
+		ConfMan.setBool("mute", !sound);
 
 		// MUSIC QUALITY SELECTOR
 		musicQuality = musicQuality * 3 + 1 + sliderMusicQuality->getValue();


Commit: ce6e1f7031f4563ed17f27066a05de0043a84b88
    https://github.com/scummvm/scummvm/commit/ce6e1f7031f4563ed17f27066a05de0043a84b88
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: INDY3 (Mac): Use iris effect instead of dissolve

I'm uncertain exactly where this is used, but during the endgame at the
very least. (Fortunately I had saved my old savegames from when playing
it in a Mac emulator.)

Changed paths:
    engines/scumm/gfx.cpp


diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 85ed4da5a5e..212810f9d42 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -4892,7 +4892,7 @@ void ScummEngine::dissolveEffectSelector() {
 		dissolveEffect(1, 1);
 	else if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine)
 		dissolveEffect(8, 8);
-	else if (_game.id == GID_LOOM && _game.platform == Common::kPlatformMacintosh)
+	else if ((_game.id == GID_INDY3 || _game.id == GID_LOOM) && _game.platform == Common::kPlatformMacintosh)
 		transitionEffect(0);
 	else
 		dissolveEffect(8, 4);


Commit: bdbc4ac66c37a2ace9f2e7a9c00d228d6dde8b15
    https://github.com/scummvm/scummvm/commit/bdbc4ac66c37a2ace9f2e7a9c00d228d6dde8b15
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: MI1 (Mac): Correctly handle dissolve effect path

Changed paths:
    engines/scumm/gfx.cpp


diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 212810f9d42..9b18e3ef309 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -4888,14 +4888,19 @@ void ScummEngine::scrollEffect(int dir) {
 
 void ScummEngine::dissolveEffectSelector() {
 	// CD Loom (but not EGA Loom!) uses a more fine-grained dissolve
-	if (_game.id == GID_LOOM && _game.version == 4)
+	if (_game.id == GID_LOOM && _game.version == 4) {
 		dissolveEffect(1, 1);
-	else if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine)
+	} else if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine) {
 		dissolveEffect(8, 8);
-	else if ((_game.id == GID_INDY3 || _game.id == GID_LOOM) && _game.platform == Common::kPlatformMacintosh)
-		transitionEffect(0);
-	else
+	} else if (_game.platform == Common::kPlatformMacintosh) {
+		if (_game.version == 3) {
+			transitionEffect(0);
+		} else {
+			return;
+		}
+	} else {
 		dissolveEffect(8, 4);
+	}
 }
 
 void ScummEngine::updateScreenShakeEffect() {


Commit: 6989b2205d84e4d55a7481596e8064307718da73
    https://github.com/scummvm/scummvm/commit/6989b2205d84e4d55a7481596e8064307718da73
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Clean up dissolveEffect() slighty for Mac versions

Changed paths:
    engines/scumm/gfx.cpp


diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 9b18e3ef309..753aa75a541 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -4604,7 +4604,7 @@ void ScummEngine::transitionEffect(int a) {
  */
 void ScummEngine::dissolveEffect(int width, int height) {
 	// Apparently Mac versions discarded this effect
-	if (_macScreen && _macGui)
+	if (_macScreen)
 		return;
 
 	VirtScreen *vs = &_virtscr[kMainVirtScreen];
@@ -4709,9 +4709,7 @@ void ScummEngine::dissolveEffect(int width, int height) {
 			towns_drawStripToScreen(vs, x, y + vs->topline, x, y, width, height);
 		else
 #endif
-		if (_macScreen && _game.version == 3)
-			mac_drawStripToScreen(vs, y, x, y + vs->topline, width, height);
-		else if (IS_ALIGNED(width, 4))
+		if (IS_ALIGNED(width, 4))
 			drawStripToScreen(vs, x, width, y, y + height);
 		else {
 			const byte *src = vs->getPixels(x, y);


Commit: f831831c887a432ec6ab0b46a2048528b267d5a7
    https://github.com/scummvm/scummvm/commit/f831831c887a432ec6ab0b46a2048528b267d5a7
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Fix scroll screen transition for _macScreen games

Changed paths:
    engines/scumm/gfx.cpp
    engines/scumm/gfx_mac.cpp
    engines/scumm/scumm.h


diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 753aa75a541..ec1c5cc6191 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -1746,7 +1746,18 @@ void ScummEngine::moveScreen(int dx, int dy, int height) {
 	Graphics::Surface *screen = _system->lockScreen();
 	if (!screen)
 		return;
-	screen->move(dx, dy, height);
+
+
+	if (_macScreen) {
+		screen->move(dx, dy, height + _macScreenDrawOffset * 2);
+
+		// Mask the empty part of the screen
+		screen->fillRect(Common::Rect(0, 0, screen->pitch, _macScreenDrawOffset * 2), 0);
+		screen->fillRect(Common::Rect(0, screen->h - _macScreenDrawOffset * 2, screen->pitch, screen->h), 0);
+	} else {
+		screen->move(dx, dy, height);
+	}
+
 	_system->unlockScreen();
 }
 
@@ -4810,10 +4821,14 @@ void ScummEngine::scrollEffect(int dir) {
 #endif
 			{
 				src = vs->getPixels(0, y - step);
-				_system->copyRectToScreen(src,
-					vsPitch * m,
-					0, (vs->h - step) * m,
-					vs->w * m, step * m);
+				if (_macScreen) {
+					mac_drawBufferToScreen(src, vsPitch, 0, (vs->h - step), vs->w, step, false);
+				} else {
+					_system->copyRectToScreen(src,
+											  vsPitch * m,
+											  0, (vs->h - step) * m,
+											  vs->w * m, step * m);
+				}
 			}
 
 			waitForTimer(delay, true);
@@ -4832,10 +4847,15 @@ void ScummEngine::scrollEffect(int dir) {
 #endif
 			{
 				src = vs->getPixels(0, vs->h - y);
-				_system->copyRectToScreen(src,
-					vsPitch * m,
-					0, 0,
-					vs->w * m, step * m);
+
+				if (_macScreen) {
+					mac_drawBufferToScreen(src, vsPitch, 0, 0, vs->w, step, false);
+				} else {
+					_system->copyRectToScreen(src,
+											  vsPitch * m,
+											  0, 0,
+											  vs->w * m, step * m);
+				}
 			}
 
 			waitForTimer(delay, true);
@@ -4854,7 +4874,11 @@ void ScummEngine::scrollEffect(int dir) {
 #endif
 			{
 				src = vs->getPixels(x - step, 0);
-				_system->copyRectToScreen(src, vsPitch * m, (vs->w - step) * m, 0, step * m, vs->h * m);
+				if (_macScreen) {
+					mac_drawBufferToScreen(src, vsPitch, (vs->w - step), 0, step, vs->h, false);
+				} else {
+					_system->copyRectToScreen(src, vsPitch * m, (vs->w - step) * m, 0, step * m, vs->h * m);
+				}
 			}
 			waitForTimer(delay, true);
 			x += step;
@@ -4872,7 +4896,11 @@ void ScummEngine::scrollEffect(int dir) {
 #endif
 			{
 				src = vs->getPixels(vs->w - x, 0);
-				_system->copyRectToScreen(src, vsPitch * m, 0, 0, step * m, vs->h * m);
+				if (_macScreen) {
+					mac_drawBufferToScreen(src, vsPitch, 0, 0, step, vs->h, false);
+				} else {
+					_system->copyRectToScreen(src, vsPitch * m, 0, 0, step * m, vs->h * m);
+				}
 			}
 
 			waitForTimer(delay, true);
diff --git a/engines/scumm/gfx_mac.cpp b/engines/scumm/gfx_mac.cpp
index 2492536e165..88b7c9451f9 100644
--- a/engines/scumm/gfx_mac.cpp
+++ b/engines/scumm/gfx_mac.cpp
@@ -161,13 +161,13 @@ void ScummEngine::mac_undrawIndy3CreditsText() {
 	restoreCharsetBg();
 }
 
-void ScummEngine::mac_drawBufferToScreen(const byte *buffer, int pitch, int x, int y, int width, int height) {
+void ScummEngine::mac_drawBufferToScreen(const byte *buffer, int pitch, int x, int y, int width, int height, bool epxRectangleExpansion) {
 	// Composite the dirty rectangle into _completeScreenBuffer
 	mac_updateCompositeBuffer(buffer, pitch, x, y, width, height);
 
 	if (_useMacGraphicsSmoothing) {
 		// Apply the EPX scaling algorithm to produce a 640x480 image...
-		mac_blitEPXImage(buffer, pitch, x, y, width, height);
+		mac_blitEPXImage(buffer, pitch, x, y, width, height, epxRectangleExpansion);
 	} else {
 		// ...otherwise just double the resolution.
 		mac_blitDoubleResImage(buffer, pitch, x, y, width, height);
@@ -218,7 +218,7 @@ void ScummEngine::mac_applyDoubleResToBuffer(const byte *inputBuffer, byte *outp
 	}
 }
 
-void ScummEngine::mac_blitEPXImage(const byte *buffer, int pitch, int x, int y, int width, int height) {
+void ScummEngine::mac_blitEPXImage(const byte *buffer, int pitch, int x, int y, int width, int height, bool epxRectangleExpansion) {
 	// This is a piecewise version of EPX/Scale2x.
 	//
 	// Just like the original, it applies EPX not on the entire screen but just on the
@@ -248,10 +248,18 @@ void ScummEngine::mac_blitEPXImage(const byte *buffer, int pitch, int x, int y,
 	// which supposedly use most of the same EPX code from the Macintosh interpreters.
 
 	// Rectangle expansion
-	int x1 = (x > 0) ? x - 1 : 0;
-	int y1 = (y > 0) ? y - 1 : 0;
-	int x2 = (x + width < _screenWidth) ? x + width + 1 : _screenWidth;
-	int y2 = (y + height < _screenHeight) ? y + height + 1 : _screenHeight;
+	int x1, y1, x2, y2;
+	if (epxRectangleExpansion) {
+		x1 = (x > 0) ? x - 1 : 0;
+		y1 = (y > 0) ? y - 1 : 0;
+		x2 = (x + width < _screenWidth) ? x + width + 1 : _screenWidth;
+		y2 = (y + height < _screenHeight) ? y + height + 1 : _screenHeight;
+	} else {
+		x1 = (x > 0) ? x : 0;
+		y1 = (y > 0) ? y : 0;
+		x2 = (x + width < _screenWidth) ? x + width : _screenWidth;
+		y2 = (y + height < _screenHeight) ? y + height : _screenHeight;
+	}
 
 	// Adjust output buffer accordingly
 	byte *targetScreenBuf = (byte *)_macScreen->getBasePtr(x1 * 2, y1 * 2 + _macScreenDrawOffset * 2);
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index ff14eeb0589..f349494aa9d 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1447,11 +1447,11 @@ protected:
 	void mac_drawIndy3TextBox();
 	void mac_undrawIndy3TextBox();
 	void mac_undrawIndy3CreditsText();
-	void mac_drawBufferToScreen(const byte *buffer, int pitch, int x, int y, int width, int height);
+	void mac_drawBufferToScreen(const byte *buffer, int pitch, int x, int y, int width, int height, bool epxRectangleExpansion = true);
 	void mac_updateCompositeBuffer(const byte *buffer, int pitch, int x, int y, int width, int height);
 	void mac_blitDoubleResImage(const byte *buffer, int pitch, int x, int y, int width, int height);
 	void mac_applyDoubleResToBuffer(const byte *inputBuffer, byte *outputBuffer, int width, int height, int inputPitch, int outputPitch);
-	void mac_blitEPXImage(const byte *buffer, int pitch, int x, int y, int width, int height);
+	void mac_blitEPXImage(const byte *buffer, int pitch, int x, int y, int width, int height, bool epxRectangleExpansion = true);
 	void mac_applyEPXToBuffer(const byte *inputBuffer, byte *outputBuffer, int width, int height, int inputPitch, int outputPitch, int xOffset, int yOffset, int bufferWidth, int bufferHeight);
 	void mac_scaleCursor(byte *&outCursor, int &outHotspotX, int &outHotspotY, int &outWidth, int &outHeight);
 	void mac_toggleSmoothing();


Commit: 62ed7735a7616c1115eee136870cb7b652aa851b
    https://github.com/scummvm/scummvm/commit/62ed7735a7616c1115eee136870cb7b652aa851b
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-28T08:24:59+01:00

Commit Message:
SCUMM: Remember when music is stopped, even while it's muted

Otherwhise the wrong music can play when you unmute the music again.
E.g. in Monkey Island 1, if you enter the SCUMM Bar, mute the music,
leave, and let the LeChuck cutscene play. Once the cutscene has ended,
when you unmuted the music it would play LeChuck's theme.

Changed paths:
    engines/scumm/players/player_mac_loom_monkey.cpp


diff --git a/engines/scumm/players/player_mac_loom_monkey.cpp b/engines/scumm/players/player_mac_loom_monkey.cpp
index ce958bc7bc7..7705482676a 100644
--- a/engines/scumm/players/player_mac_loom_monkey.cpp
+++ b/engines/scumm/players/player_mac_loom_monkey.cpp
@@ -568,6 +568,9 @@ void LoomMonkeyMacSnd::stopSound(int id) {
 
 	Common::StackLock lock(_mixer->mutex());
 
+	if (id == _curSoundSaveVar)
+		_curSoundSaveVar = 0;
+
 	if (id == _curSound)
 		stopActiveSound();
 }




More information about the Scummvm-git-logs mailing list