[Scummvm-cvs-logs] SF.net SVN: scummvm:[51832] scummvm/trunk/engines/sci/engine/script_patches .cpp
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Sat Aug 7 15:40:14 CEST 2010
Revision: 51832
http://scummvm.svn.sourceforge.net/scummvm/?rev=51832&view=rev
Author: m_kiewitz
Date: 2010-08-07 13:40:14 +0000 (Sat, 07 Aug 2010)
Log Message:
-----------
SCI: adding sq5 scrubbing patch
(for testing only, i'm not sure if it works because i'm unable to reproduce the bug anymore)
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/script_patches.cpp
Modified: scummvm/trunk/engines/sci/engine/script_patches.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/script_patches.cpp 2010-08-07 12:36:17 UTC (rev 51831)
+++ scummvm/trunk/engines/sci/engine/script_patches.cpp 2010-08-07 13:40:14 UTC (rev 51832)
@@ -166,6 +166,47 @@
{ 0, NULL, 0, 0, NULL, NULL }
};
+const byte sq5SignatureScrubbing[] = {
+ 19,
+ 0x18, // not
+ 0x31, 0x37, // bnt 37
+ 0x78, // push1 (selector x)
+ 0x76, // push0
+ 0x39, 0x38, // pushi 38 (selector mover)
+ 0x76, // push0
+ 0x81, 0x00, // lag 00
+ 0x4a, 0x04, // send 04 (read ego::mover)
+ 0x4a, 0x04, // send 04 (read ego::mover::x)
+ 0x36, // push
+ 0x34, 0xa0, 0x00, // ldi 00a0
+ 0x1c, // ne?
+ 0
+};
+
+const uint16 sq5PatchScrubbing[] = {
+ 0x18, // not
+ 0x31, 0x37, // bnt 37
+// 0x2f, 0x38, // bt 37 (would save another byte, isn't needed
+ 0x39, 0x38, // pushi 38 (selector mover)
+ 0x76, // push0
+ 0x81, 0x00, // lag 00
+ 0x4a, 0x04, // send 04 (read ego::mover)
+ 0x31, 0x2e, // bnt 2e (jump if ego::mover is 0)
+ 0x78, // push1 (selector x)
+ 0x76, // push0
+ 0x4a, 0x04, // send 04 (read ego::mover::x)
+ 0x39, 0xa0, // pushi a0 (saving 2 bytes)
+ 0x1c, // ne?
+ PATCH_END
+};
+
+// script, description, magic DWORD, adjust
+const SciScriptSignature sq5Signatures[] = {
+ { 119, "scrubbing send crash", PATCH_MAGICDWORD(0x18, 0x31, 0x37, 0x78), 0, sq5SignatureScrubbing, sq5PatchScrubbing },
+ { 0, NULL, 0, 0, NULL, NULL }
+};
+
+
// will actually patch previously found signature area
void Script::applyPatch(const uint16 *patch, byte *scriptData, const uint32 scriptSize, int32 signatureOffset) {
int32 offset = signatureOffset;
@@ -229,6 +270,8 @@
signatureTable = hoyle4Signatures;
if (g_sci->getGameId() == GID_LSL6)
signatureTable = larry6Signatures;
+ if (g_sci->getGameId() == GID_SQ5)
+ signatureTable = sq5Signatures;
if (signatureTable) {
while (signatureTable->data) {
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