[Scummvm-cvs-logs] scummvm master -> 83c6e1543e556ac6f5f91a38508575747b70fcad

m-kiewitz m_kiewitz at users.sourceforge.net
Sat Apr 18 23:13:09 CEST 2015


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

Summary:
83c6e1543e SCI: add debug level for workarounds


Commit: 83c6e1543e556ac6f5f91a38508575747b70fcad
    https://github.com/scummvm/scummvm/commit/83c6e1543e556ac6f5f91a38508575747b70fcad
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2015-04-18T23:13:11+02:00

Commit Message:
SCI: add debug level for workarounds

It's called "Workarounds"

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



diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index cc77fba..4999664 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -555,6 +555,7 @@ SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroun
 		reg_t searchObject = lastCall->sendp;
 		const byte *curScriptPtr = NULL;
 		uint32 curScriptSize = 0;
+		bool matched = false;
 
 		do {
 			workaround = workaroundList;
@@ -595,7 +596,7 @@ SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroun
 
 							// now actually check for signature match
 							if (g_sci->getScriptPatcher()->verifySignature(curLocalCallOffset, workaround->localCallSignature, "workaround signature", curScriptPtr, curScriptSize)) {
-								return workaround->newValue;
+								matched = true;
 							}
 
 						} else {
@@ -605,6 +606,10 @@ SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroun
 						}
 					} else {
 						// no localcalls involved -> workaround matches
+						matched = true;
+					}
+					if (matched) {
+						debugC(kDebugLevelWorkarounds, "Workaround: '%s:%s' in script %d", workaround->objectName, workaround->methodName, curScriptNr);
 						return workaround->newValue;
 					}
 				}
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 60a1271..d07ab43 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -114,6 +114,7 @@ SciEngine::SciEngine(OSystem *syst, const ADGameDescription *desc, SciGameId gam
 	DebugMan.addDebugChannel(kDebugLevelVM, "VM", "VM debugging");
 	DebugMan.addDebugChannel(kDebugLevelScripts, "Scripts", "Notifies when scripts are unloaded");
 	DebugMan.addDebugChannel(kDebugLevelScriptPatcher, "ScriptPatcher", "Notifies when scripts are patched");
+	DebugMan.addDebugChannel(kDebugLevelWorkarounds, "Workarounds", "Notifies when workarounds are triggered");
 	DebugMan.addDebugChannel(kDebugLevelGC, "GC", "Garbage Collector debugging");
 	DebugMan.addDebugChannel(kDebugLevelResMan, "ResMan", "Resource manager debugging");
 	DebugMan.addDebugChannel(kDebugLevelOnStartup, "OnStartup", "Enter debugger at start of game");
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index 4928fd1..c6813aa 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -105,7 +105,8 @@ enum kDebugLevels {
 	kDebugLevelResMan        = 1 << 19,
 	kDebugLevelOnStartup     = 1 << 20,
 	kDebugLevelDebugMode     = 1 << 21,
-	kDebugLevelScriptPatcher = 1 << 22
+	kDebugLevelScriptPatcher = 1 << 22,
+	kDebugLevelWorkarounds   = 1 << 23
 };
 
 enum SciGameId {






More information about the Scummvm-git-logs mailing list