[Scummvm-git-logs] scummvm master -> dd937a65ffb5e5e372a64a6c30491d758bc5a838

sev- noreply at scummvm.org
Sat Aug 2 11:22:28 UTC 2025


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

Summary:
c79e0b0cd8 DIRECTOR: Add detection entries + quirks for mcmillennium
be3652b86b DIRECTOR: LINGO: Improve accuracy of c_delete
3277328ace DIRECTOR: Fix puppetmotel detection entry
ec1dc4d16c DIRECTOR: Make getCurrentAbsolutePath return @: prefix on Mac
dd937a65ff DIRECTOR: XOBJ: Implement XSoundXFCN


Commit: c79e0b0cd8b45afd2e1226b86a5541d9c950e0a0
    https://github.com/scummvm/scummvm/commit/c79e0b0cd8b45afd2e1226b86a5541d9c950e0a0
Author: Scott Percival (code at moral.net.au)
Date: 2025-08-02T13:22:22+02:00

Commit Message:
DIRECTOR: Add detection entries + quirks for mcmillennium

Changed paths:
    engines/director/detection_tables.h
    engines/director/game-quirks.cpp
    engines/director/lingo/lingo-patcher.cpp
    engines/director/lingo/lingo-the.cpp


diff --git a/engines/director/detection_tables.h b/engines/director/detection_tables.h
index 3af2a734714..a4c98112cc4 100644
--- a/engines/director/detection_tables.h
+++ b/engines/director/detection_tables.h
@@ -5149,6 +5149,9 @@ static const DirectorGameDescription gameDescriptions[] = {
 
 	WINDEMO1("mcmillennium", "Demo", "MILLDEMO.EXE", "t:028a149906ca490f8634e30c6b3c3957", 3630918, 404),
 
+	WINGAME1("mcmillennium", "", "PC/MILL.EXE", "t:0490abda5d8b53a2bd7c11cc7fb79232", 757828, 404),
+	MACGAME1("mcmillennium", "", "Mission Code Millennium/Mission Code Millennium", "r:cbce20666bfe47a9533331c6be1e6039", 285282, 404),
+
 	// Full game is not Director
 	WINDEMO1("mechwarrior2", "Demo", "MW2DEMO.EXE", "4a8fd0d74faef305bc935e1aac94d3e8", 712817, 400),
 	WINDEMO1("mechwarrior2", "Demo", "MW2DEMO.EXE", "b8c1516451471394eb1c45839f9f15df", 699305, 404),
@@ -8524,7 +8527,7 @@ static const DirectorGameDescription gameDescriptions[] = {
 	WINGAME1_l("kanazawa", "", "KANAZAWA.EXE",	  "t:3e54b92d68a7e1bfaf4b92b37f4f9eea", 1896688, Common::JA_JPN, 600),
 
 	WINGAME1_l("kcd", "K15 2001", "V_Fi.exe", "t:2fa05adc6cbc2c46702d4992a82f932b", 1704035, Common::FI_FIN, 602),
-	
+
 	// Mac version requires installation
 	MACGAME1("kingandi", "", "The King and I Thinking Adv", "r:ef18d569c3cb7700367427cfc9150656",  115776, 602),
 	WINGAME1("kingandi", "", "King&I.exe",					"t:ed267a58821c0a586dab3d2b853971be", 1967220, 602),
diff --git a/engines/director/game-quirks.cpp b/engines/director/game-quirks.cpp
index 0a1cee574af..16c501e144b 100644
--- a/engines/director/game-quirks.cpp
+++ b/engines/director/game-quirks.cpp
@@ -118,6 +118,7 @@ struct CachedFile {
 	{"finkletimes", Common::kPlatformWindows, "lernscor.txt", (const byte *)"", 0},
 	{"finkletimes", Common::kPlatformWindows, "namelist.txt", (const byte *)"", 0},
 	{"finkletimes", Common::kPlatformWindows, "userlist.txt", (const byte *)"", 0},
+	{"mcmillennium", Common::kPlatformWindows, "pc/players", (const byte *)"", 0},
 	{ nullptr, Common::kPlatformUnknown, nullptr, nullptr, 0 }
 };
 
diff --git a/engines/director/lingo/lingo-patcher.cpp b/engines/director/lingo/lingo-patcher.cpp
index fefbbbbd533..49da2d4811d 100644
--- a/engines/director/lingo/lingo-patcher.cpp
+++ b/engines/director/lingo/lingo-patcher.cpp
@@ -443,6 +443,37 @@ on exitFrame\r\
   go(1, \"C:\\PG_WORLD\\A_IN01\")\r\
 ";
 
+
+const char *const mcmillenniumDriveDetectionFix = "\
+on initPaths\r\
+  global PD, theCDPath, theHDPath, theVCAudioPath, theNotePath, proxPath\r\
+  if the machineType = 256 then\r\
+    set PD to \"\\\"\r\
+  else\r\
+    set PD to \":\"\r\
+  end if\r\
+  if the machineType = 256 then\r\
+    set theCDPath to getAt(the searchPaths, 2)\r\
+  else\r\
+    if checkFileExists(the pathName & \"DESTINA.MLD\") = 1 then\r\
+      set theCDPath to the pathName\r\
+    else\
+      set theCDPath to \"Millennium:\"\r\
+    end if\r\
+  end if\r\
+  set theHDPath to the pathName\r\
+  set theVCAudioPath to theCDPath & \"AUDIO\" & PD & \"VIDCOM\" & PD\r\
+  set theNotePath to the pathName\r\
+  set proxPath to theCDPath & \"prox\" & PD\r\
+end\r\
+";
+
+const char *const mcmillenniumResDetectionFix = "\
+on getRes\r\
+end\r\
+";
+
+
 struct ScriptHandlerPatch {
 	const char *gameId;
 	const char *extra;
@@ -481,6 +512,9 @@ struct ScriptHandlerPatch {
 	{"gadgetpaf", nullptr, kPlatformWindows, "GADGET\\GADGET.EXE", kScoreScript, 9, DEFAULT_CAST_LIB, &gadgetPafDetectionFix9},
 	{"pinkgear", nullptr, kPlatformWindows, "GOTOPINK.EXE", kMovieScript, 4, DEFAULT_CAST_LIB, &pinkGearDriveDetectionFix1},
 	{"pinkgear", nullptr, kPlatformWindows, "GOTOPINK.EXE", kScoreScript, 6, DEFAULT_CAST_LIB, &pinkGearDriveDetectionFix2},
+	{"mcmillennium", nullptr, kPlatformWindows, "PC\\MILL.EXE", kMovieScript, 15, DEFAULT_CAST_LIB, &mcmillenniumResDetectionFix},
+	{"mcmillennium", nullptr, kPlatformWindows, "PC\\SHARED.DXR", kMovieScript, 1013, DEFAULT_CAST_LIB, &mcmillenniumDriveDetectionFix},
+	{"mcmillennium", nullptr, kPlatformMacintosh, "Mission Code Millennium:SHARED.Dxr", kMovieScript, 1013, DEFAULT_CAST_LIB, &mcmillenniumDriveDetectionFix},
 	{nullptr, nullptr, kPlatformUnknown, nullptr, kNoneScript, 0, 0, nullptr},
 
 };
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 3e2d606f8f5..ece1506faca 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -148,7 +148,7 @@ TheEntity entities[] = {					//	hasId  ver.	isFunction
 	{ kTheScummvmVersion,	"scummvmVersion",	false, 200, true }, // 					ScummVM only
 	{ kTheSearchCurrentFolder,"searchCurrentFolder",false,400, true },//			D4 f
 	{ kTheSearchPath,		"searchPath",		false, 400, true },	//			D4 f
-	{ kTheSearchPaths,		"searchPaths",		false, 500, false },	//				D5 p
+	{ kTheSearchPaths,		"searchPaths",		false, 400, false },	//			D4 p, documented in D5
 	{ kTheSelection,		"selection",		false, 200, true },	// D2 f
 	{ kTheSelEnd,			"selEnd",			false, 200, false },	// D2 p
 	{ kTheSelStart,			"selStart",			false, 200, false },	// D2 p
@@ -995,20 +995,32 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
 		d = _vm->getStage();
 		break;
 	case kTheStageBottom:
-		d = _vm->getCurrentWindow()->getSurface()->h;
+		{
+			Window *window = _vm->getCurrentWindow();
+			d = window->getInnerDimensions().bottom;
+		}
 		break;
 	case kTheStageColor:
 		// TODO: Provide proper reverse transform for non-indexed color
 		d = (int)g_director->transformColor(g_director->getCurrentWindow()->getStageColor());
 		break;
 	case kTheStageLeft:
-		d = 0;
+		{
+			Window *window = _vm->getCurrentWindow();
+			d = window->getInnerDimensions().left;
+		}
 		break;
 	case kTheStageRight:
-		d = _vm->getCurrentWindow()->getSurface()->w;
+		{
+			Window *window = _vm->getCurrentWindow();
+			d = window->getInnerDimensions().right;
+		}
 		break;
 	case kTheStageTop:
-		d = 0;
+		{
+			Window *window = _vm->getCurrentWindow();
+			d = window->getInnerDimensions().top;
+		}
 		break;
 	case kTheStillDown:
 		d = _vm->_wm->_mouseDown;


Commit: be3652b86b98adca11bc40f37f127f2c3675cddc
    https://github.com/scummvm/scummvm/commit/be3652b86b98adca11bc40f37f127f2c3675cddc
Author: Scott Percival (code at moral.net.au)
Date: 2025-08-02T13:22:22+02:00

Commit Message:
DIRECTOR: LINGO: Improve accuracy of c_delete

Fixes crash when looking at objects in mcmillennium

Changed paths:
    engines/director/lingo/lingo-code.cpp


diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index 2dbfd63d029..15e15e57000 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -1881,7 +1881,7 @@ void LC::c_delete() {
 		case kChunkLine:
 			// when deleting the first item, include the delimiter after the item
 			// deleting another item, remove the delimiter in front
-			if (start == 0) {
+			if ((start == 0) || ((start > 0) && (text[start-1] == '\r'))) {
 				end++;
 			} else {
 				start--;


Commit: 3277328ace15c7dd60d885beab76d978eef98bd5
    https://github.com/scummvm/scummvm/commit/3277328ace15c7dd60d885beab76d978eef98bd5
Author: Scott Percival (code at moral.net.au)
Date: 2025-08-02T13:22:22+02:00

Commit Message:
DIRECTOR: Fix puppetmotel detection entry

Changed paths:
    engines/director/detection_tables.h


diff --git a/engines/director/detection_tables.h b/engines/director/detection_tables.h
index a4c98112cc4..a617304a8d9 100644
--- a/engines/director/detection_tables.h
+++ b/engines/director/detection_tables.h
@@ -5719,7 +5719,7 @@ static const DirectorGameDescription gameDescriptions[] = {
 	MACGAME1("psych", "v2.0.1", "xn--psych -7z1c", "r:19a813e1699b06156fd9686be7a11d93", 284366, 404),
 
 	// 1995 Mac only release
-	MACGAME1("puppetmotel", "", "Puppet Motel", "r:8719de9c083aca942fc0e5c0a127b6dc", 641110, 404),
+	MACGAME1("puppetmotel", "", "Puppet Motel Folder/Puppet Motel", "r:8719de9c083aca942fc0e5c0a127b6dc", 641110, 404),
 
 	// Highlights Puzzlemania, a digital version of Highlights game books
 	MACGAME1("puzzlemania", "", "PUZZLEMANIA Power Mac", "r:f1d972d4bdf52e32b437d850e08aa3b5",  82888, 404),


Commit: ec1dc4d16c34e5cbd07de04704415d18321871f8
    https://github.com/scummvm/scummvm/commit/ec1dc4d16c34e5cbd07de04704415d18321871f8
Author: Scott Percival (code at moral.net.au)
Date: 2025-08-02T13:22:22+02:00

Commit Message:
DIRECTOR: Make getCurrentAbsolutePath return @: prefix on Mac

Fixes filename construction and directory crawling in Puppet Motel for
Macintosh.

Changed paths:
    engines/director/director.cpp


diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index ed8f30e02f4..eb1fc9c1c9c 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -186,7 +186,7 @@ Common::String DirectorEngine::getCurrentPath() const { return _currentWindow->g
 Common::String DirectorEngine::getCurrentAbsolutePath() {
 	Common::String currentPath = getCurrentPath();
 	Common::String result;
-	result += (getPlatform() == Common::kPlatformWindows && _version >= 400) ? "C:\\" : "";
+	result += (getPlatform() == Common::kPlatformWindows && _version >= 400) ? "C:\\" : "@:";
 	result += convertPath(currentPath);
 	return result;
 }


Commit: dd937a65ffb5e5e372a64a6c30491d758bc5a838
    https://github.com/scummvm/scummvm/commit/dd937a65ffb5e5e372a64a6c30491d758bc5a838
Author: Scott Percival (code at moral.net.au)
Date: 2025-08-02T13:22:22+02:00

Commit Message:
DIRECTOR: XOBJ: Implement XSoundXFCN

Fixes most audio playback in Puppet Motel for Macintosh.

Changed paths:
    engines/director/lingo/xlibs/xsoundxfcn.cpp


diff --git a/engines/director/lingo/xlibs/xsoundxfcn.cpp b/engines/director/lingo/xlibs/xsoundxfcn.cpp
index 3a8f4496c07..91c8e0e00c2 100644
--- a/engines/director/lingo/xlibs/xsoundxfcn.cpp
+++ b/engines/director/lingo/xlibs/xsoundxfcn.cpp
@@ -25,6 +25,7 @@
 #include "director/lingo/lingo.h"
 #include "director/lingo/lingo-object.h"
 #include "director/lingo/lingo-utils.h"
+#include "director/lingo/xlibs/voyagerxsound.h"
 #include "director/lingo/xlibs/xsoundxfcn.h"
 
 /**************************************************
@@ -38,7 +39,8 @@ namespace Director {
 
 const char *const XSoundXFCN::xlibName = "XSound";
 const XlibFileDesc XSoundXFCN::fileNames[] = {
-	{ "XSound",	nullptr },
+	{ "XSound",	"puppetmotel" },
+	{ "_XSound",	"puppetmotel" },
 	{ nullptr,	nullptr },
 };
 
@@ -49,12 +51,144 @@ static const BuiltinProto builtins[] = {
 
 void XSoundXFCN::open(ObjectType type, const Common::Path &path) {
 	g_lingo->initBuiltIns(builtins);
+
+	if (!g_lingo->_openXLibsState.contains("XSound")) {
+		VoyagerXSoundXObject *xobj = new VoyagerXSoundXObject(type);
+		g_lingo->_openXLibsState.setVal("XSound", xobj);
+	}
 }
 
 void XSoundXFCN::close(ObjectType type) {
 	g_lingo->cleanupBuiltIns(builtins);
 }
 
-XOBJSTUB(XSoundXFCN::m_XSound, 0)
+void XSoundXFCN::m_XSound(int nargs) {
+	g_lingo->printSTUBWithArglist("XSoundXFCN::m_XSound", nargs);
+	VoyagerXSoundXObject *xobj = (VoyagerXSoundXObject *)g_lingo->_openXLibsState.getVal("XSound");
+
+	if (nargs == 0) {
+		warning("XSoundXFCN: need at least one arg");
+		g_lingo->push(Datum());
+		return;
+	}
+	Datum cmd = g_lingo->peek(nargs-1);
+	if (cmd.type != STRING) {
+		warning("XSoundXFCN: arg 1 needs to be string");
+		g_lingo->dropStack(nargs);
+		g_lingo->push(Datum());
+		return;
+	}
+	Common::String cmdName = cmd.asString();
+
+	if (cmdName == "open") {
+		ARGNUMCHECK(3);
+		Datum monostereo = g_lingo->pop();
+		Datum numchan = g_lingo->pop();
+		g_lingo->pop();
+		g_lingo->push(xobj->open(numchan.asInt(), monostereo.asInt()));
+	} else if (cmdName == "close") {
+		ARGNUMCHECK(1);
+		g_lingo->pop();
+		xobj->close();
+		g_lingo->push(Datum(0));
+	} else if (cmdName == "status") {
+		ARGNUMCHECK(2);
+		Datum chan = g_lingo->pop();
+		g_lingo->pop();
+		g_lingo->push(xobj->status(chan.asInt()));
+	} else if (cmdName == "playfile") {
+		if (nargs < 3) {
+			warning("XSoundXFCN::playfile: expected at least 3 args");
+			g_lingo->dropStack(nargs);
+			g_lingo->push(0);
+			return;
+		} else if (nargs > 5) {
+			g_lingo->dropStack(nargs - 5);
+			nargs = 5;
+		}
+		Datum tend(-1);
+		if (nargs == 5) {
+			tend = g_lingo->pop();
+			nargs--;
+		}
+		Datum tstart(-1);
+		if (nargs == 4) {
+			tstart = g_lingo->pop();
+			nargs--;
+		}
+		Common::String path = g_lingo->pop().asString();
+		Datum chan = g_lingo->pop();
+		g_lingo->pop();
+		int result = xobj->playfile(chan.asInt(), path, tstart.asInt(), tend.asInt());
+		g_lingo->push(result);
+	} else if (cmdName == "stop") {
+		ARGNUMCHECK(2);
+		Datum chan = g_lingo->pop();
+		g_lingo->pop();
+		xobj->stop(chan.asInt());
+		g_lingo->push(1);
+	} else if (cmdName == "volume") {
+		ARGNUMCHECK(3);
+		Datum vol = g_lingo->pop();
+		Datum chan = g_lingo->pop();
+		g_lingo->pop();
+		xobj->volume(chan.asInt(), vol.asInt());
+		g_lingo->push(1);
+	} else if (cmdName == "leftRightVol") {
+		ARGNUMCHECK(4);
+		Datum rvol = g_lingo->pop();
+		Datum lvol = g_lingo->pop();
+		Datum chan = g_lingo->pop();
+		g_lingo->pop();
+		xobj->leftrightvol(chan.asInt(), (uint8)lvol.asInt(), (uint8)rvol.asInt());
+		g_lingo->push(1);
+	} else if (cmdName == "fade") {
+		if (nargs < 3) {
+			warning("XSoundXFCN::fade: expected at least 2 args");
+			g_lingo->dropStack(nargs);
+			g_lingo->push(Datum());
+			return;
+		}
+		if (nargs > 5) {
+			warning("VoyagerXSoundXObj: dropping %d extra args", nargs - 5);
+			g_lingo->dropStack(nargs - 5);
+			nargs = 5;
+		}
+		bool autoStop = false;
+		int duration = 0;
+		if (nargs == 5) {
+			autoStop = (bool)g_lingo->pop().asInt();
+			nargs--;
+		}
+		if (nargs == 4) {
+			duration = g_lingo->pop().asInt();
+			nargs--;
+		}
+		int endVol = g_lingo->pop().asInt();
+		int chan = g_lingo->pop().asInt();
+		g_lingo->pop();
+
+		g_lingo->push(Datum(xobj->fade(chan, endVol, duration, autoStop)));
+	} else if (cmdName == "frequency") {
+		ARGNUMCHECK(3);
+		Datum percent = g_lingo->pop();
+		Datum chan = g_lingo->pop();
+		g_lingo->pop();
+		xobj->frequency(chan.asInt(), percent.asInt());
+		g_lingo->push(1);
+	} else if (cmdName == "pan") {
+		ARGNUMCHECK(3);
+		Datum percent = g_lingo->pop();
+		Datum chan = g_lingo->pop();
+		g_lingo->pop();
+		xobj->pan(chan.asInt(), percent.asInt());
+		g_lingo->push(1);
+	} else {
+		warning("XSoundXFCN: unknown command %s", cmdName.c_str());
+		g_lingo->dropStack(nargs);
+		g_lingo->push(Datum());
+		return;
+	}
+}
 
 }




More information about the Scummvm-git-logs mailing list