[Scummvm-git-logs] scummvm master -> 4b4b8a281b67bf5e739e376ec0a34d2bedbba4d7

csnover csnover at users.noreply.github.com
Mon Dec 12 22:23:16 CET 2016


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:
be14778b2b SCI: Ensure bytecode/BWT for "file" op is also printed
8477e61ad0 SCI32: Add workaround for hearts game in Hoyle5
4b4b8a281b SCI32: Adjust transition timings


Commit: be14778b2b6afac7ff238d315ac735a9dc322dbe
    https://github.com/scummvm/scummvm/commit/be14778b2b6afac7ff238d315ac735a9dc322dbe
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-12-12T15:20:08-06:00

Commit Message:
SCI: Ensure bytecode/BWT for "file" op is also printed

Learning the bytecode for file op is necessary when creating
workaround signatures, as the signature-finding mechanism does not
currently ignore line/file instructions.

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


diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index 9ed9772..54b925a 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -99,17 +99,6 @@ reg_t disassemble(EngineState *s, reg32_t pos, reg_t objAddr, bool printBWTag, b
 
 	debugN("%04x:%04x: ", PRINT_REG(pos));
 
-	if (opcode == op_pushSelf) { // 0x3e (62)
-		if ((opsize & 1) && g_sci->getGameId() != GID_FANMADE) {
-			// Debug opcode op_file
-			debugN("file \"%s\"\n", scr + pos.getOffset() + 1);	// +1: op_pushSelf size
-			retval.incOffset(bytecount - 1);
-			return retval;
-		}
-	}
-
-	opsize &= 1; // byte if true, word if false
-
 	if (printBytecode) {
 		if (pos.getOffset() + bytecount > scr_size) {
 			warning("Operation arguments extend beyond end of script");
@@ -123,9 +112,18 @@ reg_t disassemble(EngineState *s, reg32_t pos, reg_t objAddr, bool printBWTag, b
 			debugN("   ");
 	}
 
+	opsize &= 1; // byte if true, word if false
+
 	if (printBWTag)
 		debugN("[%c] ", opsize ? 'B' : 'W');
 
+	if (opcode == op_pushSelf && opsize && g_sci->getGameId() != GID_FANMADE) { // 0x3e (62)
+		// Debug opcode op_file
+		debugN("file \"%s\"\n", scr + pos.getOffset() + 1);	// +1: op_pushSelf size
+		retval.incOffset(bytecount - 1);
+		return retval;
+	}
+
 #ifndef REDUCE_MEMORY_USAGE
 	debugN("%-5s", opcodeNames[opcode]);
 #endif


Commit: 8477e61ad050e854a000068d15acaf42270ec68e
    https://github.com/scummvm/scummvm/commit/8477e61ad050e854a000068d15acaf42270ec68e
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-12-12T15:22:04-06:00

Commit Message:
SCI32: Add workaround for hearts game in Hoyle5

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


diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index c87156b..0c8ff27 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -125,6 +125,23 @@ static const uint16 sig_uninitread_hoyle4_1[] = {
 	SIG_END
 };
 
+//                Game: Hoyle 5
+//      Calling method: export 2
+//   Subroutine offset: 0x2fb2 (script 300)
+// Applies to at least: English PC demo
+static const uint16 sig_uninitread_hoyle5_1[] = {
+
+	0x7e, SIG_ADDTOOFFSET(2),        // line N
+	0x7d, 0x68, 0x65, 0x61, 0x72,
+	      0x74, 0x73, 0x2e, 0x73,
+		  0x63, 0x00,                // file "hearts.sc"
+	0x3f, 0x01,                      // link 01
+	0x7e, SIG_ADDTOOFFSET(2),        // line N
+	0x39, 0x4b,                      // pushi 4bh
+	0x78,                            // push1
+	SIG_END
+};
+
 //                Game: Jones in the fast lane
 //      Calling method: weekendText::draw
 //   Subroutine offset: 0x03d3 (script 232)
@@ -283,6 +300,7 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
 	{ GID_HOYLE5,         -1,    14, -1,                 NULL, "select",                          NULL,     1, { WORKAROUND_FAKE,   0 } }, // dragging the sliders in game settings
 	{ GID_HOYLE5,         -1, 64937, -1,                 NULL, "select",                          NULL,     7, { WORKAROUND_FAKE,   0 } }, // clicking the "control" and "options" buttons in the icon bar
 	{ GID_HOYLE5,         -1, 64937, -1,            "IconBar", "handleEvent",                     NULL,     0, { WORKAROUND_FAKE,   0 } }, // clicking on any button in the icon bar
+	{ GID_HOYLE5,        300,   300,  0,                   "", "export 2",     sig_uninitread_hoyle5_1,     0, { WORKAROUND_FAKE,   0 } }, // after passing around cards in hearts
 	{ GID_ISLANDBRAIN,   100,   937,  0,            "IconBar", "dispatchEvent",                   NULL,    58, { WORKAROUND_FAKE,   0 } }, // when using ENTER at the startup menu - bug #5241
 	{ GID_ISLANDBRAIN,   140,   140,  0,              "piece", "init",                            NULL,     3, { WORKAROUND_FAKE,   1 } }, // first puzzle right at the start, some initialization variable. bnt is done on it, and it should be non-0
 	{ GID_ISLANDBRAIN,   200,   268,  0,          "anElement", "select",                          NULL,     0, { WORKAROUND_FAKE,   0 } }, // elements puzzle, gets used before super TextIcon


Commit: 4b4b8a281b67bf5e739e376ec0a34d2bedbba4d7
    https://github.com/scummvm/scummvm/commit/4b4b8a281b67bf5e739e376ec0a34d2bedbba4d7
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-12-12T15:22:11-06:00

Commit Message:
SCI32: Adjust transition timings

Transition timings were originally chosen largely by feel in SQ6,
as there was little other evidence to determine the correct speed.
As additional games started being playable in ScummVM, it became
apparent that these speeds were not quite right.

Additional adjustments may be needed in the future, but these new
timings seem to be somewhat closer to expectations than before.

Changed paths:
    engines/sci/engine/script_patches.cpp
    engines/sci/graphics/transitions32.cpp
    engines/sci/graphics/transitions32.h


diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index dbc351d..dcefa21 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -4601,7 +4601,7 @@ static const uint16 sq6SlowTransitionSignature1[] = {
 };
 
 static const uint16 sq6SlowTransitionPatch1[] = {
-	0x38, SIG_UINT16(180), // pushi 180
+	0x38, SIG_UINT16(500), // pushi 500
 	PATCH_END
 };
 
diff --git a/engines/sci/graphics/transitions32.cpp b/engines/sci/graphics/transitions32.cpp
index bad0185..a1ae352 100644
--- a/engines/sci/graphics/transitions32.cpp
+++ b/engines/sci/graphics/transitions32.cpp
@@ -41,8 +41,7 @@ static int16 divisionsDefaults[2][16] = {
 };
 
 GfxTransitions32::GfxTransitions32(SegManager *segMan) :
-	_segMan(segMan),
-	_throttleState(0) {
+	_segMan(segMan) {
 	for (int i = 0; i < 236; i += 2) {
 		_styleRanges[i] = 0;
 		_styleRanges[i + 1] = -1;
@@ -67,17 +66,8 @@ GfxTransitions32::~GfxTransitions32() {
 	_scrolls.clear();
 }
 
-void GfxTransitions32::throttle() {
-	uint8 throttleTime;
-	if (_throttleState == 2) {
-		throttleTime = 34;
-		_throttleState = 0;
-	} else {
-		throttleTime = 33;
-		++_throttleState;
-	}
-
-	g_sci->getEngineState()->speedThrottler(throttleTime);
+void GfxTransitions32::throttle(const uint32 ms) {
+	g_sci->getEngineState()->speedThrottler(ms);
 	g_sci->getEngineState()->_throttleTrigger = true;
 }
 
@@ -936,7 +926,7 @@ void GfxTransitions32::processScrolls() {
 		}
 	}
 
-	throttle();
+	throttle(33);
 }
 
 void GfxTransitions32::kernelSetScroll(const reg_t planeId, const int16 deltaX, const int16 deltaY, const GuiResourceId pictureId, const bool animate, const bool mirrorX) {
@@ -1005,7 +995,7 @@ void GfxTransitions32::kernelSetScroll(const reg_t planeId, const int16 deltaX,
 		while (!finished && !g_engine->shouldQuit()) {
 			finished = processScroll(*scroll);
 			g_sci->_gfxFrameout->frameOut(true);
-			throttle();
+			throttle(33);
 		}
 	}
 
diff --git a/engines/sci/graphics/transitions32.h b/engines/sci/graphics/transitions32.h
index 12e0d64..0c828a2 100644
--- a/engines/sci/graphics/transitions32.h
+++ b/engines/sci/graphics/transitions32.h
@@ -239,11 +239,20 @@ private:
 	SegManager *_segMan;
 
 	/**
-	 * Throttles transition playback to prevent transitions from being instant
-	 * on fast computers.
-	 */
-	void throttle();
-	int8 _throttleState;
+	 * Throttles transition playback to prevent transitions from being
+	 * instantaneous on modern computers.
+	 *
+	 * kSetShowStyle transitions are throttled at 10ms intervals, under the
+	 * assumption that the default fade transition of 101 divisions was designed
+	 * to finish in one second. Empirically, this seems to roughly match the
+	 * speed of DOSBox, and feels reasonable.
+	 *
+	 * Transitions using kSetScroll (used in the LSL6hires intro) need to be
+	 * slower, so they get throttled at 33ms instead of 10ms. This value was
+	 * chosen by gut feel, as these scrolling transitions are instantaneous in
+	 * DOSBox.
+	 */
+	void throttle(const uint32 ms = 10);
 
 	void clearShowRects();
 	void addShowRect(const Common::Rect &rect);





More information about the Scummvm-git-logs mailing list