diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/gc.cpp | 18 | ||||
-rw-r--r-- | engines/sci/engine/kernel.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/kfile.cpp | 46 | ||||
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 20 | ||||
-rw-r--r-- | engines/sci/engine/klists.cpp | 18 | ||||
-rw-r--r-- | engines/sci/engine/kmisc.cpp | 10 | ||||
-rw-r--r-- | engines/sci/engine/kmovement.cpp | 16 | ||||
-rw-r--r-- | engines/sci/engine/kparse.cpp | 10 | ||||
-rw-r--r-- | engines/sci/engine/kpathing.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/kscripts.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/ksound.cpp | 20 | ||||
-rw-r--r-- | engines/sci/engine/kstring.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/script.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/segment.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/vm.cpp | 8 | ||||
-rw-r--r-- | engines/sci/graphics/menu.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/palette.cpp | 2 | ||||
-rw-r--r-- | engines/sci/sound/soundcmd.cpp | 44 |
18 files changed, 118 insertions, 118 deletions
diff --git a/engines/sci/engine/gc.cpp b/engines/sci/engine/gc.cpp index c1939c6566..b5dfb3a4c3 100644 --- a/engines/sci/engine/gc.cpp +++ b/engines/sci/engine/gc.cpp @@ -38,7 +38,7 @@ struct WorklistManager { if (!reg.segment) // No numbers return; - debugC(2, kDebugLevelGC, "[GC] Adding %04x:%04x", PRINT_REG(reg)); + debugC(kDebugLevelGC, "[GC] Adding %04x:%04x", PRINT_REG(reg)); if (_map.contains(reg)) return; // already dealt with it @@ -98,7 +98,7 @@ AddrSet *findAllActiveReferences(EngineState *s) { for (pos = s->stack_base; pos < xs.sp; pos++) wm.push(*pos); - debugC(2, kDebugLevelGC, "[GC] -- Finished adding value stack"); + debugC(kDebugLevelGC, "[GC] -- Finished adding value stack"); // Init: Execution Stack for (iter = s->_executionStack.begin(); @@ -113,7 +113,7 @@ AddrSet *findAllActiveReferences(EngineState *s) { } } - debugC(2, kDebugLevelGC, "[GC] -- Finished adding execution stack"); + debugC(kDebugLevelGC, "[GC] -- Finished adding execution stack"); const Common::Array<SegmentObj *> &heap = segMan->getSegments(); @@ -128,7 +128,7 @@ AddrSet *findAllActiveReferences(EngineState *s) { } } - debugC(2, kDebugLevelGC, "[GC] -- Finished explicitly loaded scripts, done with root set"); + debugC(kDebugLevelGC, "[GC] -- Finished explicitly loaded scripts, done with root set"); // Run Worklist Algorithm SegmentId stack_seg = segMan->findSegmentByType(SEG_TYPE_STACK); @@ -136,7 +136,7 @@ AddrSet *findAllActiveReferences(EngineState *s) { reg_t reg = wm._worklist.back(); wm._worklist.pop_back(); if (reg.segment != stack_seg) { // No need to repeat this one - debugC(2, kDebugLevelGC, "[GC] Checking %04x:%04x", PRINT_REG(reg)); + debugC(kDebugLevelGC, "[GC] Checking %04x:%04x", PRINT_REG(reg)); if (reg.segment < heap.size() && heap[reg.segment]) { // Valid heap object? Find its outgoing references! wm.pushArray(heap[reg.segment]->listAllOutgoingReferences(reg)); @@ -154,7 +154,7 @@ void run_gc(EngineState *s) { SegManager *segMan = s->_segMan; // Some debug stuff - debugC(2, kDebugLevelGC, "[GC] Running..."); + debugC(kDebugLevelGC, "[GC] Running..."); #ifdef GC_DEBUG_CODE const char *segnames[SEG_TYPE_MAX + 1]; int segcount[SEG_TYPE_MAX + 1]; @@ -185,7 +185,7 @@ void run_gc(EngineState *s) { if (!activeRefs->contains(addr)) { // Not found -> we can free it mobj->freeAtAddress(segMan, addr); - debugC(2, kDebugLevelGC, "[GC] Deallocating %04x:%04x", PRINT_REG(addr)); + debugC(kDebugLevelGC, "[GC] Deallocating %04x:%04x", PRINT_REG(addr)); #ifdef GC_DEBUG_CODE segcount[type]++; #endif @@ -199,10 +199,10 @@ void run_gc(EngineState *s) { #ifdef GC_DEBUG_CODE // Output debug summary of garbage collection - debugC(2, kDebugLevelGC, "[GC] Summary:"); + debugC(kDebugLevelGC, "[GC] Summary:"); for (int i = 0; i <= SEG_TYPE_MAX; i++) if (segcount[i]) - debugC(2, kDebugLevelGC, "\t%d\t* %s", segcount[i], segnames[i]); + debugC(kDebugLevelGC, "\t%d\t* %s", segcount[i], segnames[i]); #endif } diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index e115fd109e..db8172fc58 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -102,7 +102,7 @@ int Kernel::findSelector(const char *selectorName) const { return pos; } - debugC(2, kDebugLevelVM, "Could not map '%s' to any selector", selectorName); + debugC(kDebugLevelVM, "Could not map '%s' to any selector", selectorName); return -1; } @@ -662,7 +662,7 @@ void Kernel::mapFunctions() { } } // for all functions requesting to be mapped - debugC(2, kDebugLevelVM, "Handled %d/%d kernel functions, mapping %d and ignoring %d.", + debugC(kDebugLevelVM, "Handled %d/%d kernel functions, mapping %d and ignoring %d.", mapped + ignored, _kernelNames.size(), mapped, ignored); return; diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index a2a2db1dff..0ea38a82a7 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -132,17 +132,17 @@ reg_t file_open(EngineState *s, const char *filename, int mode, bool unwrapFilen } if (!inFile) - debugC(2, kDebugLevelFile, " -> file_open(_K_FILE_MODE_OPEN_OR_FAIL): failed to open file '%s'", englishName.c_str()); + debugC(kDebugLevelFile, " -> file_open(_K_FILE_MODE_OPEN_OR_FAIL): failed to open file '%s'", englishName.c_str()); } else if (mode == _K_FILE_MODE_CREATE) { // Create the file, destroying any content it might have had outFile = saveFileMan->openForSaving(wrappedName); if (!outFile) - debugC(2, kDebugLevelFile, " -> file_open(_K_FILE_MODE_CREATE): failed to create file '%s'", englishName.c_str()); + debugC(kDebugLevelFile, " -> file_open(_K_FILE_MODE_CREATE): failed to create file '%s'", englishName.c_str()); } else if (mode == _K_FILE_MODE_OPEN_OR_CREATE) { // Try to open file, create it if it doesn't exist outFile = saveFileMan->openForSaving(wrappedName); if (!outFile) - debugC(2, kDebugLevelFile, " -> file_open(_K_FILE_MODE_CREATE): failed to create file '%s'", englishName.c_str()); + debugC(kDebugLevelFile, " -> file_open(_K_FILE_MODE_CREATE): failed to create file '%s'", englishName.c_str()); // QfG1 opens the character export file with _K_FILE_MODE_CREATE first, // closes it immediately and opens it again with this here. Perhaps // other games use this for read access as well. I guess changing this @@ -153,7 +153,7 @@ reg_t file_open(EngineState *s, const char *filename, int mode, bool unwrapFilen } if (!inFile && !outFile) { // Failed - debugC(2, kDebugLevelFile, " -> file_open() failed"); + debugC(kDebugLevelFile, " -> file_open() failed"); return SIGNAL_REG; } @@ -171,7 +171,7 @@ reg_t file_open(EngineState *s, const char *filename, int mode, bool unwrapFilen s->_fileHandles[handle]._out = outFile; s->_fileHandles[handle]._name = englishName; - debugC(2, kDebugLevelFile, " -> opened file '%s' with handle %d", englishName.c_str(), handle); + debugC(kDebugLevelFile, " -> opened file '%s' with handle %d", englishName.c_str(), handle); return make_reg(0, handle); } @@ -179,7 +179,7 @@ reg_t kFOpen(EngineState *s, int argc, reg_t *argv) { Common::String name = s->_segMan->getString(argv[0]); int mode = argv[1].toUint16(); - debugC(2, kDebugLevelFile, "kFOpen(%s,0x%x)", name.c_str(), mode); + debugC(kDebugLevelFile, "kFOpen(%s,0x%x)", name.c_str(), mode); return file_open(s, name.c_str(), mode, true); } @@ -198,7 +198,7 @@ static FileHandle *getFileFromHandle(EngineState *s, uint handle) { } reg_t kFClose(EngineState *s, int argc, reg_t *argv) { - debugC(2, kDebugLevelFile, "kFClose(%d)", argv[0].toUint16()); + debugC(kDebugLevelFile, "kFClose(%d)", argv[0].toUint16()); if (argv[0] != SIGNAL_REG) { FileHandle *f = getFileFromHandle(s, argv[0].toUint16()); if (f) @@ -241,7 +241,7 @@ static int fgets_wrapper(EngineState *s, char *dest, int maxsize, int handle) { *dest = 0; } - debugC(2, kDebugLevelFile, " -> FGets'ed \"%s\"", dest); + debugC(kDebugLevelFile, " -> FGets'ed \"%s\"", dest); return readBytes; } @@ -250,7 +250,7 @@ reg_t kFGets(EngineState *s, int argc, reg_t *argv) { char *buf = new char[maxsize]; int handle = argv[2].toUint16(); - debugC(2, kDebugLevelFile, "kFGets(%d, %d)", handle, maxsize); + debugC(kDebugLevelFile, "kFGets(%d, %d)", handle, maxsize); int readBytes = fgets_wrapper(s, buf, maxsize, handle); s->_segMan->memcpy(argv[0], (const byte*)buf, maxsize); return readBytes ? argv[0] : NULL_REG; @@ -265,7 +265,7 @@ reg_t kGetCWD(EngineState *s, int argc, reg_t *argv) { // TODO/FIXME: Is "/" a good value? Maybe "" or "." or "C:\" are better? s->_segMan->strcpy(argv[0], "/"); - debugC(2, kDebugLevelFile, "kGetCWD() -> %s", "/"); + debugC(kDebugLevelFile, "kGetCWD() -> %s", "/"); return argv[0]; } @@ -768,16 +768,16 @@ reg_t kFileIOOpen(EngineState *s, int argc, reg_t *argv) { // loading, so just stop the game from modifying the file here in order // to avoid having it saved in the ScummVM save directory. if (name == "sq4sg.dir") { - debugC(2, kDebugLevelFile, "Not opening unused file sq4sg.dir"); + debugC(kDebugLevelFile, "Not opening unused file sq4sg.dir"); return SIGNAL_REG; } if (name.empty()) { // Happens many times during KQ1 (e.g. when typing something) - debugC(2, kDebugLevelFile, "Attempted to open a file with an empty filename"); + debugC(kDebugLevelFile, "Attempted to open a file with an empty filename"); return SIGNAL_REG; } - debugC(2, kDebugLevelFile, "kFileIO(open): %s, 0x%x", name.c_str(), mode); + debugC(kDebugLevelFile, "kFileIO(open): %s, 0x%x", name.c_str(), mode); // QFG import rooms get a virtual filelisting instead of an actual one if (g_sci->inQfGImportRoom()) { @@ -791,7 +791,7 @@ reg_t kFileIOOpen(EngineState *s, int argc, reg_t *argv) { } reg_t kFileIOClose(EngineState *s, int argc, reg_t *argv) { - debugC(2, kDebugLevelFile, "kFileIO(close): %d", argv[0].toUint16()); + debugC(kDebugLevelFile, "kFileIO(close): %d", argv[0].toUint16()); FileHandle *f = getFileFromHandle(s, argv[0].toUint16()); if (f) { @@ -806,7 +806,7 @@ reg_t kFileIOReadRaw(EngineState *s, int argc, reg_t *argv) { int size = argv[2].toUint16(); int bytesRead = 0; char *buf = new char[size]; - debugC(2, kDebugLevelFile, "kFileIO(readRaw): %d, %d", handle, size); + debugC(kDebugLevelFile, "kFileIO(readRaw): %d, %d", handle, size); FileHandle *f = getFileFromHandle(s, handle); if (f) { @@ -824,7 +824,7 @@ reg_t kFileIOWriteRaw(EngineState *s, int argc, reg_t *argv) { char *buf = new char[size]; bool success = false; s->_segMan->memcpy((byte*)buf, argv[1], size); - debugC(2, kDebugLevelFile, "kFileIO(writeRaw): %d, %d", handle, size); + debugC(kDebugLevelFile, "kFileIO(writeRaw): %d, %d", handle, size); FileHandle *f = getFileFromHandle(s, handle); if (f) { @@ -867,7 +867,7 @@ reg_t kFileIOUnlink(EngineState *s, int argc, reg_t *argv) { result = saveFileMan->removeSavefile(wrappedName); } - debugC(2, kDebugLevelFile, "kFileIO(unlink): %s", name.c_str()); + debugC(kDebugLevelFile, "kFileIO(unlink): %s", name.c_str()); if (result) return NULL_REG; return make_reg(0, 2); // DOS - file not found error code @@ -877,7 +877,7 @@ reg_t kFileIOReadString(EngineState *s, int argc, reg_t *argv) { int size = argv[1].toUint16(); char *buf = new char[size]; int handle = argv[2].toUint16(); - debugC(2, kDebugLevelFile, "kFileIO(readString): %d, %d", handle, size); + debugC(kDebugLevelFile, "kFileIO(readString): %d, %d", handle, size); int readBytes = fgets_wrapper(s, buf, size, handle); s->_segMan->memcpy(argv[0], (const byte*)buf, size); @@ -888,7 +888,7 @@ reg_t kFileIOReadString(EngineState *s, int argc, reg_t *argv) { reg_t kFileIOWriteString(EngineState *s, int argc, reg_t *argv) { int handle = argv[0].toUint16(); Common::String str = s->_segMan->getString(argv[1]); - debugC(2, kDebugLevelFile, "kFileIO(writeString): %d", handle); + debugC(kDebugLevelFile, "kFileIO(writeString): %d", handle); FileHandle *f = getFileFromHandle(s, handle); @@ -904,7 +904,7 @@ reg_t kFileIOSeek(EngineState *s, int argc, reg_t *argv) { int handle = argv[0].toUint16(); int offset = argv[1].toUint16(); int whence = argv[2].toUint16(); - debugC(2, kDebugLevelFile, "kFileIO(seek): %d, %d, %d", handle, offset, whence); + debugC(kDebugLevelFile, "kFileIO(seek): %d, %d, %d", handle, offset, whence); FileHandle *f = getFileFromHandle(s, handle); @@ -1016,7 +1016,7 @@ reg_t kFileIOFindFirst(EngineState *s, int argc, reg_t *argv) { Common::String mask = s->_segMan->getString(argv[0]); reg_t buf = argv[1]; int attr = argv[2].toUint16(); // We won't use this, Win32 might, though... - debugC(2, kDebugLevelFile, "kFileIO(findFirst): %s, 0x%x", mask.c_str(), attr); + debugC(kDebugLevelFile, "kFileIO(findFirst): %s, 0x%x", mask.c_str(), attr); // We remove ".*". mask will get prefixed, so we will return all additional files for that gameid if (mask == "*.*") @@ -1025,7 +1025,7 @@ reg_t kFileIOFindFirst(EngineState *s, int argc, reg_t *argv) { } reg_t kFileIOFindNext(EngineState *s, int argc, reg_t *argv) { - debugC(2, kDebugLevelFile, "kFileIO(findNext)"); + debugC(kDebugLevelFile, "kFileIO(findNext)"); return s->_dirseeker.nextFile(s->_segMan); } @@ -1067,7 +1067,7 @@ reg_t kFileIOExists(EngineState *s, int argc, reg_t *argv) { exists = true; } - debugC(2, kDebugLevelFile, "kFileIO(fileExists) %s -> %d", name.c_str(), exists); + debugC(kDebugLevelFile, "kFileIO(fileExists) %s -> %d", name.c_str(), exists); return make_reg(0, exists); } diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 33c819fa4c..ded20167df 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -344,7 +344,7 @@ reg_t kTextSize(EngineState *s, int argc, reg_t *argv) { int font_nr = argv[2].toUint16(); if (!dest) { - debugC(2, kDebugLevelStrings, "GetTextSize: Empty destination"); + debugC(kDebugLevelStrings, "GetTextSize: Empty destination"); return s->r_acc; } @@ -359,7 +359,7 @@ reg_t kTextSize(EngineState *s, int argc, reg_t *argv) { if (text.empty()) { // Empty text dest[2] = dest[3] = make_reg(0, 0); - debugC(2, kDebugLevelStrings, "GetTextSize: Empty string"); + debugC(kDebugLevelStrings, "GetTextSize: Empty string"); return s->r_acc; } @@ -373,7 +373,7 @@ reg_t kTextSize(EngineState *s, int argc, reg_t *argv) { #endif g_sci->_gfxText16->kernelTextSize(g_sci->strSplit(text.c_str(), sep).c_str(), font_nr, maxwidth, &textWidth, &textHeight); - debugC(2, kDebugLevelStrings, "GetTextSize '%s' -> %dx%d", text.c_str(), textWidth, textHeight); + debugC(kDebugLevelStrings, "GetTextSize '%s' -> %dx%d", text.c_str(), textWidth, textHeight); dest[2] = make_reg(0, textHeight); dest[3] = make_reg(0, textWidth); return s->r_acc; @@ -469,7 +469,7 @@ reg_t kNumLoops(EngineState *s, int argc, reg_t *argv) { loopCount = g_sci->_gfxCache->kernelViewGetLoopCount(viewId); - debugC(2, kDebugLevelGraphics, "NumLoops(view.%d) = %d", viewId, loopCount); + debugC(kDebugLevelGraphics, "NumLoops(view.%d) = %d", viewId, loopCount); return make_reg(0, loopCount); } @@ -482,7 +482,7 @@ reg_t kNumCels(EngineState *s, int argc, reg_t *argv) { celCount = g_sci->_gfxCache->kernelViewGetCelCount(viewId, loopNo); - debugC(2, kDebugLevelGraphics, "NumCels(view.%d, %d) = %d", viewId, loopNo, celCount); + debugC(kDebugLevelGraphics, "NumCels(view.%d, %d) = %d", viewId, loopNo, celCount); return make_reg(0, celCount); } @@ -801,13 +801,13 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) { switch (type) { case SCI_CONTROLS_TYPE_BUTTON: - debugC(2, kDebugLevelGraphics, "drawing button %04x:%04x to %d,%d", PRINT_REG(controlObject), x, y); + debugC(kDebugLevelGraphics, "drawing button %04x:%04x to %d,%d", PRINT_REG(controlObject), x, y); g_sci->_gfxControls->kernelDrawButton(rect, controlObject, g_sci->strSplit(text.c_str(), NULL).c_str(), fontId, style, hilite); return; case SCI_CONTROLS_TYPE_TEXT: alignment = readSelectorValue(s->_segMan, controlObject, SELECTOR(mode)); - debugC(2, kDebugLevelGraphics, "drawing text %04x:%04x ('%s') to %d,%d, mode=%d", PRINT_REG(controlObject), text.c_str(), x, y, alignment); + debugC(kDebugLevelGraphics, "drawing text %04x:%04x ('%s') to %d,%d, mode=%d", PRINT_REG(controlObject), text.c_str(), x, y, alignment); g_sci->_gfxControls->kernelDrawText(rect, controlObject, g_sci->strSplit(text.c_str()).c_str(), fontId, alignment, style, hilite); s->r_acc = g_sci->_gfxText16->allocAndFillReferenceRectArray(); return; @@ -821,7 +821,7 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) { cursorPos = text.size(); writeSelectorValue(s->_segMan, controlObject, SELECTOR(cursor), cursorPos); } - debugC(2, kDebugLevelGraphics, "drawing edit control %04x:%04x (text %04x:%04x, '%s') to %d,%d", PRINT_REG(controlObject), PRINT_REG(textReference), text.c_str(), x, y); + debugC(kDebugLevelGraphics, "drawing edit control %04x:%04x (text %04x:%04x, '%s') to %d,%d", PRINT_REG(controlObject), PRINT_REG(textReference), text.c_str(), x, y); g_sci->_gfxControls->kernelDrawTextEdit(rect, controlObject, g_sci->strSplit(text.c_str(), NULL).c_str(), fontId, mode, style, cursorPos, maxChars, hilite); return; @@ -838,7 +838,7 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) { else priority = -1; } - debugC(2, kDebugLevelGraphics, "drawing icon control %04x:%04x to %d,%d", PRINT_REG(controlObject), x, y - 1); + debugC(kDebugLevelGraphics, "drawing icon control %04x:%04x to %d,%d", PRINT_REG(controlObject), x, y - 1); g_sci->_gfxControls->kernelDrawIcon(rect, controlObject, viewId, loopNo, celNo, priority, style, hilite); return; @@ -886,7 +886,7 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) { } } - debugC(2, kDebugLevelGraphics, "drawing list control %04x:%04x to %d,%d, diff %d", PRINT_REG(controlObject), x, y, SCI_MAX_SAVENAME_LENGTH); + debugC(kDebugLevelGraphics, "drawing list control %04x:%04x to %d,%d, diff %d", PRINT_REG(controlObject), x, y, SCI_MAX_SAVENAME_LENGTH); g_sci->_gfxControls->kernelDrawList(rect, controlObject, maxChars, listCount, listEntries, fontId, style, upperPos, cursorPos, isAlias, hilite); free(listEntries); delete[] listStrings; diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp index 5dce2f5d28..38cd6ef023 100644 --- a/engines/sci/engine/klists.cpp +++ b/engines/sci/engine/klists.cpp @@ -131,7 +131,7 @@ reg_t kNewList(EngineState *s, int argc, reg_t *argv) { reg_t listRef; List *list = s->_segMan->allocateList(&listRef); list->first = list->last = NULL_REG; - debugC(2, kDebugLevelNodes, "New listRef at %04x:%04x", PRINT_REG(listRef)); + debugC(kDebugLevelNodes, "New listRef at %04x:%04x", PRINT_REG(listRef)); return listRef; // Return list base address } @@ -150,7 +150,7 @@ reg_t kNewNode(EngineState *s, int argc, reg_t *argv) { reg_t nodeKey = (argc == 2) ? argv[1] : argv[0]; s->r_acc = s->_segMan->newNode(nodeValue, nodeKey); - debugC(2, kDebugLevelNodes, "New nodeRef at %04x:%04x", PRINT_REG(s->r_acc)); + debugC(kDebugLevelNodes, "New nodeRef at %04x:%04x", PRINT_REG(s->r_acc)); return s->r_acc; } @@ -202,7 +202,7 @@ static void addToFront(EngineState *s, reg_t listRef, reg_t nodeRef) { List *list = s->_segMan->lookupList(listRef); Node *newNode = s->_segMan->lookupNode(nodeRef); - debugC(2, kDebugLevelNodes, "Adding node %04x:%04x to end of list %04x:%04x", PRINT_REG(nodeRef), PRINT_REG(listRef)); + debugC(kDebugLevelNodes, "Adding node %04x:%04x to end of list %04x:%04x", PRINT_REG(nodeRef), PRINT_REG(listRef)); if (!newNode) error("Attempt to add non-node (%04x:%04x) to list at %04x:%04x", PRINT_REG(nodeRef), PRINT_REG(listRef)); @@ -228,7 +228,7 @@ static void addToEnd(EngineState *s, reg_t listRef, reg_t nodeRef) { List *list = s->_segMan->lookupList(listRef); Node *newNode = s->_segMan->lookupNode(nodeRef); - debugC(2, kDebugLevelNodes, "Adding node %04x:%04x to end of list %04x:%04x", PRINT_REG(nodeRef), PRINT_REG(listRef)); + debugC(kDebugLevelNodes, "Adding node %04x:%04x to end of list %04x:%04x", PRINT_REG(nodeRef), PRINT_REG(listRef)); if (!newNode) error("Attempt to add non-node (%04x:%04x) to list at %04x:%04x", PRINT_REG(nodeRef), PRINT_REG(listRef)); @@ -350,7 +350,7 @@ reg_t kFindKey(EngineState *s, int argc, reg_t *argv) { reg_t key = argv[1]; reg_t list_pos = argv[0]; - debugC(2, kDebugLevelNodes, "Looking for key %04x:%04x in list %04x:%04x", PRINT_REG(key), PRINT_REG(list_pos)); + debugC(kDebugLevelNodes, "Looking for key %04x:%04x in list %04x:%04x", PRINT_REG(key), PRINT_REG(list_pos)); #ifdef CHECK_LISTS checkListPointer(s->_segMan, argv[0]); @@ -358,20 +358,20 @@ reg_t kFindKey(EngineState *s, int argc, reg_t *argv) { node_pos = s->_segMan->lookupList(list_pos)->first; - debugC(2, kDebugLevelNodes, "First node at %04x:%04x", PRINT_REG(node_pos)); + debugC(kDebugLevelNodes, "First node at %04x:%04x", PRINT_REG(node_pos)); while (!node_pos.isNull()) { Node *n = s->_segMan->lookupNode(node_pos); if (n->key == key) { - debugC(2, kDebugLevelNodes, " Found key at %04x:%04x", PRINT_REG(node_pos)); + debugC(kDebugLevelNodes, " Found key at %04x:%04x", PRINT_REG(node_pos)); return node_pos; } node_pos = n->succ; - debugC(2, kDebugLevelNodes, "NextNode at %04x:%04x", PRINT_REG(node_pos)); + debugC(kDebugLevelNodes, "NextNode at %04x:%04x", PRINT_REG(node_pos)); } - debugC(2, kDebugLevelNodes, "Looking for key without success"); + debugC(kDebugLevelNodes, "Looking for key without success"); return NULL_REG; } diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index 2d611d32ef..609b80bce8 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -170,7 +170,7 @@ reg_t kMemorySegment(EngineState *s, int argc, reg_t *argv) { reg_t kFlushResources(EngineState *s, int argc, reg_t *argv) { run_gc(s); - debugC(2, kDebugLevelRoom, "Entering room number %d", argv[0].toUint16()); + debugC(kDebugLevelRoom, "Entering room number %d", argv[0].toUint16()); return s->r_acc; } @@ -206,19 +206,19 @@ reg_t kGetTime(EngineState *s, int argc, reg_t *argv) { switch (mode) { case KGETTIME_TICKS : retval = elapsedTime * 60 / 1000; - debugC(2, kDebugLevelTime, "GetTime(elapsed) returns %d", retval); + debugC(kDebugLevelTime, "GetTime(elapsed) returns %d", retval); break; case KGETTIME_TIME_12HOUR : retval = ((loc_time.tm_hour % 12) << 12) | (loc_time.tm_min << 6) | (loc_time.tm_sec); - debugC(2, kDebugLevelTime, "GetTime(12h) returns %d", retval); + debugC(kDebugLevelTime, "GetTime(12h) returns %d", retval); break; case KGETTIME_TIME_24HOUR : retval = (loc_time.tm_hour << 11) | (loc_time.tm_min << 5) | (loc_time.tm_sec >> 1); - debugC(2, kDebugLevelTime, "GetTime(24h) returns %d", retval); + debugC(kDebugLevelTime, "GetTime(24h) returns %d", retval); break; case KGETTIME_DATE : retval = loc_time.tm_mday | ((loc_time.tm_mon + 1) << 5) | (((loc_time.tm_year + 1900) & 0x7f) << 9); - debugC(2, kDebugLevelTime, "GetTime(date) returns %d", retval); + debugC(kDebugLevelTime, "GetTime(date) returns %d", retval); break; default: error("Attempt to use unknown GetTime mode %d", mode); diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp index db54705694..49f2ae4517 100644 --- a/engines/sci/engine/kmovement.cpp +++ b/engines/sci/engine/kmovement.cpp @@ -125,7 +125,7 @@ reg_t kSetJump(EngineState *s, int argc, reg_t *argv) { // POST: (dx != 0) ==> ABS(tmp) > ABS(dx) // POST: (dx != 0) ==> ABS(tmp) ~>=~ ABS(dy) - debugC(2, kDebugLevelBresen, "c: %d, tmp: %d", c, tmp); + debugC(kDebugLevelBresen, "c: %d, tmp: %d", c, tmp); // Compute x step if (tmp != 0) @@ -157,8 +157,8 @@ reg_t kSetJump(EngineState *s, int argc, reg_t *argv) { // Always force vy to be upwards vy = -ABS(vy); - debugC(2, kDebugLevelBresen, "SetJump for object at %04x:%04x", PRINT_REG(object)); - debugC(2, kDebugLevelBresen, "xStep: %d, yStep: %d", vx, vy); + debugC(kDebugLevelBresen, "SetJump for object at %04x:%04x", PRINT_REG(object)); + debugC(kDebugLevelBresen, "xStep: %d, yStep: %d", vx, vy); writeSelectorValue(segMan, object, SELECTOR(xStep), vx); writeSelectorValue(segMan, object, SELECTOR(yStep), vy); @@ -537,7 +537,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) { destx = readSelectorValue(segMan, mover, SELECTOR(x)); desty = readSelectorValue(segMan, mover, SELECTOR(y)); - debugC(2, kDebugLevelBresen, "Doing avoider %04x:%04x (dest=%d,%d)", PRINT_REG(avoider), destx, desty); + debugC(kDebugLevelBresen, "Doing avoider %04x:%04x (dest=%d,%d)", PRINT_REG(avoider), destx, desty); invokeSelector(s, mover, SELECTOR(doit), argc, argv); @@ -551,7 +551,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) { dy = desty - readSelectorValue(segMan, client, SELECTOR(y)); angle = getAngle(dx, dy); - debugC(2, kDebugLevelBresen, "Movement (%d,%d), angle %d is %sblocked", dx, dy, angle, (s->r_acc.offset) ? " " : "not "); + debugC(kDebugLevelBresen, "Movement (%d,%d), angle %d is %sblocked", dx, dy, angle, (s->r_acc.offset) ? " " : "not "); if (s->r_acc.offset) { // isBlocked() returned non-zero int rotation = (g_sci->getRNG().getRandomBit() == 1) ? 45 : (360 - 45); // Clockwise/counterclockwise @@ -561,7 +561,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) { int ystep = readSelectorValue(segMan, client, SELECTOR(yStep)); int moves; - debugC(2, kDebugLevelBresen, " avoider %04x:%04x", PRINT_REG(avoider)); + debugC(kDebugLevelBresen, " avoider %04x:%04x", PRINT_REG(avoider)); for (moves = 0; moves < 8; moves++) { int move_x = (int)(sin(angle * PI / 180.0) * (xstep)); @@ -570,7 +570,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) { writeSelectorValue(segMan, client, SELECTOR(x), oldx + move_x); writeSelectorValue(segMan, client, SELECTOR(y), oldy + move_y); - debugC(2, kDebugLevelBresen, "Pos (%d,%d): Trying angle %d; delta=(%d,%d)", oldx, oldy, angle, move_x, move_y); + debugC(kDebugLevelBresen, "Pos (%d,%d): Trying angle %d; delta=(%d,%d)", oldx, oldy, angle, move_x, move_y); invokeSelector(s, client, SELECTOR(canBeHere), argc, argv); @@ -578,7 +578,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) { writeSelectorValue(segMan, client, SELECTOR(y), oldy); if (s->r_acc.offset) { // We can be here - debugC(2, kDebugLevelBresen, "Success"); + debugC(kDebugLevelBresen, "Success"); writeSelectorValue(segMan, client, SELECTOR(heading), angle); return make_reg(0, angle); diff --git a/engines/sci/engine/kparse.cpp b/engines/sci/engine/kparse.cpp index 4db59f9738..e8f8ee7152 100644 --- a/engines/sci/engine/kparse.cpp +++ b/engines/sci/engine/kparse.cpp @@ -109,7 +109,7 @@ reg_t kParse(EngineState *s, int argc, reg_t *argv) { s->r_acc = make_reg(0, 1); #ifdef DEBUG_PARSER - debugC(2, kDebugLevelParser, "Parsed to the following blocks:"); + debugC(kDebugLevelParser, "Parsed to the following blocks:"); for (ResultWordListList::const_iterator i = words.begin(); i != words.end(); ++i) { debugCN(2, kDebugLevelParser, " "); @@ -129,7 +129,7 @@ reg_t kParse(EngineState *s, int argc, reg_t *argv) { invokeSelector(s, g_sci->getGameObject(), SELECTOR(syntaxFail), argc, argv, 2, params); /* Issue warning */ - debugC(2, kDebugLevelParser, "Tree building failed"); + debugC(kDebugLevelParser, "Tree building failed"); } else { voc->parserIsValid = true; @@ -147,7 +147,7 @@ reg_t kParse(EngineState *s, int argc, reg_t *argv) { if (error) { s->_segMan->strcpy(s->_segMan->getParserPtr(), error); - debugC(2, kDebugLevelParser, "Word unknown: %s", error); + debugC(kDebugLevelParser, "Word unknown: %s", error); /* Issue warning: */ invokeSelector(s, g_sci->getGameObject(), SELECTOR(wordFail), argc, argv, 2, params); @@ -191,7 +191,7 @@ reg_t kSetSynonyms(EngineState *s, int argc, reg_t *argv) { const byte *synonyms = s->_segMan->getScript(seg)->getSynonyms(); if (synonyms) { - debugC(2, kDebugLevelParser, "Setting %d synonyms for script.%d", + debugC(kDebugLevelParser, "Setting %d synonyms for script.%d", numSynonyms, script); if (numSynonyms > 16384) { @@ -214,7 +214,7 @@ reg_t kSetSynonyms(EngineState *s, int argc, reg_t *argv) { node = s->_segMan->lookupNode(node->succ); } - debugC(2, kDebugLevelParser, "A total of %d synonyms are active now.", numSynonyms); + debugC(kDebugLevelParser, "A total of %d synonyms are active now.", numSynonyms); return s->r_acc; } diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index 2b3b7f8f01..cb70cf91e0 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -953,7 +953,7 @@ static Common::Point *fixup_start_point(PathfindingState *s, const Common::Point } if ((type == POLY_BARRED_ACCESS) || (type == POLY_CONTAINED_ACCESS)) - debugC(2, kDebugLevelAvoidPath, "AvoidPath: start position at unreachable location"); + debugC(kDebugLevelAvoidPath, "AvoidPath: start position at unreachable location"); // The original start position is in an invalid location, so we // use the moved point and add the original one to the final path @@ -1357,7 +1357,7 @@ static void AStar(PathfindingState *s) { } if (openSet.empty()) - debugC(2, kDebugLevelAvoidPath, "AvoidPath: End point (%i, %i) is unreachable", s->vertex_end->v.x, s->vertex_end->v.y); + debugC(kDebugLevelAvoidPath, "AvoidPath: End point (%i, %i) is unreachable", s->vertex_end->v.x, s->vertex_end->v.y); } static reg_t allocateOutputArray(SegManager *segMan, int size) { diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp index 4b7451d355..79cde7c5d9 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -108,7 +108,7 @@ reg_t kLock(EngineState *s, int argc, reg_t *argv) { // Happens in CD games (e.g. LSL6CD) with the message // resource. It isn't fatal, and it's usually caused // by leftover scripts. - debugC(2, kDebugLevelResMan, "[resMan] Attempt to unlock non-existant resource %s", id.toString().c_str()); + debugC(kDebugLevelResMan, "[resMan] Attempt to unlock non-existant resource %s", id.toString().c_str()); } } break; @@ -153,7 +153,7 @@ reg_t kClone(EngineState *s, int argc, reg_t *argv) { return NULL_REG; } - debugC(2, kDebugLevelMemory, "Attempting to clone from %04x:%04x", PRINT_REG(parentAddr)); + debugC(kDebugLevelMemory, "Attempting to clone from %04x:%04x", PRINT_REG(parentAddr)); uint16 infoSelector = parentObj->getInfoSelector().offset; cloneObj = s->_segMan->allocateClone(&cloneAddr); diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index dcabb67e39..32fe89a487 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -149,7 +149,7 @@ reg_t kDoAudio(EngineState *s, int argc, reg_t *argv) { return NULL_REG; } - debugC(2, kDebugLevelSound, "kDoAudio: play sample %d, module %d", number, module); + debugC(kDebugLevelSound, "kDoAudio: play sample %d, module %d", number, module); // return sample length in ticks if (argv[0].toUint16() == kSciAudioWPlay) @@ -158,28 +158,28 @@ reg_t kDoAudio(EngineState *s, int argc, reg_t *argv) { return make_reg(0, g_sci->_audio->startAudio(module, number)); } case kSciAudioStop: - debugC(2, kDebugLevelSound, "kDoAudio: stop"); + debugC(kDebugLevelSound, "kDoAudio: stop"); g_sci->_audio->stopAudio(); break; case kSciAudioPause: - debugC(2, kDebugLevelSound, "kDoAudio: pause"); + debugC(kDebugLevelSound, "kDoAudio: pause"); g_sci->_audio->pauseAudio(); break; case kSciAudioResume: - debugC(2, kDebugLevelSound, "kDoAudio: resume"); + debugC(kDebugLevelSound, "kDoAudio: resume"); g_sci->_audio->resumeAudio(); break; case kSciAudioPosition: - //debugC(2, kDebugLevelSound, "kDoAudio: get position"); // too verbose + //debugC(kDebugLevelSound, "kDoAudio: get position"); // too verbose return make_reg(0, g_sci->_audio->getAudioPosition()); case kSciAudioRate: - debugC(2, kDebugLevelSound, "kDoAudio: set audio rate to %d", argv[1].toUint16()); + debugC(kDebugLevelSound, "kDoAudio: set audio rate to %d", argv[1].toUint16()); g_sci->_audio->setAudioRate(argv[1].toUint16()); break; case kSciAudioVolume: { int16 volume = argv[1].toUint16(); volume = CLIP<int16>(volume, 0, AUDIO_VOLUME_MAX); - debugC(2, kDebugLevelSound, "kDoAudio: set volume to %d", volume); + debugC(kDebugLevelSound, "kDoAudio: set volume to %d", volume); #ifdef ENABLE_SCI32 if (getSciVersion() >= SCI_VERSION_2_1) { int16 volumePrev = mixer->getVolumeForSoundType(Audio::Mixer::kSpeechSoundType) / 2; @@ -193,11 +193,11 @@ reg_t kDoAudio(EngineState *s, int argc, reg_t *argv) { case kSciAudioLanguage: // In SCI1.1: tests for digital audio support if (getSciVersion() == SCI_VERSION_1_1) { - debugC(2, kDebugLevelSound, "kDoAudio: audio capability test"); + debugC(kDebugLevelSound, "kDoAudio: audio capability test"); return make_reg(0, 1); } else { int16 language = argv[1].toSint16(); - debugC(2, kDebugLevelSound, "kDoAudio: set language to %d", language); + debugC(kDebugLevelSound, "kDoAudio: set language to %d", language); if (language != -1) g_sci->getResMan()->setAudioLanguage(language); @@ -211,7 +211,7 @@ reg_t kDoAudio(EngineState *s, int argc, reg_t *argv) { case kSciAudioCD: if (getSciVersion() <= SCI_VERSION_1_1) { - debugC(2, kDebugLevelSound, "kDoAudio: CD audio subop"); + debugC(kDebugLevelSound, "kDoAudio: CD audio subop"); return kDoCdAudio(s, argc - 1, argv + 1); #ifdef ENABLE_SCI32 } else { diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index ede7b02a37..6a2c273d51 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -215,7 +215,7 @@ reg_t kFormat(EngineState *s, int argc, reg_t *argv) { Common::String source_str = g_sci->getKernel()->lookupText(position, index); const char* source = source_str.c_str(); - debugC(2, kDebugLevelStrings, "Formatting \"%s\"", source); + debugC(kDebugLevelStrings, "Formatting \"%s\"", source); arguments = (uint16 *)malloc(sizeof(uint16) * argc); @@ -813,7 +813,7 @@ reg_t kPrintDebug(EngineState *s, int argc, reg_t *argv) { char debugString[500]; sprintf(debugString, debugTemplate.c_str(), argv[1].toUint16()); - debugC(2, "kPrintDebug: \"%s\"\n", debugString); + debugC(kDebugLevelScripts, "kPrintDebug: \"%s\"\n", debugString); return s->r_acc; } diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp index e46c2bd15a..1382df36a2 100644 --- a/engines/sci/engine/script.cpp +++ b/engines/sci/engine/script.cpp @@ -673,9 +673,9 @@ reg_t Script::findCanonicAddress(SegManager *segMan, reg_t addr) const { void Script::freeAtAddress(SegManager *segMan, reg_t addr) { /* - debugC(2, kDebugLevelGC, "[GC] Freeing script %04x:%04x", PRINT_REG(addr)); + debugC(kDebugLevelGC, "[GC] Freeing script %04x:%04x", PRINT_REG(addr)); if (_localsSegment) - debugC(2, kDebugLevelGC, "[GC] Freeing locals %04x:0000", _localsSegment); + debugC(kDebugLevelGC, "[GC] Freeing locals %04x:0000", _localsSegment); */ if (_markedAsDeleted) diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp index 390e783329..05d914cffb 100644 --- a/engines/sci/engine/segment.cpp +++ b/engines/sci/engine/segment.cpp @@ -213,7 +213,7 @@ Common::Array<reg_t> CloneTable::listAllOutgoingReferences(reg_t addr) const { // Note that this also includes the 'base' object, which is part of the script and therefore also emits the locals. tmp.push_back(clone->getPos()); - //debugC(2, kDebugLevelGC, "[GC] Reporting clone-pos %04x:%04x", PRINT_REG(clone->pos)); + //debugC(kDebugLevelGC, "[GC] Reporting clone-pos %04x:%04x", PRINT_REG(clone->pos)); return tmp; } diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 958fcdf34f..df2ba9cbac 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -114,7 +114,7 @@ static reg_t &validate_property(EngineState *s, Object *obj, int index) { if (index < 0 || (uint)index >= obj->getVarCount()) { // This is same way sierra does it and there are some games, that contain such scripts like // iceman script 998 (fred::canBeHere, executed right at the start) - debugC(2, kDebugLevelVM, "[VM] Invalid property #%d (out of [0..%d]) requested!", + debugC(kDebugLevelVM, "[VM] Invalid property #%d (out of [0..%d]) requested!", index, obj->getVarCount()); return dummyReg; } @@ -165,8 +165,8 @@ static bool validate_variable(reg_t *r, reg_t *stack_base, int type, int max, in error("%s. [VM] Access would be outside even of the stack (%d); access denied", txt.c_str(), total_offset); return false; } else { - debugC(2, kDebugLevelVM, "%s", txt.c_str()); - debugC(2, kDebugLevelVM, "[VM] Access within stack boundaries; access granted."); + debugC(kDebugLevelVM, "%s", txt.c_str()); + debugC(kDebugLevelVM, "[VM] Access within stack boundaries; access granted."); return true; } } @@ -235,7 +235,7 @@ static reg_t validate_read_var(reg_t *r, reg_t *stack_base, int type, int max, i case VAR_PARAM: // Out-of-bounds read for a parameter that goes onto stack and hits an uninitialized temp // We return 0 currently in that case - debugC(2, kDebugLevelVM, "[VM] Read for a parameter goes out-of-bounds, onto the stack and gets uninitialized temp"); + debugC(kDebugLevelVM, "[VM] Read for a parameter goes out-of-bounds, onto the stack and gets uninitialized temp"); return NULL_REG; default: break; diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index 92644db037..efc696aa34 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -276,7 +276,7 @@ void GfxMenu::kernelSetAttribute(uint16 menuId, uint16 itemId, uint16 attributeI // PQ2 demo calls this, for example, but has no menus (bug report #3034507). Some SCI // fan games (Al Pond 2, Aquarius) call this too on non-existent menu items. The // original interpreter ignored these as well. - debugC(2, kDebugLevelGraphics, "Tried to setAttribute() on non-existent menu-item %d:%d", menuId, itemId); + debugC(kDebugLevelGraphics, "Tried to setAttribute() on non-existent menu-item %d:%d", menuId, itemId); return; } diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index a0b1323eb3..60931e2100 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -108,7 +108,7 @@ void GfxPalette::createFromData(byte *data, int bytesLeft, Palette *paletteOut) if (bytesLeft < 37) { // This happens when loading palette of picture 0 in sq5 - the resource is broken and doesn't contain a full // palette - debugC(2, "GfxPalette::createFromData() - not enough bytes in resource (%d), expected palette header", bytesLeft); + debugC(kDebugLevelResMan, "GfxPalette::createFromData() - not enough bytes in resource (%d), expected palette header", bytesLeft); return; } // palette formats in here are not really version exclusive, we can not use sci-version to differentiate between them diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index 863fe6c33a..45a3e09453 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -47,7 +47,7 @@ SoundCommandParser::~SoundCommandParser() { } reg_t SoundCommandParser::kDoSoundInit(int argc, reg_t *argv, reg_t acc) { - debugC(2, kDebugLevelSound, "kDoSound(init): %04x:%04x", PRINT_REG(argv[0])); + debugC(kDebugLevelSound, "kDoSound(init): %04x:%04x", PRINT_REG(argv[0])); processInitSound(argv[0]); return acc; } @@ -77,7 +77,7 @@ void SoundCommandParser::processInitSound(reg_t obj) { newSound->volume = CLIP<int>(readSelectorValue(_segMan, obj, SELECTOR(vol)), 0, MUSIC_VOLUME_MAX); newSound->reverb = -1; // initialize to SCI invalid, it'll be set correctly in soundInitSnd() below - debugC(2, kDebugLevelSound, "kDoSound(init): %04x:%04x number %d, loop %d, prio %d, vol %d", PRINT_REG(obj), + debugC(kDebugLevelSound, "kDoSound(init): %04x:%04x number %d, loop %d, prio %d, vol %d", PRINT_REG(obj), resourceId, newSound->loop, newSound->priority, newSound->volume); // In SCI1.1 games, sound effects are started from here. If we can find @@ -114,7 +114,7 @@ void SoundCommandParser::processInitSound(reg_t obj) { } reg_t SoundCommandParser::kDoSoundPlay(int argc, reg_t *argv, reg_t acc) { - debugC(2, kDebugLevelSound, "kDoSound(play): %04x:%04x", PRINT_REG(argv[0])); + debugC(kDebugLevelSound, "kDoSound(play): %04x:%04x", PRINT_REG(argv[0])); processPlaySound(argv[0]); return acc; } @@ -155,7 +155,7 @@ void SoundCommandParser::processPlaySound(reg_t obj) { if (_soundVersion >= SCI_VERSION_1_EARLY) musicSlot->volume = readSelectorValue(_segMan, obj, SELECTOR(vol)); - debugC(2, kDebugLevelSound, "kDoSound(play): %04x:%04x number %d, loop %d, prio %d, vol %d", PRINT_REG(obj), + debugC(kDebugLevelSound, "kDoSound(play): %04x:%04x number %d, loop %d, prio %d, vol %d", PRINT_REG(obj), resourceId, musicSlot->loop, musicSlot->priority, musicSlot->volume); _music->soundPlay(musicSlot); @@ -173,7 +173,7 @@ reg_t SoundCommandParser::kDoSoundDummy(int argc, reg_t *argv, reg_t acc) { } reg_t SoundCommandParser::kDoSoundDispose(int argc, reg_t *argv, reg_t acc) { - debugC(2, kDebugLevelSound, "kDoSound(dispose): %04x:%04x", PRINT_REG(argv[0])); + debugC(kDebugLevelSound, "kDoSound(dispose): %04x:%04x", PRINT_REG(argv[0])); processDisposeSound(argv[0]); return acc; } @@ -196,7 +196,7 @@ void SoundCommandParser::processDisposeSound(reg_t obj) { } reg_t SoundCommandParser::kDoSoundStop(int argc, reg_t *argv, reg_t acc) { - debugC(2, kDebugLevelSound, "kDoSound(stop): %04x:%04x", PRINT_REG(argv[0])); + debugC(kDebugLevelSound, "kDoSound(stop): %04x:%04x", PRINT_REG(argv[0])); processStopSound(argv[0], false); return acc; } @@ -231,9 +231,9 @@ void SoundCommandParser::processStopSound(reg_t obj, bool sampleFinishedPlaying) reg_t SoundCommandParser::kDoSoundPause(int argc, reg_t *argv, reg_t acc) { if (argc == 1) - debugC(2, kDebugLevelSound, "kDoSound(pause): %04x:%04x", PRINT_REG(argv[0])); + debugC(kDebugLevelSound, "kDoSound(pause): %04x:%04x", PRINT_REG(argv[0])); else - debugC(2, kDebugLevelSound, "kDoSound(pause): %04x:%04x, %04x:%04x", PRINT_REG(argv[0]), PRINT_REG(argv[1])); + debugC(kDebugLevelSound, "kDoSound(pause): %04x:%04x, %04x:%04x", PRINT_REG(argv[0]), PRINT_REG(argv[1])); if (_soundVersion <= SCI_VERSION_0_LATE) { // SCI0 games give us 0/1 for either resuming or pausing the current music @@ -267,7 +267,7 @@ reg_t SoundCommandParser::kDoSoundPause(int argc, reg_t *argv, reg_t acc) { MusicEntry *musicSlot = _music->getSlot(obj); if (!musicSlot) { // This happens quite frequently - debugC(2, kDebugLevelSound, "kDoSound(pause): Slot not found (%04x:%04x)", PRINT_REG(obj)); + debugC(kDebugLevelSound, "kDoSound(pause): Slot not found (%04x:%04x)", PRINT_REG(obj)); return acc; } @@ -286,7 +286,7 @@ reg_t SoundCommandParser::kDoSoundResumeAfterRestore(int argc, reg_t *argv, reg_ reg_t SoundCommandParser::kDoSoundMute(int argc, reg_t *argv, reg_t acc) { uint16 previousState = _music->soundGetSoundOn(); if (argc > 0) { - debugC(2, kDebugLevelSound, "kDoSound(mute): %d", argv[0].toUint16()); + debugC(kDebugLevelSound, "kDoSound(mute): %d", argv[0].toUint16()); _music->soundSetSoundOn(argv[0].toUint16()); } @@ -297,7 +297,7 @@ reg_t SoundCommandParser::kDoSoundMasterVolume(int argc, reg_t *argv, reg_t acc) acc = make_reg(0, _music->soundGetMasterVolume()); if (argc > 0) { - debugC(2, kDebugLevelSound, "kDoSound(masterVolume): %d", argv[0].toSint16()); + debugC(kDebugLevelSound, "kDoSound(masterVolume): %d", argv[0].toSint16()); int vol = CLIP<int16>(argv[0].toSint16(), 0, MUSIC_MASTERVOLUME_MAX); vol = vol * Audio::Mixer::kMaxMixerVolume / MUSIC_MASTERVOLUME_MAX; ConfMan.setInt("music_volume", vol); @@ -312,7 +312,7 @@ reg_t SoundCommandParser::kDoSoundFade(int argc, reg_t *argv, reg_t acc) { MusicEntry *musicSlot = _music->getSlot(obj); if (!musicSlot) { - debugC(2, kDebugLevelSound, "kDoSound(fade): Slot not found (%04x:%04x)", PRINT_REG(obj)); + debugC(kDebugLevelSound, "kDoSound(fade): Slot not found (%04x:%04x)", PRINT_REG(obj)); return acc; } @@ -320,7 +320,7 @@ reg_t SoundCommandParser::kDoSoundFade(int argc, reg_t *argv, reg_t acc) { // If sound is not playing currently, set signal directly if (musicSlot->status != kSoundPlaying) { - debugC(2, kDebugLevelSound, "kDoSound(fade): %04x:%04x fading requested, but sound is currently not playing", PRINT_REG(obj)); + debugC(kDebugLevelSound, "kDoSound(fade): %04x:%04x fading requested, but sound is currently not playing", PRINT_REG(obj)); writeSelectorValue(_segMan, obj, SELECTOR(signal), SIGNAL_OFFSET); return acc; } @@ -352,7 +352,7 @@ reg_t SoundCommandParser::kDoSoundFade(int argc, reg_t *argv, reg_t acc) { error("kDoSound(fade): unsupported argc %d", argc); } - debugC(2, kDebugLevelSound, "kDoSound(fade): %04x:%04x to %d, step %d, ticker %d", PRINT_REG(obj), musicSlot->fadeTo, musicSlot->fadeStep, musicSlot->fadeTickerStep); + debugC(kDebugLevelSound, "kDoSound(fade): %04x:%04x to %d, step %d, ticker %d", PRINT_REG(obj), musicSlot->fadeTo, musicSlot->fadeStep, musicSlot->fadeTickerStep); return acc; } @@ -363,7 +363,7 @@ reg_t SoundCommandParser::kDoSoundGetPolyphony(int argc, reg_t *argv, reg_t acc) reg_t SoundCommandParser::kDoSoundUpdate(int argc, reg_t *argv, reg_t acc) { reg_t obj = argv[0]; - debugC(2, kDebugLevelSound, "kDoSound(update): %04x:%04x", PRINT_REG(argv[0])); + debugC(kDebugLevelSound, "kDoSound(update): %04x:%04x", PRINT_REG(argv[0])); MusicEntry *musicSlot = _music->getSlot(obj); if (!musicSlot) { @@ -481,7 +481,7 @@ reg_t SoundCommandParser::kDoSoundSendMidi(int argc, reg_t *argv, reg_t acc) { uint16 controller = argv[3].toUint16(); uint16 param = argv[4].toUint16(); - debugC(2, kDebugLevelSound, "kDoSound(sendMidi): %04x:%04x, %d, %d, %d, %d", PRINT_REG(obj), channel, midiCmd, controller, param); + debugC(kDebugLevelSound, "kDoSound(sendMidi): %04x:%04x, %d, %d, %d, %d", PRINT_REG(obj), channel, midiCmd, controller, param); if (channel) channel--; // channel is given 1-based, we are using 0-based @@ -504,7 +504,7 @@ reg_t SoundCommandParser::kDoSoundGlobalReverb(int argc, reg_t *argv, reg_t acc) byte reverb = argv[0].toUint16() & 0xF; if (argc == 1) { - debugC(2, kDebugLevelSound, "doSoundGlobalReverb: %d", argv[0].toUint16() & 0xF); + debugC(kDebugLevelSound, "doSoundGlobalReverb: %d", argv[0].toUint16() & 0xF); if (reverb <= 10) _music->setGlobalReverb(reverb); } @@ -515,7 +515,7 @@ reg_t SoundCommandParser::kDoSoundGlobalReverb(int argc, reg_t *argv, reg_t acc) reg_t SoundCommandParser::kDoSoundSetHold(int argc, reg_t *argv, reg_t acc) { reg_t obj = argv[0]; - debugC(2, kDebugLevelSound, "doSoundSetHold: %04x:%04x, %d", PRINT_REG(argv[0]), argv[1].toUint16()); + debugC(kDebugLevelSound, "doSoundSetHold: %04x:%04x, %d", PRINT_REG(argv[0]), argv[1].toUint16()); MusicEntry *musicSlot = _music->getSlot(obj); if (!musicSlot) { @@ -570,7 +570,7 @@ reg_t SoundCommandParser::kDoSoundSetVolume(int argc, reg_t *argv, reg_t acc) { return acc; } - debugC(2, kDebugLevelSound, "kDoSound(setVolume): %d", value); + debugC(kDebugLevelSound, "kDoSound(setVolume): %d", value); value = CLIP<int>(value, 0, MUSIC_VOLUME_MAX); @@ -586,11 +586,11 @@ reg_t SoundCommandParser::kDoSoundSetPriority(int argc, reg_t *argv, reg_t acc) reg_t obj = argv[0]; int16 value = argv[1].toSint16(); - debugC(2, kDebugLevelSound, "kDoSound(setPriority): %04x:%04x, %d", PRINT_REG(obj), value); + debugC(kDebugLevelSound, "kDoSound(setPriority): %04x:%04x, %d", PRINT_REG(obj), value); MusicEntry *musicSlot = _music->getSlot(obj); if (!musicSlot) { - debugC(2, kDebugLevelSound, "kDoSound(setPriority): Slot not found (%04x:%04x)", PRINT_REG(obj)); + debugC(kDebugLevelSound, "kDoSound(setPriority): Slot not found (%04x:%04x)", PRINT_REG(obj)); return acc; } @@ -623,7 +623,7 @@ reg_t SoundCommandParser::kDoSoundSetLoop(int argc, reg_t *argv, reg_t acc) { reg_t obj = argv[0]; int16 value = argv[1].toSint16(); - debugC(2, kDebugLevelSound, "kDoSound(setLoop): %04x:%04x, %d", PRINT_REG(obj), value); + debugC(kDebugLevelSound, "kDoSound(setLoop): %04x:%04x, %d", PRINT_REG(obj), value); MusicEntry *musicSlot = _music->getSlot(obj); if (!musicSlot) { |