diff options
author | Willem Jan Palenstijn | 2015-07-22 22:37:40 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-07-22 22:43:42 +0200 |
commit | 6ec9c81b575f13b2c4b30aeac592ebf2557b5890 (patch) | |
tree | 503d50902bad2d800165593039d08d5ccf0c98ab /engines/sci/engine/kernel.cpp | |
parent | 5ec05f6b647c5ea41418be7ed19ad381f97cabd8 (diff) | |
parent | 4e5c8d35f7e133e2e72a846fdbd54900c91eeb73 (diff) | |
download | scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.tar.gz scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.tar.bz2 scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.zip |
Merge branch 'master' into mm
Conflicts:
engines/access/access.cpp
engines/access/asurface.h
engines/access/bubble_box.cpp
engines/access/bubble_box.h
engines/access/martian/martian_game.cpp
engines/access/player.cpp
engines/access/player.h
engines/access/resources.cpp
engines/access/screen.cpp
engines/access/screen.h
engines/access/sound.cpp
engines/access/sound.h
Diffstat (limited to 'engines/sci/engine/kernel.cpp')
-rw-r--r-- | engines/sci/engine/kernel.cpp | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index 2b16bb3d99..bfb7bfcd08 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -432,57 +432,66 @@ static const SignatureDebugType signatureDebugTypeList[] = { { 0, NULL } }; -static void kernelSignatureDebugType(const uint16 type) { +static void kernelSignatureDebugType(Common::String &signatureDetailsStr, const uint16 type) { bool firstPrint = true; const SignatureDebugType *list = signatureDebugTypeList; while (list->typeCheck) { if (type & list->typeCheck) { if (!firstPrint) - debugN(", "); - debugN("%s", list->text); +// debugN(", "); + signatureDetailsStr += ", "; +// debugN("%s", list->text); +// signatureDetailsStr += signatureDetailsStr.format("%s", list->text); + signatureDetailsStr += list->text; firstPrint = false; } list++; } } -// Shows kernel call signature and current arguments for debugging purposes -void Kernel::signatureDebug(const uint16 *sig, int argc, const reg_t *argv) { +// Create string, that holds the details of a kernel call signature and current arguments +// For debugging purposes +void Kernel::signatureDebug(Common::String &signatureDetailsStr, const uint16 *sig, int argc, const reg_t *argv) { int argnr = 0; + + // add ERROR: to debug output + debugN("ERROR:"); + while (*sig || argc) { - debugN("parameter %d: ", argnr++); + // add leading spaces for additional parameters + signatureDetailsStr += signatureDetailsStr.format("parameter %d: ", argnr++); if (argc) { reg_t parameter = *argv; - debugN("%04x:%04x (", PRINT_REG(parameter)); + signatureDetailsStr += signatureDetailsStr.format("%04x:%04x (", PRINT_REG(parameter)); int regType = findRegType(parameter); if (regType) - kernelSignatureDebugType(regType); + kernelSignatureDebugType(signatureDetailsStr, regType); else - debugN("unknown type of %04x:%04x", PRINT_REG(parameter)); - debugN(")"); + signatureDetailsStr += signatureDetailsStr.format("unknown type of %04x:%04x", PRINT_REG(parameter)); + signatureDetailsStr += ")"; argv++; argc--; } else { - debugN("not passed"); + signatureDetailsStr += "not passed"; } if (*sig) { const uint16 signature = *sig; if ((signature & SIG_MAYBE_ANY) == SIG_MAYBE_ANY) { - debugN(", may be any"); + signatureDetailsStr += ", may be any"; } else { - debugN(", should be "); - kernelSignatureDebugType(signature); + signatureDetailsStr += ", should be "; + kernelSignatureDebugType(signatureDetailsStr, signature); } if (signature & SIG_IS_OPTIONAL) - debugN(" (optional)"); + signatureDetailsStr += " (optional)"; if (signature & SIG_NEEDS_MORE) - debugN(" (needs more)"); + signatureDetailsStr += " (needs more)"; if (signature & SIG_MORE_MAY_FOLLOW) - debugN(" (more may follow)"); + signatureDetailsStr += " (more may follow)"; sig++; } - debugN("\n"); + signatureDetailsStr += "\n"; } } |