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

csnover csnover at users.noreply.github.com
Sat Sep 30 08:11:31 CEST 2017


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

Summary:
b2966f3fc8 SCI32: Fix support for RAMA demo
be37a62591 SCI: Fix printing of super calls on clones in debugger


Commit: b2966f3fc8b7bbf429373d9988ea1280660dc33b
    https://github.com/scummvm/scummvm/commit/b2966f3fc8b7bbf429373d9988ea1280660dc33b
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-30T01:08:12-05:00

Commit Message:
SCI32: Fix support for RAMA demo

Fixes Trac#10251.

Changed paths:
    engines/sci/engine/features.cpp
    engines/sci/engine/guest_additions.cpp
    engines/sci/engine/kernel_tables.h
    engines/sci/engine/kgraphics32.cpp
    engines/sci/engine/klists.cpp
    engines/sci/graphics/frameout.cpp
    engines/sci/graphics/screen_item32.cpp


diff --git a/engines/sci/engine/features.cpp b/engines/sci/engine/features.cpp
index f94ab8a..1297ba2 100644
--- a/engines/sci/engine/features.cpp
+++ b/engines/sci/engine/features.cpp
@@ -480,11 +480,12 @@ bool GameFeatures::autoDetectSci21KernelType() {
 		// don't have sounds at all, but they're using a SCI2 kernel
 		if (g_sci->getGameId() == GID_CHEST || g_sci->getGameId() == GID_KQUESTIONS) {
 			_sci21KernelType = SCI_VERSION_2;
-			return true;
+		} else if (g_sci->getGameId() == GID_RAMA && g_sci->isDemo()) {
+			_sci21KernelType = SCI_VERSION_2_1_MIDDLE;
+		} else {
+			warning("autoDetectSci21KernelType(): Sound object not loaded, assuming a SCI2.1 table");
+			_sci21KernelType = SCI_VERSION_2_1_EARLY;
 		}
-
-		warning("autoDetectSci21KernelType(): Sound object not loaded, assuming a SCI2.1 table");
-		_sci21KernelType = SCI_VERSION_2_1_EARLY;
 		return true;
 	}
 
diff --git a/engines/sci/engine/guest_additions.cpp b/engines/sci/engine/guest_additions.cpp
index d4e4102..06d8d9a 100644
--- a/engines/sci/engine/guest_additions.cpp
+++ b/engines/sci/engine/guest_additions.cpp
@@ -163,7 +163,7 @@ void GuestAdditions::writeVarHook(const int type, const int index, const reg_t v
 				syncAudioVolumeGlobalsToScummVM(index, value);
 			} else if (g_sci->getGameId() == GID_GK1) {
 				syncGK1StartupVolumeFromScummVM(index, value);
-			} else if (g_sci->getGameId() == GID_RAMA && index == kGlobalVarRamaMusicVolume) {
+			} else if (g_sci->getGameId() == GID_RAMA && !g_sci->isDemo() && index == kGlobalVarRamaMusicVolume) {
 				syncRamaVolumeFromScummVM((ConfMan.getInt("music_volume") + 1) * kRamaVolumeMax / Audio::Mixer::kMaxMixerVolume);
 			}
 
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index 797edee..b60d6cc 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -73,6 +73,7 @@ struct SciKernelMapSubEntry {
 #define SIG_SINCE_SCI21      SCI_VERSION_2_1_EARLY, SCI_VERSION_3
 #define SIG_SINCE_SCI21MID   SCI_VERSION_2_1_MIDDLE, SCI_VERSION_3
 #define SIG_SINCE_SCI21LATE  SCI_VERSION_2_1_LATE, SCI_VERSION_3
+#define SIG_SCI21LATE        SCI_VERSION_2_1_LATE, SCI_VERSION_2_1_LATE
 #define SIG_SCI3             SCI_VERSION_3, SCI_VERSION_3
 
 #define SIG_SCI16          SCI_VERSION_NONE, SCI_VERSION_1_1
@@ -898,7 +899,8 @@ static SciKernelMapEntry s_kernelMap[] = {
 	// our garbage collector (i.e. the SCI0-SCI1.1 semantics).
 	{ "Purge", kFlushResources,    SIG_EVERYWHERE,           "i",                     NULL,            NULL },
 	{ MAP_CALL(SetShowStyle),      SIG_THRU_SCI21MID, SIGFOR_ALL, "ioiiiii([ri])(i)", NULL,            NULL },
-	{ MAP_CALL(SetShowStyle),      SIG_SINCE_SCI21LATE, SIGFOR_ALL, "ioiiiiii(r)(i)", NULL,            NULL },
+	{ MAP_CALL(SetShowStyle),      SIG_SCI21LATE,     SIGFOR_ALL, "ioiiiii([ri])([ri])(i)", NULL,      NULL },
+	{ MAP_CALL(SetShowStyle),      SIG_SCI3,          SIGFOR_ALL, "ioiiiiii(r)(i)",   NULL,            NULL },
 	{ MAP_CALL(String),            SIG_EVERYWHERE,           "(.*)",                  kString_subops,  NULL },
 	{ MAP_CALL(UpdatePlane),       SIG_EVERYWHERE,           "o",                     NULL,            NULL },
 	{ MAP_CALL(UpdateScreenItem),  SIG_EVERYWHERE,           "o",                     NULL,            NULL },
diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp
index bed4a09..b7fae2e 100644
--- a/engines/sci/engine/kgraphics32.cpp
+++ b/engines/sci/engine/kgraphics32.cpp
@@ -76,7 +76,7 @@ reg_t kBaseSetter32(EngineState *s, int argc, reg_t *argv) {
 	CelObjView celObj(viewId, loopNo, celNo);
 
 	Ratio scaleX;
-	if (getSciVersion() < SCI_VERSION_3) {
+	if (getSciVersion() < SCI_VERSION_2_1_LATE) {
 		const int16 scriptWidth = g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth;
 		scaleX = Ratio(scriptWidth, celObj._xResolution);
 	}
@@ -418,7 +418,7 @@ reg_t kCelHigh32(EngineState *s, int argc, reg_t *argv) {
 	int16 celNo = argv[2].toSint16();
 	CelObjView celObj(resourceId, loopNo, celNo);
 	int16 height = celObj._height;
-	if (getSciVersion() < SCI_VERSION_3) {
+	if (getSciVersion() < SCI_VERSION_2_1_LATE) {
 		height = mulru(height, Ratio(g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight, celObj._yResolution));
 	}
 	return make_reg(0, height);
@@ -430,7 +430,7 @@ reg_t kCelWide32(EngineState *s, int argc, reg_t *argv) {
 	int16 celNo = argv[2].toSint16();
 	CelObjView celObj(resourceId, loopNo, celNo);
 	int16 width = celObj._width;
-	if (getSciVersion() < SCI_VERSION_3) {
+	if (getSciVersion() < SCI_VERSION_2_1_LATE) {
 		width = mulru(width, Ratio(g_sci->_gfxFrameout->getCurrentBuffer().scriptWidth, celObj._xResolution));
 	}
 	return make_reg(0, width);
diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp
index 2ca5a65..330b78b 100644
--- a/engines/sci/engine/klists.cpp
+++ b/engines/sci/engine/klists.cpp
@@ -835,6 +835,10 @@ reg_t kArrayGetSize(EngineState *s, int argc, reg_t *argv) {
 }
 
 reg_t kArrayGetElement(EngineState *s, int argc, reg_t *argv) {
+	if (getSciVersion() == SCI_VERSION_2_1_LATE) {
+		return kStringGetChar(s, argc, argv);
+	}
+
 	SciArray &array = *s->_segMan->lookupArray(argv[0]);
 	return array.getAsID(argv[1].toUint16());
 }
@@ -846,6 +850,10 @@ reg_t kArraySetElements(EngineState *s, int argc, reg_t *argv) {
 }
 
 reg_t kArrayFree(EngineState *s, int argc, reg_t *argv) {
+	if (getSciVersion() == SCI_VERSION_2_1_LATE && !s->_segMan->isValidAddr(argv[0], SEG_TYPE_ARRAY)) {
+		return s->r_acc;
+	}
+
 	s->_segMan->freeArray(argv[0]);
 	return s->r_acc;
 }
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 6ea4975..f2ae0df 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -1228,7 +1228,7 @@ bool GfxFrameout::isOnMe(const ScreenItem &screenItem, const Plane &plane, const
 		scaledPosition.x -= screenItem._scaledPosition.x;
 		scaledPosition.y -= screenItem._scaledPosition.y;
 
-		if (getSciVersion() < SCI_VERSION_3) {
+		if (getSciVersion() < SCI_VERSION_2_1_LATE) {
 			mulru(scaledPosition, Ratio(celObj._xResolution, _currentBuffer.screenWidth), Ratio(celObj._yResolution, _currentBuffer.screenHeight));
 		}
 
diff --git a/engines/sci/graphics/screen_item32.cpp b/engines/sci/graphics/screen_item32.cpp
index 5a35d30..14e7173 100644
--- a/engines/sci/graphics/screen_item32.cpp
+++ b/engines/sci/graphics/screen_item32.cpp
@@ -299,7 +299,7 @@ void ScreenItem::calcRects(const Plane &plane) {
 
 		Ratio celToScreenX;
 		Ratio celToScreenY;
-		if (getSciVersion() < SCI_VERSION_3) {
+		if (getSciVersion() < SCI_VERSION_2_1_LATE) {
 			celToScreenX = Ratio(screenWidth, celObj._xResolution);
 			celToScreenY = Ratio(screenHeight, celObj._yResolution);
 		}
@@ -311,7 +311,7 @@ void ScreenItem::calcRects(const Plane &plane) {
 			// high resolution coordinates
 
 			if (_useInsetRect) {
-				if (getSciVersion() < SCI_VERSION_3) {
+				if (getSciVersion() < SCI_VERSION_2_1_LATE) {
 					const Ratio scriptToCelX(celObj._xResolution, scriptWidth);
 					const Ratio scriptToCelY(celObj._yResolution, scriptHeight);
 					mulru(_screenItemRect, scriptToCelX, scriptToCelY, 0);
@@ -632,7 +632,7 @@ Common::Rect ScreenItem::getNowSeenRect(const Plane &plane) const {
 		// high resolution coordinates
 
 		if (_useInsetRect) {
-			if (getSciVersion() < SCI_VERSION_3) {
+			if (getSciVersion() < SCI_VERSION_2_1_LATE) {
 				const Ratio scriptToCelX(celObj._xResolution, scriptWidth);
 				const Ratio scriptToCelY(celObj._yResolution, scriptHeight);
 				mulru(nsRect, scriptToCelX, scriptToCelY, 0);
@@ -678,7 +678,7 @@ Common::Rect ScreenItem::getNowSeenRect(const Plane &plane) const {
 
 		Ratio celToScriptX;
 		Ratio celToScriptY;
-		if (getSciVersion() < SCI_VERSION_3) {
+		if (getSciVersion() < SCI_VERSION_2_1_LATE) {
 			celToScriptX = Ratio(scriptWidth, celObj._xResolution);
 			celToScriptY = Ratio(scriptHeight, celObj._yResolution);
 		}


Commit: be37a62591af98c379fd5f92fcab31b70a65ac6d
    https://github.com/scummvm/scummvm/commit/be37a62591af98c379fd5f92fcab31b70a65ac6d
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-30T01:08:12-05:00

Commit Message:
SCI: Fix printing of super calls on clones in debugger

Changed paths:
    engines/sci/engine/scriptdebug.cpp


diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index d46b630..bae1fb4 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -191,7 +191,7 @@ reg_t disassemble(EngineState *s, reg32_t pos, const Object *obj, bool printBWTa
 				debugN("\t%s[%x],", (param_value < kernel->_kernelFuncs.size()) ?
 							((param_value < kernel->getKernelNamesSize()) ? kernel->getKernelName(param_value).c_str() : "[Unknown(postulated)]")
 							: "<invalid>", param_value);
-			} else if (opcode == op_class) {
+			} else if (opcode == op_class || opcode == op_super) {
 				const reg_t classAddr = s->_segMan->getClassAddress(param_value, SCRIPT_GET_DONT_LOAD, retval.getSegment());
 				if (!classAddr.isNull()) {
 					debugN("\t%s", s->_segMan->getObjectName(classAddr));
@@ -199,15 +199,8 @@ reg_t disassemble(EngineState *s, reg32_t pos, const Object *obj, bool printBWTa
 				} else {
 					debugN(opsize ? "\t%02x" : "\t%04x", param_value);
 				}
-			} else if (opcode == op_super) {
-				if (obj != nullptr) {
-					debugN("\t%s", s->_segMan->getObjectName(obj->getSuperClassSelector()));
-					debugN(opsize ? "[%02x]" : "[%04x]", param_value);
-				} else {
-					debugN(opsize ? "\t%02x" : "\t%04x", param_value);
-				}
 
-				debugN(",");
+				debugN(", ");
 #ifdef ENABLE_SCI32
 			} else if (
 				opcode == op_pToa || opcode == op_aTop ||





More information about the Scummvm-git-logs mailing list