aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-29 21:33:42 +0000
committerMartin Kiewitz2010-07-29 21:33:42 +0000
commit4101d4095716fee32ff1f3a4583d4b17eb7bab2f (patch)
tree1aba7ca372ac5f9e7b492622d9a24ce9fa339fdb
parent1c24f2ca8fc333e5cf4df29dfbca83a9eb50bf3f (diff)
downloadscummvm-rg350-4101d4095716fee32ff1f3a4583d4b17eb7bab2f.tar.gz
scummvm-rg350-4101d4095716fee32ff1f3a4583d4b17eb7bab2f.tar.bz2
scummvm-rg350-4101d4095716fee32ff1f3a4583d4b17eb7bab2f.zip
SCI: finished logkernel command
use 'logkernel DoSound' on to log calls to all kDoSound subfunctions. use 'logkernel DoSoundPlay' to log calls to kDoSound(play) svn-id: r51483
-rw-r--r--engines/sci/engine/kernel.cpp39
1 files changed, 23 insertions, 16 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 70a0166b15..9c5997f4ee 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -652,30 +652,37 @@ void Kernel::mapFunctions() {
bool Kernel::debugSetFunctionLogging(const char *kernelName, bool logging) {
if (strcmp(kernelName, "*")) {
- const char *kernelSubName = strchr(kernelName, '(');
- uint kernelSubNameLen = 0;
- if (kernelSubName) {
- kernelSubName++;
- kernelSubNameLen = strlen(kernelSubName);
- if ((!kernelSubNameLen) || (kernelSubName[kernelSubNameLen - 1] != ')'))
- return false;
- }
for (uint id = 0; id < _kernelFuncs.size(); id++) {
if (_kernelFuncs[id].name) {
- if (!_kernelFuncs[id].subFunctions) {
- // No sub-functions, enable actual kernel function
- if (strcmp(kernelName, _kernelFuncs[id].name) == 0) {
- _kernelFuncs[id].debugLogging = logging;
+ if (strcmp(kernelName, _kernelFuncs[id].name) == 0) {
+ if (_kernelFuncs[id].subFunctions) {
+ // sub-functions available and main name matched, in that case set logging of all sub-functions
+ KernelSubFunction *kernelSubCall = _kernelFuncs[id].subFunctions;
+ uint kernelSubCallCount = _kernelFuncs[id].subFunctionCount;
+ for (uint subId = 0; subId < kernelSubCallCount; subId++) {
+ if (kernelSubCall->function)
+ kernelSubCall->debugLogging = logging;
+ kernelSubCall++;
+ }
return true;
}
+ // function name matched, set for this one and exit
+ _kernelFuncs[id].debugLogging = logging;
+ return true;
} else {
- // Sub-Functions available
- if (kernelSubName) {
+ // main name was not matched
+ if (_kernelFuncs[id].subFunctions) {
+ // Sub-Functions available
KernelSubFunction *kernelSubCall = _kernelFuncs[id].subFunctions;
uint kernelSubCallCount = _kernelFuncs[id].subFunctionCount;
for (uint subId = 0; subId < kernelSubCallCount; subId++) {
- if (kernelSubCall->function)
- kernelSubCall->debugLogging = logging;
+ if (kernelSubCall->function) {
+ if (strcmp(kernelName, kernelSubCall->name) == 0) {
+ // sub-function name matched, set for this one and exit
+ kernelSubCall->debugLogging = logging;
+ return true;
+ }
+ }
kernelSubCall++;
}
}