[Scummvm-cvs-logs] scummvm master -> d1e2d61b781aab5a0cc832a05a0981765fc4b0fe

wjp wjp at usecode.org
Sun Oct 7 12:31:20 CEST 2012


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

Summary:
8f754ced42 SCI: Flip assert
d1e2d61b78 SCI: Fix Uhura's Woo conversation option


Commit: 8f754ced422eec38766e3d0dd50c82c6fe862f53
    https://github.com/scummvm/scummvm/commit/8f754ced422eec38766e3d0dd50c82c6fe862f53
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2012-10-07T03:27:14-07:00

Commit Message:
SCI: Flip assert

This way the assert is checking that the allocated buffer is large enough
for the memcpy that follows it.

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



diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp
index 037f4ab..36d2841 100644
--- a/engines/sci/engine/script.cpp
+++ b/engines/sci/engine/script.cpp
@@ -144,7 +144,7 @@ void Script::load(int script_nr, ResourceManager *resMan) {
 
 		_heapStart = _buf + _scriptSize;
 
-		assert(_bufSize - _scriptSize <= heap->size);
+		assert(_bufSize - _scriptSize >= heap->size);
 		memcpy(_heapStart, heap->data, heap->size);
 	}
 


Commit: d1e2d61b781aab5a0cc832a05a0981765fc4b0fe
    https://github.com/scummvm/scummvm/commit/d1e2d61b781aab5a0cc832a05a0981765fc4b0fe
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2012-10-07T03:27:14-07:00

Commit Message:
SCI: Fix Uhura's Woo conversation option

This is bug #3040722.

It was trying to open a non-existent submenu. We now force a return
after handling the conversation option right before it tries to look for
this submenu.

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 659c13b..8454be5 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -915,9 +915,53 @@ const uint16 qfg3PatchImportDialog[] = {
 	PATCH_END
 };
 
+
+
+// ===========================================================================
+// Patch for the Woo dialog option in Uhura's conversation. Bug #3040722
+// Problem: The Woo dialog option (0xffb5) is negative, and therefore
+// treated as an option opening a submenu. This leads to uhuraTell::doChild
+// being called, which calls hero::solvePuzzle and then proceeds with
+// Teller::doChild to open the submenu. However, there is no actual submenu
+// defined for option -75 since -75 does not show up in uhuraTell::keys.
+// This will cause Teller::doChild to run out of bounds while scanning through
+// uhuraTell::keys.
+// Strategy: there is another conversation option in uhuraTell::doChild calling
+// hero::solvePuzzle (0xfffc) which does a ret afterwards without going to
+// Teller::doChild. We jump to this call of hero::solvePuzzle to get that same
+// behaviour.
+
+const byte qfg3SignatureWooDialog[] = {
+	30,
+	0x67, 0x12,       // pTos 12 (query)
+	0x35, 0xb6,       // ldi b6
+	0x1a,             // eq?
+	0x2f, 0x05,       // bt 05
+	0x67, 0x12,       // pTos 12 (query)
+	0x35, 0x9b,       // ldi 9b
+	0x1a,             // eq?
+	0x31, 0x0c,       // bnt 0c
+	0x38, 0x97, 0x02, // pushi 0297
+	0x7a,             // push2
+	0x38, 0x0c, 0x01, // pushi 010c
+	0x7a,             // push2
+	0x81, 0x00,       // lag 00
+	0x4a, 0x08,       // send 08
+	0x67, 0x12,       // pTos 12 (query)
+	0x35, 0xb5,       // ldi b5
+	0
+};
+
+const uint16 qfg3PatchWooDialog[] = {
+	PATCH_ADDTOOFFSET | +0x29,
+	0x33, 0x11, // jmp to 0x6a2, the call to hero::solvePuzzle for 0xFFFC
+	PATCH_END
+};
+
 //    script, description,                                      magic DWORD,                                  adjust
 const SciScriptSignature qfg3Signatures[] = {
 	{    944, "import dialog continuous calls",                 1, PATCH_MAGICDWORD(0x2a, 0x31, 0x0b, 0x7a),  -1, qfg3SignatureImportDialog,         qfg3PatchImportDialog },
+	{    440, "dialog crash when asking about Woo",             1, PATCH_MAGICDWORD(0x67, 0x12, 0x35, 0xb5),  -26, qfg3SignatureWooDialog,         qfg3PatchWooDialog },
 	SCI_SIGNATUREENTRY_TERMINATOR
 };
 






More information about the Scummvm-git-logs mailing list