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

djsrv dservilla at gmail.com
Wed Jul 21 03:45:18 UTC 2021


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

Summary:
29e72bcc6d DIRECTOR: LINGO: Fix comment formatting
4bf08861ec DIRECTOR: LINGO: Move utility macros to lingo-utils.h
c2c6edd779 DIRECTOR: LINGO: Stub SoundJam XObject


Commit: 29e72bcc6d6e1af82136fae032eb17af29b0b8d7
    https://github.com/scummvm/scummvm/commit/29e72bcc6d6e1af82136fae032eb17af29b0b8d7
Author: djsrv (dservilla at gmail.com)
Date: 2021-07-20T23:43:17-04:00

Commit Message:
DIRECTOR: LINGO: Fix comment formatting

Changed paths:
    engines/director/lingo/xlibs/fplayxobj.cpp
    engines/director/lingo/xlibs/labeldrvxobj.cpp


diff --git a/engines/director/lingo/xlibs/fplayxobj.cpp b/engines/director/lingo/xlibs/fplayxobj.cpp
index 699a39d6a1..1a210e6993 100644
--- a/engines/director/lingo/xlibs/fplayxobj.cpp
+++ b/engines/director/lingo/xlibs/fplayxobj.cpp
@@ -21,11 +21,11 @@
  */
 
 /*************************************
-  *
-  * USED IN:
-  * Spaceship Warlock Mac
-  *
-  *************************************/
+ *
+ * USED IN:
+ * Spaceship Warlock Mac
+ *
+ *************************************/
 
 #include "director/director.h"
 #include "director/sound.h"
diff --git a/engines/director/lingo/xlibs/labeldrvxobj.cpp b/engines/director/lingo/xlibs/labeldrvxobj.cpp
index 45fa9fbd26..a058abad2a 100644
--- a/engines/director/lingo/xlibs/labeldrvxobj.cpp
+++ b/engines/director/lingo/xlibs/labeldrvxobj.cpp
@@ -20,12 +20,12 @@
  *
  */
 
- /*************************************
-  *
-  * USED IN:
-  * Meet Mediaband
-  *
-  *************************************/
+/*************************************
+ *
+ * USED IN:
+ * Meet Mediaband
+ *
+ *************************************/
 
 /*
 	-- LabelDrv XObject. Version 1.1 6/5/95 greg yachuk
@@ -34,7 +34,7 @@
 	X      mDispose      --Disposes of XObject instance.
 	XSS    mSetRange     --Sets the drive letters to begin and end the search for the label. Default is C..Z.
 	SS     mGetDrive     --Return the drive letter where the specified label is mounted.
- */
+*/
 
 #include "director/director.h"
 #include "director/lingo/lingo.h"


Commit: 4bf08861ec1693ff3abe7e4bc05020363b6735ed
    https://github.com/scummvm/scummvm/commit/4bf08861ec1693ff3abe7e4bc05020363b6735ed
Author: djsrv (dservilla at gmail.com)
Date: 2021-07-20T23:43:17-04:00

Commit Message:
DIRECTOR: LINGO: Move utility macros to lingo-utils.h

Changed paths:
  A engines/director/lingo/lingo-utils.h
    engines/director/lingo/lingo-builtins.cpp


diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 82aeb1490f..c1d72f8669 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -46,40 +46,10 @@
 #include "director/lingo/lingo-code.h"
 #include "director/lingo/lingo-codegen.h"
 #include "director/lingo/lingo-object.h"
+#include "director/lingo/lingo-utils.h"
 
 namespace Director {
 
-#define ARGNUMCHECK(n) \
-	if (nargs != (n)) { \
-		warning("%s: expected %d argument%s, got %d", __FUNCTION__, (n), ((n) == 1 ? "" : "s"), nargs); \
-		g_lingo->dropStack(nargs); \
-		return; \
-	}
-
-#define TYPECHECK(datum,t) \
-	if ((datum).type != (t)) { \
-		warning("%s: %s arg should be of type %s, not %s", __FUNCTION__, #datum, #t, (datum).type2str()); \
-		return; \
-	}
-
-#define TYPECHECK2(datum, t1, t2)	\
-	if ((datum).type != (t1) && (datum).type != (t2)) { \
-		warning("%s: %s arg should be of type %s or %s, not %s", __FUNCTION__, #datum, #t1, #t2, (datum).type2str()); \
-		return; \
-	}
-
-#define TYPECHECK3(datum, t1, t2, t3)	\
-	if ((datum).type != (t1) && (datum).type != (t2) && (datum).type != (t3)) { \
-		warning("%s: %s arg should be of type %s, %s, or %s, not %s", __FUNCTION__, #datum, #t1, #t2, #t3, (datum).type2str()); \
-		return; \
-	}
-
-#define ARRBOUNDSCHECK(idx,array) \
-	if ((idx)-1 < 0 || (idx) > (int)(array).u.farr->size()) { \
-		warning("%s: index out of bounds (%d of %d)", __FUNCTION__, (idx), (array).u.farr->size()); \
-		return; \
-	}
-
 static BuiltinProto builtins[] = {
 	// Math
 	{ "abs",			LB::b_abs,			1, 1, 200, FBLTIN },	// D2 function
diff --git a/engines/director/lingo/lingo-utils.h b/engines/director/lingo/lingo-utils.h
new file mode 100644
index 0000000000..2ff02a8219
--- /dev/null
+++ b/engines/director/lingo/lingo-utils.h
@@ -0,0 +1,57 @@
+/* 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef DIRECTOR_LINGO_LINGO_UTILS_H
+#define DIRECTOR_LINGO_LINGO_UTILS_H
+
+#define ARGNUMCHECK(n) \
+	if (nargs != (n)) { \
+		warning("%s: expected %d argument%s, got %d", __FUNCTION__, (n), ((n) == 1 ? "" : "s"), nargs); \
+		g_lingo->dropStack(nargs); \
+		return; \
+	}
+
+#define TYPECHECK(datum,t) \
+	if ((datum).type != (t)) { \
+		warning("%s: %s arg should be of type %s, not %s", __FUNCTION__, #datum, #t, (datum).type2str()); \
+		return; \
+	}
+
+#define TYPECHECK2(datum, t1, t2)	\
+	if ((datum).type != (t1) && (datum).type != (t2)) { \
+		warning("%s: %s arg should be of type %s or %s, not %s", __FUNCTION__, #datum, #t1, #t2, (datum).type2str()); \
+		return; \
+	}
+
+#define TYPECHECK3(datum, t1, t2, t3)	\
+	if ((datum).type != (t1) && (datum).type != (t2) && (datum).type != (t3)) { \
+		warning("%s: %s arg should be of type %s, %s, or %s, not %s", __FUNCTION__, #datum, #t1, #t2, #t3, (datum).type2str()); \
+		return; \
+	}
+
+#define ARRBOUNDSCHECK(idx,array) \
+	if ((idx)-1 < 0 || (idx) > (int)(array).u.farr->size()) { \
+		warning("%s: index out of bounds (%d of %d)", __FUNCTION__, (idx), (array).u.farr->size()); \
+		return; \
+	}
+
+#endif


Commit: c2c6edd779d3c30a3af6376c8de6bdd0d7453fa0
    https://github.com/scummvm/scummvm/commit/c2c6edd779d3c30a3af6376c8de6bdd0d7453fa0
Author: djsrv (dservilla at gmail.com)
Date: 2021-07-20T23:43:17-04:00

Commit Message:
DIRECTOR: LINGO: Stub SoundJam XObject

Changed paths:
  A engines/director/lingo/xlibs/soundjam.cpp
  A engines/director/lingo/xlibs/soundjam.h
    engines/director/lingo/lingo-object.cpp
    engines/director/module.mk


diff --git a/engines/director/lingo/lingo-object.cpp b/engines/director/lingo/lingo-object.cpp
index 44f54d9600..9b10410322 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -40,6 +40,7 @@
 #include "director/lingo/xlibs/fplayxobj.h"
 #include "director/lingo/xlibs/labeldrvxobj.h"
 #include "director/lingo/xlibs/palxobj.h"
+#include "director/lingo/xlibs/soundjam.h"
 #include "director/lingo/xlibs/winxobj.h"
 
 namespace Director {
@@ -115,6 +116,7 @@ static struct XLibProto {
 	{ "FPlayXObj",				FPlayXObj::initialize,				kXObj,					200 },	// D2
 	{ "PalXObj",				PalXObj:: initialize,				kXObj,					400 }, 	// D4
 	{ "LabelDrv",				LabelDrvXObj:: initialize,			kXObj,					400 }, 	// D4
+	{ "SoundJam",				SoundJam::initialize,				kXObj,					400 },	// D4
 	{ "winXObj",				RearWindowXObj::initialize,			kXObj,					400 },	// D4
 	{ 0, 0, 0, 0 }
 
diff --git a/engines/director/lingo/xlibs/soundjam.cpp b/engines/director/lingo/xlibs/soundjam.cpp
new file mode 100644
index 0000000000..9de3ebcef0
--- /dev/null
+++ b/engines/director/lingo/xlibs/soundjam.cpp
@@ -0,0 +1,163 @@
+/* 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*************************************
+ *
+ * USED IN:
+ * Meet MediaBand
+ *
+ *************************************/
+
+/*
+	-- SoundJam Copyright © Canter Technology 1995
+	SoundJam
+	II   mNew, numberOfChannels
+	ISI  mDefineFileSound, fullPathName, numberOfBeats
+	III  mDefineCastSound, castMemberNumber, numberOfBeats
+	II   mUndefineSound, soundID
+	III  mReadSome, soundID, byteCount
+	II   mStartSound, soundID
+	II   mSwitchNew, soundID
+	II   mSwitchParallel, soundID
+	I    mHasSwitchHappened
+	X    mToggleMute
+	X    mStop
+	X    mDispose
+*/
+
+#include "director/director.h"
+#include "director/lingo/lingo.h"
+#include "director/lingo/lingo-object.h"
+#include "director/lingo/lingo-utils.h"
+#include "director/lingo/xlibs/soundjam.h"
+
+namespace Director {
+
+static const char *xlibName = "SoundJam";
+
+static MethodProto xlibMethods[] = {
+	{ "new",				SoundJam::m_new,			 1, 1,	400 },
+	{ "defineFileSound",	SoundJam::m_defineFileSound, 2, 2,	400 },
+	{ "defineCastSound",	SoundJam::m_defineCastSound, 2, 2,	400 },
+	{ "undefineSound",		SoundJam::m_undefineSound,	 1, 1,	400 },
+	{ "readSome",			SoundJam::m_readSome,		 2, 2,	400 },
+	{ "startSound",			SoundJam::m_startSound,		 1, 1,	400 },
+	{ "switchNew",			SoundJam::m_switchNew,		 1, 1,	400 },
+	{ "switchParallel",		SoundJam::m_switchParallel,	 1, 1,	400 },
+	{ "hasSwitchHappened",	SoundJam::m_hasSwitchHappened, 0, 0, 400 },
+	{ "toggleMute",			SoundJam::m_toggleMute,		 0, 0,	400 },
+	{ "stop",				SoundJam::m_stop,			 0, 0,	400 },
+	{ 0, 0, 0, 0, 0 }
+};
+
+void SoundJam::initialize(int type) {
+	SoundJamObject::initMethods(xlibMethods);
+	if (type & kXObj) {
+		if (!g_lingo->_globalvars.contains(xlibName)) {
+			SoundJamObject *xobj = new SoundJamObject(kXObj);
+			g_lingo->_globalvars[xlibName] = xobj;
+		} else {
+			warning("SoundJam already initialized");
+		}
+	}
+}
+
+SoundJamObject::SoundJamObject(ObjectType objType) : Object<SoundJamObject>("SoundJam") {
+	_objType = objType;
+}
+
+void SoundJam::m_new(int nargs) {
+	ARGNUMCHECK(1);
+
+	/* Datum numberOfChannels = */ g_lingo->pop();
+
+	// Meet MediaBand seems to have fully working fallbacks to
+	// standard Lingo builtins, which it uses when SoundJam
+	// fails to initialize. So let's fail to initialize it...
+
+	g_lingo->push(-20023); // Indicates this version of Director does not support SoundJam
+
+	// If we discover that the standard builtins don't replicate
+	// everything SoundJam is used for, then we'll have to properly
+	// implement this.
+}
+
+void SoundJam::m_defineFileSound(int nargs) {
+	g_lingo->printSTUBWithArglist("SoundJam::m_defineFileSound", nargs);
+	g_lingo->dropStack(nargs);
+	g_lingo->push(Datum());
+}
+
+void SoundJam::m_defineCastSound(int nargs) {
+	g_lingo->printSTUBWithArglist("SoundJam::m_defineCastSound", nargs);
+	g_lingo->dropStack(nargs);
+	g_lingo->push(Datum());
+}
+
+void SoundJam::m_undefineSound(int nargs) {
+	g_lingo->printSTUBWithArglist("SoundJam::m_undefineSound", nargs);
+	g_lingo->dropStack(nargs);
+	g_lingo->push(Datum());
+}
+
+void SoundJam::m_readSome(int nargs) {
+	g_lingo->printSTUBWithArglist("SoundJam::m_readSome", nargs);
+	g_lingo->dropStack(nargs);
+	g_lingo->push(Datum());
+}
+
+void SoundJam::m_startSound(int nargs) {
+	g_lingo->printSTUBWithArglist("SoundJam::m_startSound", nargs);
+	g_lingo->dropStack(nargs);
+	g_lingo->push(Datum());
+}
+
+void SoundJam::m_switchNew(int nargs) {
+	g_lingo->printSTUBWithArglist("SoundJam::m_switchNew", nargs);
+	g_lingo->dropStack(nargs);
+	g_lingo->push(Datum());
+}
+
+void SoundJam::m_switchParallel(int nargs) {
+	g_lingo->printSTUBWithArglist("SoundJam::m_switchParallel", nargs);
+	g_lingo->dropStack(nargs);
+	g_lingo->push(Datum());
+}
+
+void SoundJam::m_hasSwitchHappened(int nargs) {
+	g_lingo->printSTUBWithArglist("SoundJam::m_hasSwitchHappened", nargs);
+	g_lingo->dropStack(nargs);
+	g_lingo->push(Datum());
+}
+
+void SoundJam::m_toggleMute(int nargs) {
+	g_lingo->printSTUBWithArglist("SoundJam::m_toggleMute", nargs);
+	g_lingo->dropStack(nargs);
+}
+
+void SoundJam::m_stop(int nargs) {
+	g_lingo->printSTUBWithArglist("SoundJam::m_stop", nargs);
+	g_lingo->dropStack(nargs);
+}
+
+} // End of namespace Director
+
diff --git a/engines/director/lingo/xlibs/soundjam.h b/engines/director/lingo/xlibs/soundjam.h
new file mode 100644
index 0000000000..cc3344c71d
--- /dev/null
+++ b/engines/director/lingo/xlibs/soundjam.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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef DIRECTOR_LINGO_XLIBS_SOUNDJAM_H
+#define DIRECTOR_LINGO_XLIBS_SOUNDJAM_H
+
+namespace Director {
+
+class SoundJamObject : public Object<SoundJamObject> {
+public:
+	SoundJamObject(ObjectType objType);
+};
+
+namespace SoundJam {
+
+void initialize(int type);
+
+void m_new(int nargs);
+void m_defineFileSound(int nargs);
+void m_defineCastSound(int nargs);
+void m_undefineSound(int nargs);
+void m_readSome(int nargs);
+void m_startSound(int nargs);
+void m_switchNew(int nargs);
+void m_switchParallel(int nargs);
+void m_hasSwitchHappened(int nargs);
+void m_toggleMute(int nargs);
+void m_stop(int nargs);
+
+} // End of namespace SoundJam
+
+} // End of namespace Director
+
+#endif
diff --git a/engines/director/module.mk b/engines/director/module.mk
index c15ae002b7..f8292454ce 100644
--- a/engines/director/module.mk
+++ b/engines/director/module.mk
@@ -42,6 +42,7 @@ MODULE_OBJS = \
 	lingo/xlibs/fplayxobj.o \
 	lingo/xlibs/labeldrvxobj.o \
 	lingo/xlibs/palxobj.o \
+	lingo/xlibs/soundjam.o \
 	lingo/xlibs/winxobj.o
 
 # HACK: Skip this when including the file for detection objects.




More information about the Scummvm-git-logs mailing list