[Scummvm-git-logs] scummvm master -> 630346855535d32c7686aae83f9612f5ae39c4da

csnover csnover at users.noreply.github.com
Sat Oct 15 02:52:55 CEST 2016


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

Summary:
699a147348 SCI: Make -propDict- unique for each class
a05ae2e24a SCI32: Fix slow transitions in SQ6
c3adfc065e SCI: Ensure export breakpoints always trigger on export calls
6303468555 SCI32: Fix mouse position clamping


Commit: 699a147348966dd5c12824b1e1c2b6c6e82bca41
    https://github.com/scummvm/scummvm/commit/699a147348966dd5c12824b1e1c2b6c6e82bca41
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2016-10-14T19:43:32-05:00

Commit Message:
SCI: Make -propDict- unique for each class

Previously, this was using the offset of the property dict inside the
script. However, this isn't unique. For example, SQ6's DPath and
PolyPath classes both have their property dict at offset 8 of their
respective scripts. This would break Obj::isMemberOf.

Closes #846.

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



diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp
index 26a7ff5..aef9cb1 100644
--- a/engines/sci/engine/script.cpp
+++ b/engines/sci/engine/script.cpp
@@ -1058,11 +1058,17 @@ void Script::initializeObjectsSci11(SegManager *segMan, SegmentId segmentId) {
 		obj->setSuperClassSelector(
 			segMan->getClassAddress(obj->getSuperClassSelector().getOffset(), SCRIPT_GET_LOCK, 0));
 
-		// If object is instance, get -propDict- from class and set it for this
-		// object. This is needed for ::isMemberOf() to work.
+		// -propDict- is used by Obj::isMemberOf to determine if an object
+		// is an instance of a class. For classes, we therefore relocate
+		// -propDict- to the script's segment. For instances, we copy
+		// -propDict- from its class.
 		// Example test case - room 381 of sq4cd - if isMemberOf() doesn't work,
-		// talk-clicks on the robot will act like clicking on ego
-		if (!obj->isClass()) {
+		// talk-clicks on the robot will act like clicking on ego.
+		if (obj->isClass()) {
+			reg_t propDict = obj->getPropDictSelector();
+			propDict.setSegment(segmentId);
+			obj->setPropDictSelector(propDict);
+		} else {
 			reg_t classObject = obj->getSuperClassSelector();
 			const Object *classObj = segMan->getObject(classObject);
 			obj->setPropDictSelector(classObj->getPropDictSelector());


Commit: a05ae2e24ae6dcbeb29c95e045141c9500c4d589
    https://github.com/scummvm/scummvm/commit/a05ae2e24ae6dcbeb29c95e045141c9500c4d589
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-10-14T19:43:47-05:00

Commit Message:
SCI32: Fix slow transitions in SQ6

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



diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index f2f290f..5ac4b75 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -4536,11 +4536,46 @@ static const SciScriptPatcherEntry sq5Signatures[] = {
 #pragma mark -
 #pragma mark Space Quest 6
 
+// After the explosion in the Quarters of Deepship 86, the game tries to perform
+// a dramatic long fade, but does this with an unreasonably large number of
+// divisions which takes tens of seconds to finish (because transitions are not
+// CPU-dependent in ScummVM).
+static const uint16 sq6SlowTransitionSignature1[] = {
+	SIG_MAGICDWORD,
+	0x38, SIG_UINT16(0x578), // pushi $0578
+	0x51, 0x33,              // class Styler
+	SIG_END
+};
+
+static const uint16 sq6SlowTransitionPatch1[] = {
+	0x38, SIG_UINT16(180), // pushi 180
+	PATCH_END
+};
+
+// For whatever reason, SQ6 sets the default number of transition divisions to
+// be a much larger value at startup (200 vs 30) if it thinks it is running in
+// Windows. Room 410 (eulogy room) also unconditionally resets divisions to the
+// larger value.
+static const uint16 sq6SlowTransitionSignature2[] = {
+	SIG_MAGICDWORD,
+	0x38, SIG_UINT16(0xc8), // pushi $c8
+	0x51, 0x33,             // class Styler
+	SIG_END
+};
+
+static const uint16 sq6SlowTransitionPatch2[] = {
+	0x38, SIG_UINT16(30), // pushi 30
+	PATCH_END
+};
+
 //          script, description,                                      signature                        patch
 static const SciScriptPatcherEntry sq6Signatures[] = {
+	{  true,     0, "fix slow transitions",                        1, sq6SlowTransitionSignature2,     sq6SlowTransitionPatch2 },
 	{  true,    15, "invalid array construction",                  1, sci21IntArraySignature,          sci21IntArrayPatch },
 	{  true,    22, "invalid array construction",                  1, sci21IntArraySignature,          sci21IntArrayPatch },
+	{  true,   410, "fix slow transitions",                        1, sq6SlowTransitionSignature2,     sq6SlowTransitionPatch2 },
 	{  true,   460, "invalid array construction",                  1, sci21IntArraySignature,          sci21IntArrayPatch },
+	{  true,   500, "fix slow transitions",                        1, sq6SlowTransitionSignature1,     sq6SlowTransitionPatch1 },
 	{  true,   510, "invalid array construction",                  1, sci21IntArraySignature,          sci21IntArrayPatch },
 	{  true, 64990, "increase number of save games",               1, sci2NumSavesSignature1,          sci2NumSavesPatch1 },
 	{  true, 64990, "increase number of save games",               1, sci2NumSavesSignature2,          sci2NumSavesPatch2 },


Commit: c3adfc065ea925fc6f7e0dccd8352f3d2c64e98a
    https://github.com/scummvm/scummvm/commit/c3adfc065ea925fc6f7e0dccd8352f3d2c64e98a
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-10-14T19:43:47-05:00

Commit Message:
SCI: Ensure export breakpoints always trigger on export calls

Previously, export calls to non-existing functions would act like
there was never an export call, and the breakpoint would never be
triggered.

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



diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 82de957..700b7d2 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -235,13 +235,13 @@ ExecStack *execute_method(EngineState *s, uint16 script, uint16 pubfunct, StackP
 		scr = s->_segMan->getScript(seg);
 	}
 
+	// Check if a breakpoint is set on this method
+	g_sci->checkExportBreakpoint(script, pubfunct);
+
 	uint32 exportAddr = scr->validateExportFunc(pubfunct, false);
 	if (!exportAddr)
 		return NULL;
 
-	// Check if a breakpoint is set on this method
-	g_sci->checkExportBreakpoint(script, pubfunct);
-
 	assert(argp[0].toUint16() == argc); // The first argument is argc
 	ExecStack xstack(calling_obj, calling_obj, sp, argc, argp,
 						seg, make_reg32(seg, exportAddr), -1, -1, -1, pubfunct, -1,


Commit: 630346855535d32c7686aae83f9612f5ae39c4da
    https://github.com/scummvm/scummvm/commit/630346855535d32c7686aae83f9612f5ae39c4da
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-10-14T19:52:21-05:00

Commit Message:
SCI32: Fix mouse position clamping

Changed paths:
    engines/sci/event.cpp



diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp
index 44ac7ef..e365296 100644
--- a/engines/sci/event.cpp
+++ b/engines/sci/event.cpp
@@ -173,20 +173,18 @@ SciEvent EventManager::getScummVMEvent() {
 	if (getSciVersion() >= SCI_VERSION_2) {
 		const Buffer &screen = g_sci->_gfxFrameout->getCurrentBuffer();
 
+		// This will clamp `mousePos` according to the restricted zone,
+		// so any cursor or screen item associated with the mouse position
+		// does not bounce when it hits the edge (or ignore the edge)
+		g_sci->_gfxCursor32->deviceMoved(mousePos);
+
 		Common::Point mousePosSci = mousePos;
 		mulru(mousePosSci, Ratio(screen.scriptWidth, screen.screenWidth), Ratio(screen.scriptHeight, screen.screenHeight));
 		noEvent.mousePosSci = input.mousePosSci = mousePosSci;
 
-		if (ev.type == Common::EVENT_MOUSEMOVE) {
-			// This will clamp `mousePos` according to the restricted zone,
-			// so any cursor or screen item associated with the mouse position
-			// does not bounce when it hits the edge (or ignore the edge)
-			g_sci->_gfxCursor32->deviceMoved(mousePos);
-			if (_hotRectanglesActive) {
-				checkHotRectangles(mousePosSci);
-			}
+		if (_hotRectanglesActive) {
+			checkHotRectangles(mousePosSci);
 		}
-
 	} else {
 #endif
 		g_sci->_gfxScreen->adjustBackUpscaledCoordinates(mousePos.y, mousePos.x);





More information about the Scummvm-git-logs mailing list