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

csnover csnover at users.noreply.github.com
Tue Sep 12 07:45:43 CEST 2017


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:
eb284c45ed SCI32: Replace spin loop with kWait in Phant2 alien password screen
f9c43144a7 SCI32: Fix janky document scrolling in Phant2 computer interface
a7ede0ca39 SCI32: Fix bad positioning of text in Phant2 computer on first render
df85727186 SCI32: Fix wrong open folder/doc icons in Phant2 computer on first render


Commit: eb284c45ed2fb5331ff17e51cc3ecf57893afdde
    https://github.com/scummvm/scummvm/commit/eb284c45ed2fb5331ff17e51cc3ecf57893afdde
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-12T00:45:18-05:00

Commit Message:
SCI32: Replace spin loop with kWait in Phant2 alien password screen

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 3eb697e..86053ca 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -3747,6 +3747,28 @@ static const SciScriptPatcherEntry phantasmagoriaSignatures[] = {
 #pragma mark -
 #pragma mark Phantasmagoria 2
 
+// The game uses a spin loop when navigating to and from Curtis's computer in
+// the office, and when entering passwords, which causes the mouse to appear
+// unresponsive. Replace the spin loop with a call to ScummVM kWait.
+// Applies to at least: US English
+// Responsible method: Script 3000 localproc 2ee4, script 63019 localproc 4f04
+static const uint16 phant2WaitParam1Signature[] = {
+	SIG_MAGICDWORD,
+	0x35, 0x00, // ldi 0
+	0xa5, 0x00, // sat 0
+	0x8d, 0x00, // lst 0
+	0x87, 0x01, // lap 1
+	SIG_END
+};
+
+static const uint16 phant2WaitParam1Patch[] = {
+	0x78,                                     // push1
+	0x8f, 0x01,                               // lsp param[1]
+	0x43, kScummVMWaitId, PATCH_UINT16(0x02), // callk Wait, 2
+	0x48,                                     // ret
+	PATCH_END
+};
+
 // The interface bars at the top and bottom of the screen fade in and out when
 // hovered over. This fade is performed by a script loop that calls kFrameOut
 // directly and uses global 227 as the fade delta for each frame. Global 227
@@ -3790,28 +3812,6 @@ static const uint16 phant2Wait4FadePatch[] = {
 	PATCH_END
 };
 
-// The game uses a spin loop when navigating to and from Curtis's computer in
-// the office, which causes the mouse to appear unresponsive. Replace the spin
-// loop with a call to ScummVM kWait.
-// Applies to at least: US English
-// Responsible method: localproc 4f04
-static const uint16 phant2CompSlideDoorsSignature[] = {
-	SIG_MAGICDWORD,
-	0x35, 0x00, // ldi 0
-	0xa5, 0x00, // sat 0
-	0x8d, 0x00, // lst 0
-	0x87, 0x01, // lap 1
-	SIG_END
-};
-
-static const uint16 phant2CompSlideDoorsPatch[] = {
-	0x78,                                     // push1
-	0x8f, 0x01,                               // lsp param[1]
-	0x43, kScummVMWaitId, PATCH_UINT16(0x02), // callk Wait, 2
-	0x48,                                     // ret
-	PATCH_END
-};
-
 // When reading the VERSION file, Phant2 sends a Str object instead of a
 // reference to a string (kernel signature violation), and flips the file handle
 // and size arguments, so the version file data never actually makes it into the
@@ -3970,10 +3970,11 @@ static const uint16 phant2NumSavesPatch2[] = {
 static const SciScriptPatcherEntry phantasmagoria2Signatures[] = {
 	{  true,     0, "slow interface fades",                        3, phant2SlowIFadeSignature,      phant2SlowIFadePatch },
 	{  true,     0, "bad arguments to get game version",           1, phant2GetVersionSignature,     phant2GetVersionPatch },
-	{  true,  4081, "non-responsive mouse after ratboy puzzle",    1, phant2RatboySignature,         phant2RatboyPatch },
+	{  true,  3000, "replace spin loop in alien password window",  1, phant2WaitParam1Signature,     phant2WaitParam1Patch },
+	{  true,  4081, "replace spin loop after ratboy puzzle",       1, phant2RatboySignature,         phant2RatboyPatch },
 	{  true, 63004, "limit in-game audio volume",                  1, phant2AudioVolumeSignature,    phant2AudioVolumePatch },
-	{  true, 63016, "non-responsive mouse during music fades",     1, phant2Wait4FadeSignature,      phant2Wait4FadePatch },
-	{  true, 63019, "non-responsive mouse during computer load",   1, phant2CompSlideDoorsSignature, phant2CompSlideDoorsPatch },
+	{  true, 63016, "replace spin loop during music fades",        1, phant2Wait4FadeSignature,      phant2Wait4FadePatch },
+	{  true, 63019, "replace spin loop during computer load",      1, phant2WaitParam1Signature,     phant2WaitParam1Patch },
 	{  true, 64990, "remove save game name mangling (1/2)",        1, phant2SaveNameSignature1,      phant2SaveNamePatch1 },
 	{  true, 64994, "remove save game name mangling (2/2)",        1, phant2SaveNameSignature2,      phant2SaveNamePatch2 },
 	{  true, 64990, "increase number of save games",               1, phant2NumSavesSignature1,      phant2NumSavesPatch1 },


Commit: f9c43144a74ef1976b640b27408f0e45dbffea34
    https://github.com/scummvm/scummvm/commit/f9c43144a74ef1976b640b27408f0e45dbffea34
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-12T00:45:18-05:00

Commit Message:
SCI32: Fix janky document scrolling in Phant2 computer interface

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 86053ca..f90acd5 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -3966,6 +3966,34 @@ static const uint16 phant2NumSavesPatch2[] = {
 	PATCH_END
 };
 
+// The game script responsible for handling document scrolling in the computer
+// interface uses a spin loop to wait for 10 ticks every time the document
+// scrolls. This makes scrolling janky and makes the mouse appear
+// non-responsive. Eliminating the delay entirely makes scrolling with the arrow
+// buttons a little too quick; a delay of 3 ticks is an OK middle-ground between
+// allowing mostly fluid motion with mouse dragging and reasonably paced
+// scrolling holding down the arrows. Preferably, ScrollbarArrow::handleEvent or
+// ScrollbarArrow::action would only send cues once every N ticks whilst being
+// held down, but unfortunately the game was not programmed to do this.
+// Applies to at least: US English
+static const uint16 phant2SlowScrollSignature[] = {
+	SIG_MAGICDWORD,
+	0x35, 0x0a,                // ldi 10
+	0x22,                      // lt?
+	0x31, 0x17,                // bnt [end of loop]
+	0x76,                      // push0
+	0x43, 0x79, SIG_UINT16(0), // callk GetTime, 0
+	SIG_END
+};
+
+static const uint16 phant2SlowScrollPatch[] = {
+	0x78,                                     // push1
+	0x39, 0x03,                               // pushi 3
+	0x43, kScummVMWaitId, PATCH_UINT16(0x02), // callk Wait, 2
+	0x33, 0x13,                               // jmp [end of loop]
+	PATCH_END
+};
+
 //          script, description,                                      signature                      patch
 static const SciScriptPatcherEntry phantasmagoria2Signatures[] = {
 	{  true,     0, "slow interface fades",                        3, phant2SlowIFadeSignature,      phant2SlowIFadePatch },
@@ -3975,6 +4003,7 @@ static const SciScriptPatcherEntry phantasmagoria2Signatures[] = {
 	{  true, 63004, "limit in-game audio volume",                  1, phant2AudioVolumeSignature,    phant2AudioVolumePatch },
 	{  true, 63016, "replace spin loop during music fades",        1, phant2Wait4FadeSignature,      phant2Wait4FadePatch },
 	{  true, 63019, "replace spin loop during computer load",      1, phant2WaitParam1Signature,     phant2WaitParam1Patch },
+	{  true, 63019, "replace spin loop during computer scrolling", 1, phant2SlowScrollSignature,     phant2SlowScrollPatch },
 	{  true, 64990, "remove save game name mangling (1/2)",        1, phant2SaveNameSignature1,      phant2SaveNamePatch1 },
 	{  true, 64994, "remove save game name mangling (2/2)",        1, phant2SaveNameSignature2,      phant2SaveNamePatch2 },
 	{  true, 64990, "increase number of save games",               1, phant2NumSavesSignature1,      phant2NumSavesPatch1 },


Commit: a7ede0ca39d37b768ddf1546ae5fcf5b9477f3c5
    https://github.com/scummvm/scummvm/commit/a7ede0ca39d37b768ddf1546ae5fcf5b9477f3c5
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-12T00:45:18-05:00

Commit Message:
SCI32: Fix bad positioning of text in Phant2 computer on first render

This fixes the glitchy positioning during the word hallucinations.

Fixes Trac#10036.

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 f90acd5..91a8b5f 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -122,6 +122,7 @@ static const char *const selectorNameTable[] = {
 	"masterVolume", // SCI2 master volume reset
 	"data",         // Phant2
 	"format",       // Phant2
+	"setSize",      // Phant2
 #endif
 	NULL
 };
@@ -167,7 +168,8 @@ enum ScriptPatcherSelectors {
 	SELECTOR_clear,
 	SELECTOR_masterVolume,
 	SELECTOR_data,
-	SELECTOR_format
+	SELECTOR_format,
+	SELECTOR_setSize
 #endif
 };
 
@@ -3994,6 +3996,42 @@ static const uint16 phant2SlowScrollPatch[] = {
 	PATCH_END
 };
 
+// WynNetDoco::open calls setSize before it calls posn, but the values set by
+// posn are used by setSize, so the left/top coordinates of the text and note
+// fields is wrong for the first render of a document or email. (Incidentally,
+// these fields are the now-seen rect fields, and the game is doing a very bad
+// thing by touching these manually and then relying on the values instead of
+// asking the kernel.) This is most noticeable during chapters 1 and 3 when the
+// computer is displaying scary messages, since every time the scary message is
+// rendered the text fields re-render at the top-left corner of the screen.
+// Applies to at least: US English
+static const uint16 phant2BadPositionSignature[] = {
+	SIG_MAGICDWORD,
+	0x39, SIG_SELECTOR8(setSize), // pushi setSize
+	0x76,                         // push0
+	0x39, SIG_SELECTOR8(init),    // pushi init
+	0x78,                         // pushi 1
+	0x89, 0x03,                   // lsg 3
+	0x39, SIG_SELECTOR8(posn),    // pushi posn
+	0x7a,                         // push2
+	0x66, SIG_ADDTOOFFSET(+2),    // pTos (x position)
+	0x66, SIG_ADDTOOFFSET(+2),    // pTos (y position)
+	SIG_END
+};
+
+static const uint16 phant2BadPositionPatch[] = {
+	0x39, PATCH_SELECTOR8(posn),        // pushi posn
+	0x7a,                               // push2
+	0x66, PATCH_GETORIGINALUINT16(12),  // pTos (x position)
+	0x66, PATCH_GETORIGINALUINT16(15),  // pTos (y position)
+	0x39, PATCH_SELECTOR8(setSize),     // pushi setSize
+	0x76,                               // push0
+	0x39, PATCH_SELECTOR8(init),        // pushi init
+	0x78,                               // pushi 1
+	0x89, 0x03,                         // lsg 3
+	PATCH_END
+};
+
 //          script, description,                                      signature                      patch
 static const SciScriptPatcherEntry phantasmagoria2Signatures[] = {
 	{  true,     0, "slow interface fades",                        3, phant2SlowIFadeSignature,      phant2SlowIFadePatch },
@@ -4004,6 +4042,7 @@ static const SciScriptPatcherEntry phantasmagoria2Signatures[] = {
 	{  true, 63016, "replace spin loop during music fades",        1, phant2Wait4FadeSignature,      phant2Wait4FadePatch },
 	{  true, 63019, "replace spin loop during computer load",      1, phant2WaitParam1Signature,     phant2WaitParam1Patch },
 	{  true, 63019, "replace spin loop during computer scrolling", 1, phant2SlowScrollSignature,     phant2SlowScrollPatch },
+	{  true, 63019, "fix bad doc/email name & memo positioning",   2, phant2BadPositionSignature,    phant2BadPositionPatch },
 	{  true, 64990, "remove save game name mangling (1/2)",        1, phant2SaveNameSignature1,      phant2SaveNamePatch1 },
 	{  true, 64994, "remove save game name mangling (2/2)",        1, phant2SaveNameSignature2,      phant2SaveNamePatch2 },
 	{  true, 64990, "increase number of save games",               1, phant2NumSavesSignature1,      phant2NumSavesPatch1 },


Commit: df85727186dab662714de0abd55e17063f29936d
    https://github.com/scummvm/scummvm/commit/df85727186dab662714de0abd55e17063f29936d
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-12T00:45:19-05:00

Commit Message:
SCI32: Fix wrong open folder/doc icons in Phant2 computer on first render

This fixes flickering icons during the word hallucinations.

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 91a8b5f..87eeddf 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -123,6 +123,9 @@ static const char *const selectorNameTable[] = {
 	"data",         // Phant2
 	"format",       // Phant2
 	"setSize",      // Phant2
+	"setCel",       // Phant2
+	"iconV",        // Phant2
+	"update",       // Phant2
 #endif
 	NULL
 };
@@ -169,7 +172,10 @@ enum ScriptPatcherSelectors {
 	SELECTOR_masterVolume,
 	SELECTOR_data,
 	SELECTOR_format,
-	SELECTOR_setSize
+	SELECTOR_setSize,
+	SELECTOR_setCel,
+	SELECTOR_iconV,
+	SELECTOR_update
 #endif
 };
 
@@ -4032,6 +4038,36 @@ static const uint16 phant2BadPositionPatch[] = {
 	PATCH_END
 };
 
+// WynDocuStore::refresh resets the cel of the open folder and document icons,
+// so they don't end up being rendered as closed folder/document icons, but it
+// forgets to actually update the icon's View with the kernel, so they render
+// as closed for the first render after a refresh anyway. This is most
+// noticeable during chapters 1 and 3 when the computer is displaying scary
+// messages, since every time the scary message is rendered the icons re-render
+// as closed.
+// Applies to at least: US English
+static const uint16 phant2BadIconSignature[] = {
+	SIG_MAGICDWORD,
+	0x38, SIG_SELECTOR16(setCel), // pushi setCel
+	0x78,                         // push1
+	0x78,                         // push1
+	0x38, SIG_SELECTOR16(iconV),  // pushi iconV
+	0x76,                         // push0
+	0x62, SIG_ADDTOOFFSET(+2),    // pToa curFolder/curDoco
+	0x4a, SIG_UINT16(0x04),       // send 4
+	0x4a, SIG_UINT16(0x06),       // send 6
+	SIG_END
+};
+
+static const uint16 phant2BadIconPatch[] = {
+	PATCH_ADDTOOFFSET(+5),          // pushi setCel, push1, push1
+	0x38, PATCH_SELECTOR16(update), // pushi update
+	0x76,                           // push0
+	0x4a, PATCH_UINT16(0x0a),       // send 10
+	0x33, 0x04,                     // jmp [past unused bytes]
+	PATCH_END
+};
+
 //          script, description,                                      signature                      patch
 static const SciScriptPatcherEntry phantasmagoria2Signatures[] = {
 	{  true,     0, "slow interface fades",                        3, phant2SlowIFadeSignature,      phant2SlowIFadePatch },
@@ -4043,6 +4079,7 @@ static const SciScriptPatcherEntry phantasmagoria2Signatures[] = {
 	{  true, 63019, "replace spin loop during computer load",      1, phant2WaitParam1Signature,     phant2WaitParam1Patch },
 	{  true, 63019, "replace spin loop during computer scrolling", 1, phant2SlowScrollSignature,     phant2SlowScrollPatch },
 	{  true, 63019, "fix bad doc/email name & memo positioning",   2, phant2BadPositionSignature,    phant2BadPositionPatch },
+	{  true, 63019, "fix bad folder/doc icon refresh",             2, phant2BadIconSignature,        phant2BadIconPatch },
 	{  true, 64990, "remove save game name mangling (1/2)",        1, phant2SaveNameSignature1,      phant2SaveNamePatch1 },
 	{  true, 64994, "remove save game name mangling (2/2)",        1, phant2SaveNameSignature2,      phant2SaveNamePatch2 },
 	{  true, 64990, "increase number of save games",               1, phant2NumSavesSignature1,      phant2NumSavesPatch1 },





More information about the Scummvm-git-logs mailing list