[Scummvm-cvs-logs] SF.net SVN: scummvm:[51999] scummvm/trunk/engines/sci/engine

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Wed Aug 11 22:39:14 CEST 2010


Revision: 51999
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51999&view=rev
Author:   m_kiewitz
Date:     2010-08-11 20:39:13 +0000 (Wed, 11 Aug 2010)

Log Message:
-----------
SCI: adding patch for kq5 harpy volume

fixes actual game bug #3042277 - sierra switched in that case to highest volume possible

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/script_patches.cpp
    scummvm/trunk/engines/sci/engine/workarounds.cpp

Modified: scummvm/trunk/engines/sci/engine/script_patches.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/script_patches.cpp	2010-08-11 19:40:58 UTC (rev 51998)
+++ scummvm/trunk/engines/sci/engine/script_patches.cpp	2010-08-11 20:39:13 UTC (rev 51999)
@@ -51,6 +51,7 @@
 //  - if not EOS, an adjust offset and the actual bytes
 //  - rinse and repeat
 
+// ===========================================================================
 // stayAndHelp::changeState (0) is called when ego swims to the left or right
 //  boundaries of room 660. Normally a textbox is supposed to get on screen
 //  but the call is wrong, so not only do we get an error message the script
@@ -189,6 +190,7 @@
     {      0, NULL,                                          0,                                            0, NULL,                          NULL }
 };
 
+// ===========================================================================
 // this here gets called on entry and when going out of game windows
 //  uEvt::port will not get changed after kDisposeWindow but a bit later, so
 //  we would get an invalid port handle to a kSetPort call. We just patch in
@@ -252,7 +254,63 @@
     {      0, NULL,                                          0,                                            0, NULL,                     NULL }
 };
 
+// ===========================================================================
+// at least during harpy scene export 29 of script 0 is called in kq5cd and
+//  has an issue for those calls, where temp 3 won't get inititialized, but
+//  is later used to set master volume. This issue makes sierra sci set
+//  the volume to max. We fix the export, so volume won't get modified in
+//  those cases.
+const byte kq5SignatureCdHarpyVolume[] = {
+	34,
+	0x80, 0x91, 0x01,  // lag global[191h]
+	0x18,              // not
+	0x30, 0x2c, 0x00,  // bnt [jump further] (jumping, if global 191h is 1)
+	0x35, 0x01,        // ldi 01
+	0xa0, 0x91, 0x01,  // sag global[191h] (setting global 191h to 1)
+	0x38, 0x7b, 0x01,  // pushi 017b
+	0x76,              // push0
+	0x81, 0x01,        // lag global[1]
+	0x4a, 0x04,        // send 04 (getting KQ5::masterVolume)
+	0xa5, 0x03,        // sat temp[3] (store volume in temp 3)
+	0x38, 0x7b, 0x01,  // pushi 017b
+	0x76,              // push0
+	0x81, 0x01,        // lag global[1]
+	0x4a, 0x04,        // send 04 (getting KQ5::masterVolume)
+	0x36,              // push
+	0x35, 0x04,        // ldi 04
+	0x20,              // ge? (followed by bnt)
+	0
+};
 
+const uint16 kq5PatchCdHarpyVolume[] = {
+	0x38, 0x2f, 0x02,  // pushi 022f (selector theVol) (3 new bytes)
+	0x76,              // push0 (1 new byte)
+	0x51, 0x88,        // class SpeakTimer (2 new bytes)
+	0x4a, 0x04,        // send 04 (2 new bytes) -> read SpeakTimer::theVol
+	0xa5, 0x03,        // sat temp[3] (2 new bytes) -> write to temp 3
+	0x80, 0x91, 0x01,  // lag global[191h]
+	// saving 1 byte due optimization
+	0x2e, 0x23, 0x00,  // bt [jump further] (jumping, if global 191h is 1)
+	0x35, 0x01,        // ldi 01
+	0xa0, 0x91, 0x01,  // sag global[191h] (setting global 191h to 1)
+	0x38, 0x7b, 0x01,  // pushi 017b
+	0x76,              // push0
+	0x81, 0x01,        // lag global[1]
+	0x4a, 0x04,        // send 04 (getting KQ5::masterVolume)
+	0xa5, 0x03,        // sat temp[3] (store volume in temp 3)
+	// saving 8 bytes due removing of duplicate code
+	0x39, 0x04,        // pushi 04 (saving 1 byte due swapping)
+	0x22,              // lt? (because we switched values)
+	PATCH_END
+};
+
+//    script, description,                                   magic DWORD,                                 adjust
+const SciScriptSignature kq5Signatures[] = {
+    {      0, "CD: harpy volume change",                     PATCH_MAGICDWORD(0x80, 0x91, 0x01, 0x18),     0, kq5SignatureCdHarpyVolume, kq5PatchCdHarpyVolume },
+    {      0, NULL,                                          0,                                            0, NULL,                      NULL }
+};
+
+// ===========================================================================
 // this is called on every death dialog. Problem is at least the german
 //  version of lsl6 gets title text that is far too long for the
 //  available temp space resulting in temp space corruption
@@ -303,6 +361,7 @@
     {      0, NULL,                                          0,                                            0, NULL,                       NULL }
 };
 
+// ===========================================================================
 // It seems to scripts warp ego outside the screen somehow (or maybe kDoBresen?)
 //  ego::mover is set to 0 and rm119::doit will crash in that case. This here
 //  fixes part of the problem and actually checks ego::mover to be 0 and skips
@@ -417,6 +476,8 @@
 // hoyle4 now works due workaround inside GfxPorts
 //	if (g_sci->getGameId() == GID_HOYLE4)
 //		signatureTable = hoyle4Signatures;
+	if (g_sci->getGameId() == GID_KQ5)
+		signatureTable = kq5Signatures;
 	if (g_sci->getGameId() == GID_LSL6)
 		signatureTable = larry6Signatures;
 	if (g_sci->getGameId() == GID_SQ5)

Modified: scummvm/trunk/engines/sci/engine/workarounds.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/workarounds.cpp	2010-08-11 19:40:58 UTC (rev 51998)
+++ scummvm/trunk/engines/sci/engine/workarounds.cpp	2010-08-11 20:39:13 UTC (rev 51999)
@@ -113,7 +113,8 @@
 	{ GID_JONES,           1,   255,  0,                   "", "export 0",       -1,   14, { WORKAROUND_FAKE,   0 } }, // jones/cd only - called when a game ends
 	{ GID_JONES,         764,   255,  0,                   "", "export 0",       -1,   13, { WORKAROUND_FAKE,   0 } }, // jones/ega&vga only - called when the game starts
 	{ GID_JONES,         764,   255,  0,                   "", "export 0",       -1,   14, { WORKAROUND_FAKE,   0 } }, // jones/ega&vga only - called when the game starts
-	{ GID_KQ5,            -1,     0,  0,                   "", "export 29",      -1,    3, { WORKAROUND_FAKE,   0xf } }, // called when playing harp for the harpies or when aborting dialog in toy shop, is used for kDoAudio - bug #3034700
+	//{ GID_KQ5,            -1,     0,  0,                   "", "export 29",      -1,    3, { WORKAROUND_FAKE,   0xf } }, // called when playing harp for the harpies or when aborting dialog in toy shop, is used for kDoAudio - bug #3034700
+    // ^^ shouldn't be needed anymore, we got a script patch instead (kq5PatchCdHarpyVolume)
 	{ GID_KQ5,            25,    25,  0,              "rm025", "doit",           -1,    0, { WORKAROUND_FAKE,   0 } }, // inside witch forest, when going to the room where the walking rock is
     { GID_KQ5,            55,    55,  0,         "helpScript", "doit",           -1,    0, { WORKAROUND_FAKE,   0 } }, // when giving the tambourine to the monster in the labyrinth (only happens at one of the locations) - bug #3041262
 	{ GID_KQ6,            -1,    30,  0,               "rats", "changeState",    -1,   -1, { WORKAROUND_FAKE,   0 } }, // rats in the catacombs (temps 1 - 5) - bugs #3034597, #3035495, #3035824


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list