SCI: add debug level for workarounds
It's called "Workarounds"
This commit is contained in:
parent
4efaab4015
commit
83c6e1543e
3 changed files with 9 additions and 2 deletions
|
@ -555,6 +555,7 @@ SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroun
|
||||||
reg_t searchObject = lastCall->sendp;
|
reg_t searchObject = lastCall->sendp;
|
||||||
const byte *curScriptPtr = NULL;
|
const byte *curScriptPtr = NULL;
|
||||||
uint32 curScriptSize = 0;
|
uint32 curScriptSize = 0;
|
||||||
|
bool matched = false;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
workaround = workaroundList;
|
workaround = workaroundList;
|
||||||
|
@ -595,7 +596,7 @@ SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroun
|
||||||
|
|
||||||
// now actually check for signature match
|
// now actually check for signature match
|
||||||
if (g_sci->getScriptPatcher()->verifySignature(curLocalCallOffset, workaround->localCallSignature, "workaround signature", curScriptPtr, curScriptSize)) {
|
if (g_sci->getScriptPatcher()->verifySignature(curLocalCallOffset, workaround->localCallSignature, "workaround signature", curScriptPtr, curScriptSize)) {
|
||||||
return workaround->newValue;
|
matched = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -605,6 +606,10 @@ SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroun
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// no localcalls involved -> workaround matches
|
// 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;
|
return workaround->newValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,6 +114,7 @@ SciEngine::SciEngine(OSystem *syst, const ADGameDescription *desc, SciGameId gam
|
||||||
DebugMan.addDebugChannel(kDebugLevelVM, "VM", "VM debugging");
|
DebugMan.addDebugChannel(kDebugLevelVM, "VM", "VM debugging");
|
||||||
DebugMan.addDebugChannel(kDebugLevelScripts, "Scripts", "Notifies when scripts are unloaded");
|
DebugMan.addDebugChannel(kDebugLevelScripts, "Scripts", "Notifies when scripts are unloaded");
|
||||||
DebugMan.addDebugChannel(kDebugLevelScriptPatcher, "ScriptPatcher", "Notifies when scripts are patched");
|
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(kDebugLevelGC, "GC", "Garbage Collector debugging");
|
||||||
DebugMan.addDebugChannel(kDebugLevelResMan, "ResMan", "Resource manager debugging");
|
DebugMan.addDebugChannel(kDebugLevelResMan, "ResMan", "Resource manager debugging");
|
||||||
DebugMan.addDebugChannel(kDebugLevelOnStartup, "OnStartup", "Enter debugger at start of game");
|
DebugMan.addDebugChannel(kDebugLevelOnStartup, "OnStartup", "Enter debugger at start of game");
|
||||||
|
|
|
@ -105,7 +105,8 @@ enum kDebugLevels {
|
||||||
kDebugLevelResMan = 1 << 19,
|
kDebugLevelResMan = 1 << 19,
|
||||||
kDebugLevelOnStartup = 1 << 20,
|
kDebugLevelOnStartup = 1 << 20,
|
||||||
kDebugLevelDebugMode = 1 << 21,
|
kDebugLevelDebugMode = 1 << 21,
|
||||||
kDebugLevelScriptPatcher = 1 << 22
|
kDebugLevelScriptPatcher = 1 << 22,
|
||||||
|
kDebugLevelWorkarounds = 1 << 23
|
||||||
};
|
};
|
||||||
|
|
||||||
enum SciGameId {
|
enum SciGameId {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue