[Scummvm-git-logs] scummvm master -> 6fb19d1d0127c1e2c9fdc34950e76e1cce537ab9

bluegr bluegr at gmail.com
Sat Aug 25 11:45:00 CEST 2018


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

Summary:
66cbaeefe2 SCI32: Adapt the pathfinding debug code to work woth SCI32 games
941869c466 SCI32: Remove reg32_t and use reg_t in all cases
0101ac6f71 SCI: Add a default case to the switch in toDebugString()
a0bad913ae SCI32: Add a workaround for Shivers
d597fbc5e3 SCI32: Fix the walk region in Cazanoux's house in GK1
6fb19d1d01 SCI: Fix compilation when SCI32 is disabled


Commit: 66cbaeefe20967348bb5306272f937dba0281021
    https://github.com/scummvm/scummvm/commit/66cbaeefe20967348bb5306272f937dba0281021
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-25T12:39:12+03:00

Commit Message:
SCI32: Adapt the pathfinding debug code to work woth SCI32 games

Changed paths:
    engines/sci/engine/kpathing.cpp
    engines/sci/graphics/frameout.cpp
    engines/sci/graphics/frameout.h


diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp
index eb4d5d3..270f2e6 100644
--- a/engines/sci/engine/kpathing.cpp
+++ b/engines/sci/engine/kpathing.cpp
@@ -27,6 +27,10 @@
 #include "sci/graphics/paint16.h"
 #include "sci/graphics/palette.h"
 #include "sci/graphics/screen.h"
+#include "sci/graphics/paint32.h"
+#include "sci/graphics/palette32.h"
+#include "sci/graphics/plane32.h"
+#include "sci/graphics/frameout.h"
 
 #include "common/debug-channels.h"
 #include "common/list.h"
@@ -292,6 +296,7 @@ static Common::Point readPoint(SegmentRef list_r, int offset) {
 		point.x = list_r.reg[offset * 2].toUint16();
 		point.y = list_r.reg[offset * 2 + 1].toUint16();
 	}
+
 	return point;
 }
 
@@ -311,12 +316,19 @@ static void draw_line(EngineState *s, Common::Point p1, Common::Point p2, int ty
 	// Blue: Near-point access
 	// Red : Barred access
 	// Yellow: Contained access
-	int poly_colors[4] = {
-		g_sci->_gfxPalette16->kernelFindColor(0, 255, 0),	// green
-		g_sci->_gfxPalette16->kernelFindColor(0, 0, 255),	// blue
-		g_sci->_gfxPalette16->kernelFindColor(255, 0, 0),	// red
-		g_sci->_gfxPalette16->kernelFindColor(255, 255, 0)	// yellow
-	};
+	int poly_colors[4];
+	
+	if (getSciVersion() <= SCI_VERSION_1_1) {
+		poly_colors[0] = g_sci->_gfxPalette16->kernelFindColor(0, 255, 0);		// green
+		poly_colors[1] = g_sci->_gfxPalette16->kernelFindColor(0, 0, 255);		// blue
+		poly_colors[2] = g_sci->_gfxPalette16->kernelFindColor(255, 0, 0);		// red
+		poly_colors[3] = g_sci->_gfxPalette16->kernelFindColor(255, 255, 0);	// yellow
+	} else {
+		poly_colors[0] = g_sci->_gfxPalette32->matchColor(0, 255, 0);			// green
+		poly_colors[1] = g_sci->_gfxPalette32->matchColor(0, 0, 255);			// blue
+		poly_colors[2] = g_sci->_gfxPalette32->matchColor(255, 0, 0);			// red
+		poly_colors[3] = g_sci->_gfxPalette32->matchColor(255, 255, 0);			// yellow	
+	}
 
 	// Clip
 	// FIXME: Do proper line clipping
@@ -326,17 +338,28 @@ static void draw_line(EngineState *s, Common::Point p1, Common::Point p2, int ty
 	p2.y = CLIP<int16>(p2.y, 0, height - 1);
 
 	assert(type >= 0 && type <= 3);
-	g_sci->_gfxPaint16->kernelGraphDrawLine(p1, p2, poly_colors[type], 255, 255);
+
+	if (getSciVersion() <= SCI_VERSION_1_1) {
+		g_sci->_gfxPaint16->kernelGraphDrawLine(p1, p2, poly_colors[type], 255, 255);
+	} else {
+		Plane *topPlane = g_sci->_gfxFrameout->getTopVisiblePlane();
+		g_sci->_gfxPaint32->kernelAddLine(topPlane->_object, p1, p2, 255, poly_colors[type], kLineStyleSolid, 0, 1);
+	}
 }
 
 static void draw_point(EngineState *s, Common::Point p, int start, int width, int height) {
 	// Colors for starting and end point
 	// Green: End point
 	// Blue: Starting point
-	int point_colors[2] = {
-		g_sci->_gfxPalette16->kernelFindColor(0, 255, 0),	// green
-		g_sci->_gfxPalette16->kernelFindColor(0, 0, 255)		// blue
-	};
+	int point_colors[2];
+
+	if (getSciVersion() <= SCI_VERSION_1_1) {
+		point_colors[0] = g_sci->_gfxPalette16->kernelFindColor(0, 255, 0);	// green
+		point_colors[1] = g_sci->_gfxPalette16->kernelFindColor(0, 0, 255);	// blue
+	} else {
+		point_colors[0] = g_sci->_gfxPalette32->matchColor(0, 255, 0);		// green
+		point_colors[1] = g_sci->_gfxPalette32->matchColor(0, 0, 255);		// blue
+	}
 
 	Common::Rect rect = Common::Rect(p.x - 1, p.y - 1, p.x - 1 + 3, p.y - 1 + 3);
 
@@ -347,8 +370,15 @@ static void draw_point(EngineState *s, Common::Point p, int start, int width, in
 	rect.right = CLIP<int16>(rect.right, 0, width - 1);
 
 	assert(start >= 0 && start <= 1);
-	if (g_sci->_gfxPaint16)
+	if (getSciVersion() <= SCI_VERSION_1_1) {
 		g_sci->_gfxPaint16->kernelGraphFrameBox(rect, point_colors[start]);
+	} else {
+		Plane *topPlane = g_sci->_gfxFrameout->getTopVisiblePlane();
+		g_sci->_gfxPaint32->kernelAddLine(topPlane->_object, Common::Point(rect.left, rect.top), Common::Point(rect.right, rect.top), 255, point_colors[start], kLineStyleSolid, 0, 1);
+		g_sci->_gfxPaint32->kernelAddLine(topPlane->_object, Common::Point(rect.right, rect.top), Common::Point(rect.right, rect.bottom), 255, point_colors[start], kLineStyleSolid, 0, 1);
+		g_sci->_gfxPaint32->kernelAddLine(topPlane->_object, Common::Point(rect.left, rect.bottom), Common::Point(rect.right, rect.bottom), 255, point_colors[start], kLineStyleSolid, 0, 1);
+		g_sci->_gfxPaint32->kernelAddLine(topPlane->_object, Common::Point(rect.left, rect.top), Common::Point(rect.left, rect.bottom), 255, point_colors[start], kLineStyleSolid, 0, 1);
+	}
 }
 
 static void draw_polygon(EngineState *s, reg_t polygon, int width, int height) {
@@ -1538,10 +1568,12 @@ reg_t kAvoidPath(EngineState *s, int argc, reg_t *argv) {
 			}
 
 			// Update the whole screen
-			g_sci->_gfxScreen->copyToScreen();
-			g_system->updateScreen();
-			if (!g_sci->_gfxPaint16)
-				g_system->delayMillis(2500);
+			if (getSciVersion() <= SCI_VERSION_1_1) {
+				g_sci->_gfxScreen->copyToScreen();
+				g_system->updateScreen();
+			} else {
+				g_sci->_gfxFrameout->kernelFrameOut(true);
+			}
 		}
 
 		PathfindingState *p = convert_polygon_set(s, poly_list, start, end, width, height, opt);
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 434c5a0..505e206 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -1354,6 +1354,16 @@ void GfxFrameout::remapMarkRedraw() {
 #pragma mark -
 #pragma mark Debugging
 
+Plane *GfxFrameout::getTopVisiblePlane() {
+	for (PlaneList::const_iterator it = _visiblePlanes.begin(); it != _visiblePlanes.end(); ++it) {
+		Plane *p = *it;
+		if (p->_type == kPlaneTypePicture)
+			return p;
+	}
+
+	return nullptr;
+}
+
 void GfxFrameout::printPlaneListInternal(Console *con, const PlaneList &planeList) const {
 	for (PlaneList::const_iterator it = planeList.begin(); it != planeList.end(); ++it) {
 		Plane *p = *it;
diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h
index eddf88f..f67d531 100644
--- a/engines/sci/graphics/frameout.h
+++ b/engines/sci/graphics/frameout.h
@@ -288,6 +288,8 @@ public:
 	 */
 	void shakeScreen(const int16 numShakes, const ShakeDirection direction);
 
+	Plane *getTopVisiblePlane();
+
 private:
 	/**
 	 * The last time the hardware screen was updated.


Commit: 941869c466354356c7ebf76e5c6fe37fe06785cf
    https://github.com/scummvm/scummvm/commit/941869c466354356c7ebf76e5c6fe37fe06785cf
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-25T12:39:12+03:00

Commit Message:
SCI32: Remove reg32_t and use reg_t in all cases

reg32_t was a transitive solution, before reg_t's were
adapted to use 32-bit addresses internally, and before
support for SCI3 was added. It was introduced as another
way to handle large script offsets in SCI3, and was only
used for the program counter (PC). It's no longer
needed, as we now support SCI3 script offsets using
reg_t's, so we can use make_reg32 in all cases where
we need to access offsets over 64KB

Changed paths:
    engines/sci/console.cpp
    engines/sci/console.h
    engines/sci/debug.h
    engines/sci/engine/kscripts.cpp
    engines/sci/engine/object.cpp
    engines/sci/engine/object.h
    engines/sci/engine/script.cpp
    engines/sci/engine/scriptdebug.cpp
    engines/sci/engine/vm.cpp
    engines/sci/engine/vm.h
    engines/sci/engine/vm_types.h
    engines/sci/sci.h


diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 9e7b017..371ed7f 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -4576,14 +4576,10 @@ static int parse_reg_t(EngineState *s, const char *str, reg_t *dest, bool mayBeV
 		relativeOffset = true;
 
 		if (!scumm_strnicmp(str + 1, "PC", 2)) {
-			reg32_t pc = s->_executionStack.back().addr.pc;
-			dest->setSegment(pc.getSegment());
-			dest->setOffset(pc.getOffset());
+			*dest = s->_executionStack.back().addr.pc;
 			offsetStr = str + 3;
 		} else if (!scumm_strnicmp(str + 1, "P", 1)) {
-			reg32_t pc = s->_executionStack.back().addr.pc;
-			dest->setSegment(pc.getSegment());
-			dest->setOffset(pc.getOffset());
+			*dest = s->_executionStack.back().addr.pc;;
 			offsetStr = str + 2;
 		} else if (!scumm_strnicmp(str + 1, "PREV", 4)) {
 			*dest = s->r_prev;
diff --git a/engines/sci/console.h b/engines/sci/console.h
index d5b80b6..02c6335 100644
--- a/engines/sci/console.h
+++ b/engines/sci/console.h
@@ -33,7 +33,7 @@ namespace Sci {
 class SciEngine;
 struct List;
 
-reg_t disassemble(EngineState *s, reg32_t pos, const Object *obj, bool printBWTag, bool printBytecode);
+reg_t disassemble(EngineState *s, reg_t pos, const Object *obj, bool printBWTag, bool printBytecode);
 bool isJumpOpcode(EngineState *s, reg_t pos, reg_t& jumpOffset);
 
 class Console : public GUI::Debugger {
diff --git a/engines/sci/debug.h b/engines/sci/debug.h
index cd1d809..f0572a9 100644
--- a/engines/sci/debug.h
+++ b/engines/sci/debug.h
@@ -58,7 +58,7 @@ enum BreakpointAction {
 struct Breakpoint {
 	BreakpointType _type;
 	uint32 _address;     ///< Breakpoints on exports
-	reg32_t _regAddress; ///< Breakpoints on addresses
+	reg_t _regAddress; ///< Breakpoints on addresses
 	Common::String _name; ///< Breakpoints on selector names
 	BreakpointAction _action;
 };
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp
index 26dbe9b..61b0f16 100644
--- a/engines/sci/engine/kscripts.cpp
+++ b/engines/sci/engine/kscripts.cpp
@@ -298,10 +298,7 @@ reg_t kScriptID(EngineState *s, int argc, reg_t *argv) {
 		s->variables[VAR_GLOBAL][kGlobalVarSpeed] = make_reg(0, 6);
 	}
 
-	reg_t addr;
-	addr.setSegment(scriptSeg);
-	addr.setOffset(address);
-	return addr;
+	return make_reg32(scriptSeg, address);
 }
 
 reg_t kDisposeScript(EngineState *s, int argc, reg_t *argv) {
diff --git a/engines/sci/engine/object.cpp b/engines/sci/engine/object.cpp
index 8873812..98069b4 100644
--- a/engines/sci/engine/object.cpp
+++ b/engines/sci/engine/object.cpp
@@ -152,8 +152,7 @@ void Object::init(const Script &owner, reg_t obj_pos, bool initVariables) {
 		const uint32 nameOffset = _propertyOffsetsSci3[0];
 		const uint32 relocOffset = owner.getRelocationOffset(nameOffset);
 		if (relocOffset != kNoRelocation) {
-			_name.setSegment(obj_pos.getSegment());
-			_name.setOffset(relocOffset + buf.getUint16SEAt(nameOffset));
+			_name = make_reg32(obj_pos.getSegment(), relocOffset + buf.getUint16SEAt(nameOffset));
 		}
 #endif
 	}
diff --git a/engines/sci/engine/object.h b/engines/sci/engine/object.h
index 9ab6ca3..7b65cc6 100644
--- a/engines/sci/engine/object.h
+++ b/engines/sci/engine/object.h
@@ -233,10 +233,7 @@ public:
 	 * @returns A pointer to the code for the method at the given index.
 	 */
 	reg_t getFunction(const uint16 index) const {
-		reg_t addr;
-		addr.setSegment(_pos.getSegment());
-		addr.setOffset(_baseMethod[index * 2 + 1]);
-		return addr;
+		return make_reg32(_pos.getSegment(), _baseMethod[index * 2 + 1]);
 	}
 
 	/**
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp
index 94c0c72..0dea692 100644
--- a/engines/sci/engine/script.cpp
+++ b/engines/sci/engine/script.cpp
@@ -1060,11 +1060,7 @@ void Script::initializeClasses(SegManager *segMan) {
 				error("Invalid species %d(0x%x) unknown max %d(0x%x) while instantiating script %d",
 						  species, species, segMan->classTableSize(), segMan->classTableSize(), _nr);
 
-			SegmentId segmentId = segMan->getScriptSegment(_nr);
-			reg_t classOffset;
-			classOffset.setSegment(segmentId);
-			classOffset.setOffset(classpos);
-			segMan->setClassOffset(species, classOffset);
+			segMan->setClassOffset(species, make_reg32(segMan->getScriptSegment(_nr), classpos));
 		}
 
 		seeker += seeker.getUint16SEAt(2) * mult;
@@ -1195,14 +1191,7 @@ void Script::initializeObjectsSci3(SegManager *segMan, SegmentId segmentId) {
 	SciSpan<const byte> seeker = getSci3ObjectsPointer();
 
 	while (seeker.getUint16SEAt(0) == SCRIPT_OBJECT_MAGIC_NUMBER) {
-		// We call setSegment and setOffset directly here, instead of using
-		// make_reg, as in large scripts, seeker - _buf can be larger than
-		// a 16-bit integer
-		reg_t reg;
-		reg.setSegment(segmentId);
-		reg.setOffset(seeker - *_buf);
-
-		Object *obj = scriptObjInit(reg);
+		Object *obj = scriptObjInit(make_reg32(segmentId, seeker - *_buf));
 		obj->setSuperClassSelector(segMan->getClassAddress(obj->getSuperClassSelector().getOffset(), SCRIPT_GET_LOCK, 0));
 		seeker += seeker.getUint16SEAt(2);
 	}
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index b4dcbef..f884e4d 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -81,12 +81,10 @@ void DebugState::updateActiveBreakpointTypes() {
 }
 
 // Disassembles one command from the heap, returns address of next command or 0 if a ret was encountered.
-reg_t disassemble(EngineState *s, reg32_t pos, const Object *obj, bool printBWTag, bool printBytecode) {
+reg_t disassemble(EngineState *s, reg_t pos, const Object *obj, bool printBWTag, bool printBytecode) {
 	SegmentObj *mobj = s->_segMan->getSegment(pos.getSegment(), SEG_TYPE_SCRIPT);
 	Script *script_entity = NULL;
-	reg_t retval;
-	retval.setSegment(pos.getSegment());
-	retval.setOffset(pos.getOffset() + 1);
+	reg_t retval = make_reg32(pos.getSegment(), pos.getOffset() + 1);
 	uint16 param_value = 0xffff; // Suppress GCC warning by setting default value, chose value as invalid to getKernelName etc.
 	uint i = 0;
 	Kernel *kernel = g_sci->getKernel();
@@ -261,9 +259,7 @@ reg_t disassemble(EngineState *s, reg32_t pos, const Object *obj, bool printBWTa
 			}
 
 			const uint32 offset = findOffset(param_value, script_entity, pos.getOffset() + bytecount);
-			reg_t addr;
-			addr.setSegment(retval.getSegment());
-			addr.setOffset(offset);
+			reg_t addr = make_reg32(retval.getSegment(), offset);
 			if (!s->_segMan->isObject(addr)) {
 				debugN("\t\"%s\"", s->_segMan->derefString(addr));
 			} else {
@@ -438,7 +434,7 @@ void SciEngine::scriptDebug() {
 		}
 
 		if (_debugState.seeking != kDebugSeekNothing) {
-			const reg32_t pc = s->xs->addr.pc;
+			const reg_t pc = s->xs->addr.pc;
 			SegmentObj *mobj = s->_segMan->getSegment(pc.getSegment(), SEG_TYPE_SCRIPT);
 
 			if (mobj) {
@@ -762,7 +758,7 @@ bool SciEngine::checkExportBreakpoint(uint16 script, uint16 pubfunct) {
 	return found;
 }
 
-bool SciEngine::checkAddressBreakpoint(const reg32_t &address) {
+bool SciEngine::checkAddressBreakpoint(const reg_t &address) {
 	if (!(_debugState._activeBreakpointTypes & BREAK_ADDRESS))
 		return false;
 
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index fb010ad..d5bcb63c 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -292,7 +292,7 @@ ExecStack *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, StackPt
 
 		ExecStackType stackType = EXEC_STACK_TYPE_VARSELECTOR;
 		StackPtr curSP = NULL;
-		reg32_t curFP = make_reg32(0, 0);
+		reg_t curFP = make_reg32(0, 0);
 		if (selectorType == kSelectorMethod) {
 			stackType = EXEC_STACK_TYPE_CALL;
 			curSP = sp;
diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h
index 0da48a4..9cb88e3 100644
--- a/engines/sci/engine/vm.h
+++ b/engines/sci/engine/vm.h
@@ -83,7 +83,7 @@ struct ExecStack {
 
 	union {
 		ObjVarRef varp; // Variable pointer for r/w access
-		reg32_t pc;       // Pointer to the initial program counter. Not accurate for the TOS element
+		reg_t pc;       // Pointer to the initial program counter. Not accurate for the TOS element
 	} addr;
 
 	StackPtr fp; // Frame pointer
@@ -105,7 +105,7 @@ struct ExecStack {
 	reg_t* getVarPointer(SegManager *segMan) const;
 
 	ExecStack(reg_t objp_, reg_t sendp_, StackPtr sp_, int argc_, StackPtr argp_,
-				SegmentId localsSegment_, reg32_t pc_, Selector debugSelector_,
+				SegmentId localsSegment_, reg_t pc_, Selector debugSelector_,
 				int debugKernelFunction_, int debugKernelSubFunction_,
 				int debugExportId_, int debugLocalCallOffset_, int debugOrigin_,
 				ExecStackType type_) {
diff --git a/engines/sci/engine/vm_types.h b/engines/sci/engine/vm_types.h
index c3922b2..9af979a 100644
--- a/engines/sci/engine/vm_types.h
+++ b/engines/sci/engine/vm_types.h
@@ -179,51 +179,15 @@ static inline reg_t make_reg(SegmentId segment, uint16 offset) {
 	return r;
 }
 
-#define PRINT_REG(r) (kSegmentMask) & (unsigned) (r).getSegment(), (unsigned) (r).getOffset()
-
-// A true 32-bit reg_t
-struct reg32_t {
-	// Segment and offset. These should never be accessed directly
-	SegmentId _segment;
-	uint32 _offset;
-
-	inline SegmentId getSegment() const {
-		return _segment;
-	}
-
-	inline void setSegment(SegmentId segment) {
-		_segment = segment;
-	}
-
-	inline uint32 getOffset() const {
-		return _offset;
-	}
-
-	inline void setOffset(uint32 offset) {
-		_offset = offset;
-	}
-
-	inline void incOffset(int32 offset) {
-		setOffset(getOffset() + offset);
-	}
-
-	// Comparison operators
-	bool operator==(const reg32_t &x) const {
-		return (getOffset() == x.getOffset()) && (getSegment() == x.getSegment());
-	}
-
-	bool operator!=(const reg32_t &x) const {
-		return (getOffset() != x.getOffset()) || (getSegment() != x.getSegment());
-	}
-};
-
-static inline reg32_t make_reg32(SegmentId segment, uint32 offset) {
-	reg32_t r;
+static inline reg_t make_reg32(SegmentId segment, uint32 offset) {
+	reg_t r;
 	r.setSegment(segment);
 	r.setOffset(offset);
 	return r;
 }
 
+#define PRINT_REG(r) (kSegmentMask) & (unsigned) (r).getSegment(), (unsigned) (r).getOffset()
+
 // Stack pointer type
 typedef reg_t *StackPtr;
 
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index 6245d18..09b1f8f 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -316,7 +316,7 @@ public:
 	void scriptDebug();
 	bool checkExportBreakpoint(uint16 script, uint16 pubfunct);
 	bool checkSelectorBreakpoint(BreakpointType breakpointType, reg_t send_obj, int selector);
-	bool checkAddressBreakpoint(const reg32_t &address);
+	bool checkAddressBreakpoint(const reg_t &address);
 
 public:
 	bool checkKernelBreakpoint(const Common::String &name);


Commit: 0101ac6f7172682397c3a525c67cd6c23b95d11e
    https://github.com/scummvm/scummvm/commit/0101ac6f7172682397c3a525c67cd6c23b95d11e
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-25T12:39:13+03:00

Commit Message:
SCI: Add a default case to the switch in toDebugString()

Silences a false positive in MSVC

Changed paths:
    engines/sci/engine/segment.h


diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h
index 9a921d6..8df3653 100644
--- a/engines/sci/engine/segment.h
+++ b/engines/sci/engine/segment.h
@@ -884,6 +884,7 @@ public:
 			type = "string";
 			break;
 		case kArrayTypeInvalid:
+		default:
 			type = "invalid";
 			break;
 		}


Commit: a0bad913aef7f3b9c879e82064f62f1f6584d1a3
    https://github.com/scummvm/scummvm/commit/a0bad913aef7f3b9c879e82064f62f1f6584d1a3
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-25T12:39:13+03:00

Commit Message:
SCI32: Add a workaround for Shivers

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


diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 3e9c463..f2d4662 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -324,6 +324,7 @@ const SciWorkaroundEntry uninitializedReadForParamWorkarounds[] = {
 	{ GID_HOYLE5,         -1,    15, -1,               "Hand", "add",                             NULL,     1,     1,{ WORKAROUND_FAKE,   0 } }, // When the game adds cards to your hand in any mini-game
 	{ GID_PHANTASMAGORIA2,-1, 64926,  0,              "Thumb", "action",                          NULL,     1,     1,{ WORKAROUND_FAKE,   0 } }, // When dragging one of the volume sliders and releasing the mouse button over the +/- buttons
 	{ GID_PHANTASMAGORIA2,-1, 63019,  0,     "WynDocTextView", "cue",                             NULL,     2,     2,{ WORKAROUND_FAKE,   0 } }, // When dragging the slider next to an e-mail message
+	{ GID_SHIVERS,        -1, 64918,  0,                "Str", "strip",                           NULL,     1,     1,{ WORKAROUND_FAKE,   0 } }, // When starting a new game and entering a name
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 


Commit: d597fbc5e3fb5817f680a70e8ef77ed8d337bc3d
    https://github.com/scummvm/scummvm/commit/d597fbc5e3fb5817f680a70e8ef77ed8d337bc3d
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-25T12:39:14+03:00

Commit Message:
SCI32: Fix the walk region in Cazanoux's house in GK1

Fixes bug #9770

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 5593123..f2e1bb1 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -1192,6 +1192,39 @@ static const uint16 gk1InterrogationBugPatch[] = {
 	PATCH_END
 };
 
+// In Madame Cazanoux's house, when Gabriel is leaving, he is placed on
+// the edge of the walkable area initially. This leads to a failure in
+// the pathfinding algorithm, and the pathfinding area is then ignored,
+// so Gabriel goes straight to the door by walking through the wall.
+// This is an edge case, which was apparently acceptable in SSCI. We
+// change the upper border of the walk area slightly, so that Gabriel
+// can be placed inside, and the pathfinding algorithm works correctly.
+static const uint16 gk1CazanouxPathfindingSignature[] = {
+	SIG_MAGICDWORD,
+	0x78,                            // push1 x = 1
+	0x38, SIG_UINT16(0x90, 0x00),    // pushi y = 144
+	0x38, SIG_UINT16(0xf6, 0x00),    // pushi x = 246
+	0x38, SIG_UINT16(0x92, 0x00),    // pushi y = 146
+	0x38, SIG_UINT16(0xf2, 0x00),    // pushi x = 242
+	0x39, 0x69,                      // pushi y = 105
+	0x39, 0x7c,                      // pushi x = 124
+	0x39, 0x68,                      // pushi y = 104
+	0x39, 0x56,                      // pushi x = 86
+	0x39, 0x6f,                      // pushi y = 111
+	0x39, 0x45,                      // pushi x = 69
+	0x39, 0x7c,                      // pushi y = 124
+	0x39, 0x2e,                      // pushi x = 46
+	0x38, SIG_UINT16(0x81, 0x00),    // pushi y = 129
+	SIG_END
+};
+
+static const uint16 gk1CazanouxPathfindingPatch[] = {
+	PATCH_ADDTOOFFSET(+15),
+	0x39, 0x7c,                      // pushi x = 124
+	0x39, 0x67,                      // pushi y = 103 (was 104)
+	PATCH_END
+};
+
 //          script, description,                                      signature                         patch
 static const SciScriptPatcherEntry gk1Signatures[] = {
 	{  true,    51, "fix interrogation bug",                       1, gk1InterrogationBugSignature,     gk1InterrogationBugPatch },
@@ -1200,6 +1233,7 @@ static const SciScriptPatcherEntry gk1Signatures[] = {
 	{  true,   230, "fix day 6 police beignet timer issue (1/2)",  1, gk1Day6PoliceBeignetSignature1,   gk1Day6PoliceBeignetPatch1 },
 	{  true,   230, "fix day 6 police beignet timer issue (2/2)",  1, gk1Day6PoliceBeignetSignature2,   gk1Day6PoliceBeignetPatch2 },
 	{  true,   230, "fix day 6 police sleep timer issue",          1, gk1Day6PoliceSleepSignature,      gk1Day6PoliceSleepPatch },
+	{  true,   280, "fix pathfinding in Madame Cazanoux's house",  1, gk1CazanouxPathfindingSignature,  gk1CazanouxPathfindingPatch },
 	{  true,   710, "fix day 9 vine swing speech playing",         1, gk1Day9VineSwingSignature,        gk1Day9VineSwingPatch },
 	{  true, 64908, "disable video benchmarking",                  1, sci2BenchmarkSignature,           sci2BenchmarkPatch },
 	{  true, 64990, "increase number of save games (1/2)",         1, sci2NumSavesSignature1,           sci2NumSavesPatch1 },


Commit: 6fb19d1d0127c1e2c9fdc34950e76e1cce537ab9
    https://github.com/scummvm/scummvm/commit/6fb19d1d0127c1e2c9fdc34950e76e1cce537ab9
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-25T12:44:13+03:00

Commit Message:
SCI: Fix compilation when SCI32 is disabled

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


diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp
index 270f2e6..fc0d24f 100644
--- a/engines/sci/engine/kpathing.cpp
+++ b/engines/sci/engine/kpathing.cpp
@@ -27,10 +27,12 @@
 #include "sci/graphics/paint16.h"
 #include "sci/graphics/palette.h"
 #include "sci/graphics/screen.h"
+#ifdef ENABLE_SCI32
 #include "sci/graphics/paint32.h"
 #include "sci/graphics/palette32.h"
 #include "sci/graphics/plane32.h"
 #include "sci/graphics/frameout.h"
+#endif
 
 #include "common/debug-channels.h"
 #include "common/list.h"
@@ -316,18 +318,20 @@ static void draw_line(EngineState *s, Common::Point p1, Common::Point p2, int ty
 	// Blue: Near-point access
 	// Red : Barred access
 	// Yellow: Contained access
-	int poly_colors[4];
+	int poly_colors[4] = { 0, 0, 0, 0 };
 	
 	if (getSciVersion() <= SCI_VERSION_1_1) {
 		poly_colors[0] = g_sci->_gfxPalette16->kernelFindColor(0, 255, 0);		// green
 		poly_colors[1] = g_sci->_gfxPalette16->kernelFindColor(0, 0, 255);		// blue
 		poly_colors[2] = g_sci->_gfxPalette16->kernelFindColor(255, 0, 0);		// red
 		poly_colors[3] = g_sci->_gfxPalette16->kernelFindColor(255, 255, 0);	// yellow
+#ifdef ENABLE_SCI32
 	} else {
 		poly_colors[0] = g_sci->_gfxPalette32->matchColor(0, 255, 0);			// green
 		poly_colors[1] = g_sci->_gfxPalette32->matchColor(0, 0, 255);			// blue
 		poly_colors[2] = g_sci->_gfxPalette32->matchColor(255, 0, 0);			// red
 		poly_colors[3] = g_sci->_gfxPalette32->matchColor(255, 255, 0);			// yellow	
+#endif
 	}
 
 	// Clip
@@ -341,9 +345,11 @@ static void draw_line(EngineState *s, Common::Point p1, Common::Point p2, int ty
 
 	if (getSciVersion() <= SCI_VERSION_1_1) {
 		g_sci->_gfxPaint16->kernelGraphDrawLine(p1, p2, poly_colors[type], 255, 255);
+#ifdef ENABLE_SCI32
 	} else {
 		Plane *topPlane = g_sci->_gfxFrameout->getTopVisiblePlane();
 		g_sci->_gfxPaint32->kernelAddLine(topPlane->_object, p1, p2, 255, poly_colors[type], kLineStyleSolid, 0, 1);
+#endif
 	}
 }
 
@@ -351,14 +357,16 @@ static void draw_point(EngineState *s, Common::Point p, int start, int width, in
 	// Colors for starting and end point
 	// Green: End point
 	// Blue: Starting point
-	int point_colors[2];
+	int point_colors[2] = { 0, 0 };
 
 	if (getSciVersion() <= SCI_VERSION_1_1) {
 		point_colors[0] = g_sci->_gfxPalette16->kernelFindColor(0, 255, 0);	// green
 		point_colors[1] = g_sci->_gfxPalette16->kernelFindColor(0, 0, 255);	// blue
+#ifdef ENABLE_SCI32
 	} else {
 		point_colors[0] = g_sci->_gfxPalette32->matchColor(0, 255, 0);		// green
 		point_colors[1] = g_sci->_gfxPalette32->matchColor(0, 0, 255);		// blue
+#endif
 	}
 
 	Common::Rect rect = Common::Rect(p.x - 1, p.y - 1, p.x - 1 + 3, p.y - 1 + 3);
@@ -372,12 +380,14 @@ static void draw_point(EngineState *s, Common::Point p, int start, int width, in
 	assert(start >= 0 && start <= 1);
 	if (getSciVersion() <= SCI_VERSION_1_1) {
 		g_sci->_gfxPaint16->kernelGraphFrameBox(rect, point_colors[start]);
+#ifdef ENABLE_SCI32
 	} else {
 		Plane *topPlane = g_sci->_gfxFrameout->getTopVisiblePlane();
 		g_sci->_gfxPaint32->kernelAddLine(topPlane->_object, Common::Point(rect.left, rect.top), Common::Point(rect.right, rect.top), 255, point_colors[start], kLineStyleSolid, 0, 1);
 		g_sci->_gfxPaint32->kernelAddLine(topPlane->_object, Common::Point(rect.right, rect.top), Common::Point(rect.right, rect.bottom), 255, point_colors[start], kLineStyleSolid, 0, 1);
 		g_sci->_gfxPaint32->kernelAddLine(topPlane->_object, Common::Point(rect.left, rect.bottom), Common::Point(rect.right, rect.bottom), 255, point_colors[start], kLineStyleSolid, 0, 1);
 		g_sci->_gfxPaint32->kernelAddLine(topPlane->_object, Common::Point(rect.left, rect.top), Common::Point(rect.left, rect.bottom), 255, point_colors[start], kLineStyleSolid, 0, 1);
+#endif
 	}
 }
 





More information about the Scummvm-git-logs mailing list