SCI: add debug level for workarounds

It's called "Workarounds"
This commit is contained in:
Martin Kiewitz 2015-04-18 23:13:11 +02:00
parent 4efaab4015
commit 83c6e1543e
3 changed files with 9 additions and 2 deletions

View file

@ -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;
}
}

View file

@ -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");

View file

@ -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 {