diff options
author | Willem Jan Palenstijn | 2010-01-30 11:59:05 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2010-01-30 11:59:05 +0000 |
commit | 06bd17ee712f06971273d526f389f9a352f3e8ec (patch) | |
tree | 6396a8c4bdc706116532c555bd936c048a0b65c1 /engines | |
parent | 9449585893e72156579707f0f377527c6253be5f (diff) | |
download | scummvm-rg350-06bd17ee712f06971273d526f389f9a352f3e8ec.tar.gz scummvm-rg350-06bd17ee712f06971273d526f389f9a352f3e8ec.tar.bz2 scummvm-rg350-06bd17ee712f06971273d526f389f9a352f3e8ec.zip |
SCI: Remove extra '\n's in debugC messages
svn-id: r47707
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/gc.cpp | 14 | ||||
-rw-r--r-- | engines/sci/engine/kernel.cpp | 6 | ||||
-rw-r--r-- | engines/sci/engine/kfile.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 20 | ||||
-rw-r--r-- | engines/sci/engine/klists.cpp | 18 | ||||
-rw-r--r-- | engines/sci/engine/kmovement.cpp | 26 | ||||
-rw-r--r-- | engines/sci/engine/kparse.cpp | 12 | ||||
-rw-r--r-- | engines/sci/engine/kscripts.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/kstring.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/segment.cpp | 6 | ||||
-rw-r--r-- | engines/sci/engine/vm.cpp | 16 | ||||
-rw-r--r-- | engines/sci/sound/iterator/core.cpp | 6 | ||||
-rw-r--r-- | engines/sci/sound/iterator/iterator.cpp | 22 | ||||
-rw-r--r-- | engines/sci/sound/soundcmd.cpp | 20 |
14 files changed, 87 insertions, 87 deletions
diff --git a/engines/sci/engine/gc.cpp b/engines/sci/engine/gc.cpp index a4d9d4f053..b3fbabdb06 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\n", PRINT_REG(reg)); + debugC(2, kDebugLevelGC, "[GC] Adding %04x:%04x", PRINT_REG(reg)); if (_map.contains(reg)) return; // already dealt with it @@ -127,14 +127,14 @@ reg_t_hash_map *find_all_used_references(EngineState *s) { } } - debugC(2, kDebugLevelGC, "[GC] -- Finished explicitly loaded scripts, done with root set\n"); + debugC(2, kDebugLevelGC, "[GC] -- Finished explicitly loaded scripts, done with root set"); // Run Worklist Algorithm while (!wm._worklist.empty()) { reg_t reg = wm._worklist.back(); wm._worklist.pop_back(); if (reg.segment != s->stack_segment) { // No need to repeat this one - debugC(2, kDebugLevelGC, "[GC] Checking %04x:%04x\n", PRINT_REG(reg)); + debugC(2, kDebugLevelGC, "[GC] Checking %04x:%04x", PRINT_REG(reg)); if (reg.segment < segMan->_heap.size() && segMan->_heap[reg.segment]) segMan->_heap[reg.segment]->listAllOutgoingReferences(reg, &wm, add_outgoing_refs); } @@ -164,7 +164,7 @@ void free_unless_used(void *refcon, reg_t addr) { // Not found -> we can free it deallocator->mobj->freeAtAddress(deallocator->segMan, addr); #ifdef DEBUG_GC - debugC(2, kDebugLevelGC, "[GC] Deallocating %04x:%04x\n", PRINT_REG(addr)); + debugC(2, kDebugLevelGC, "[GC] Deallocating %04x:%04x", PRINT_REG(addr)); deallocator->segcount[deallocator->mobj->getType()]++; #endif } @@ -177,7 +177,7 @@ void run_gc(EngineState *s) { SegManager *segMan = s->_segMan; #ifdef DEBUG_GC - debugC(2, kDebugLevelGC, "[GC] Running...\n"); + debugC(2, kDebugLevelGC, "[GC] Running..."); memset(&(deallocator.segcount), 0, sizeof(int) * (SEG_TYPE_MAX + 1)); #endif @@ -199,10 +199,10 @@ void run_gc(EngineState *s) { #ifdef DEBUG_GC { int i; - debugC(2, kDebugLevelGC, "[GC] Summary:\n"); + debugC(2, kDebugLevelGC, "[GC] Summary:"); for (i = 0; i <= SEG_TYPE_MAX; i++) if (deallocator.segcount[i]) - debugC(2, kDebugLevelGC, "\t%d\t* %s\n", deallocator.segcount[i], deallocator.segnames[i]); + debugC(2, kDebugLevelGC, "\t%d\t* %s", deallocator.segcount[i], deallocator.segnames[i]); } #endif } diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index 567c2b7d8d..27bed5b9d9 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -423,7 +423,7 @@ int Kernel::findSelector(const char *selectorName) const { return pos; } - debugC(2, kDebugLevelVM, "Could not map '%s' to any selector\n", selectorName); + debugC(2, kDebugLevelVM, "Could not map '%s' to any selector", selectorName); return -1; } @@ -473,7 +473,7 @@ reg_t kalloc(SegManager *segMan, const char *type, int space) { reg_t reg; segMan->allocateHunkEntry(type, space, ®); - debugC(2, kDebugLevelMemory, "Allocated %d at hunk %04x:%04x (%s)\n", space, PRINT_REG(reg), type); + debugC(2, kDebugLevelMemory, "Allocated %d at hunk %04x:%04x (%s)", space, PRINT_REG(reg), type); return reg; } @@ -627,7 +627,7 @@ void Kernel::mapFunctions() { } } // for all functions requesting to be mapped - debugC(2, kDebugLevelVM, "Handled %d/%d kernel functions, mapping %d and ignoring %d.\n", + debugC(2, 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 314135a443..214b810ca8 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -219,7 +219,7 @@ reg_t kFPuts(EngineState *s, int argc, reg_t *argv) { } static void fgets_wrapper(EngineState *s, char *dest, int maxsize, int handle) { - debugC(2, kDebugLevelFile, "FGets'ing %d bytes from handle %d\n", maxsize, handle); + debugC(2, kDebugLevelFile, "FGets'ing %d bytes from handle %d", maxsize, handle); FileHandle *f = getFileFromHandle(s, handle); if (!f) @@ -241,7 +241,7 @@ static void fgets_wrapper(EngineState *s, char *dest, int maxsize, int handle) { dest[strSize - 1] = 0; } - debugC(2, kDebugLevelFile, "FGets'ed \"%s\"\n", dest); + debugC(2, kDebugLevelFile, "FGets'ed \"%s\"", dest); } static int _savegame_index_struct_compare(const void *a, const void *b) { diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 8c7b0cf30f..8f13c8c42d 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -319,7 +319,7 @@ reg_t kGraph(EngineState *s, int argc, reg_t *argv) { case K_GRAPH_ADJUST_PRIORITY: // Seems to be only implemented for SCI0/SCI01 games - debugC(2, kDebugLevelGraphics, "adjust_priority(%d, %d)\n", argv[1].toUint16(), argv[2].toUint16()); + debugC(2, kDebugLevelGraphics, "adjust_priority(%d, %d)", argv[1].toUint16(), argv[2].toUint16()); s->_gui->graphAdjustPriority(argv[1].toUint16(), argv[2].toUint16()); break; @@ -352,7 +352,7 @@ reg_t kTextSize(EngineState *s, int argc, reg_t *argv) { if (text.empty() || !dest) { // Empty text dest[2] = dest[3] = make_reg(0, 0); - debugC(2, kDebugLevelStrings, "GetTextSize: Empty string\n"); + debugC(2, kDebugLevelStrings, "GetTextSize: Empty string"); return s->r_acc; } @@ -365,7 +365,7 @@ reg_t kTextSize(EngineState *s, int argc, reg_t *argv) { #endif s->_gui->textSize(s->strSplit(text.c_str(), sep).c_str(), font_nr, maxwidth, &textWidth, &textHeight); - debugC(2, kDebugLevelStrings, "GetTextSize '%s' -> %dx%d\n", text.c_str(), textWidth, textHeight); + debugC(2, 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; @@ -504,7 +504,7 @@ reg_t kNumLoops(EngineState *s, int argc, reg_t *argv) { #endif loopCount = s->_gui->getLoopCount(viewId); - debugC(2, kDebugLevelGraphics, "NumLoops(view.%d) = %d\n", viewId, loopCount); + debugC(2, kDebugLevelGraphics, "NumLoops(view.%d) = %d", viewId, loopCount); return make_reg(0, loopCount); } @@ -522,7 +522,7 @@ reg_t kNumCels(EngineState *s, int argc, reg_t *argv) { #endif celCount = s->_gui->getCelCount(viewId, loopNo); - debugC(2, kDebugLevelGraphics, "NumCels(view.%d, %d) = %d\n", viewId, loopNo, celCount); + debugC(2, kDebugLevelGraphics, "NumCels(view.%d, %d) = %d", viewId, loopNo, celCount); return make_reg(0, celCount); } @@ -831,13 +831,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\n", PRINT_REG(controlObject), x, y); + debugC(2, kDebugLevelGraphics, "drawing button %04x:%04x to %d,%d", PRINT_REG(controlObject), x, y); s->_gui->drawControlButton(rect, controlObject, s->strSplit(text.c_str(), NULL).c_str(), fontId, style, hilite); return; case SCI_CONTROLS_TYPE_TEXT: alignment = GET_SEL32V(s->_segMan, controlObject, mode); - debugC(2, kDebugLevelGraphics, "drawing text %04x:%04x ('%s') to %d,%d, mode=%d\n", PRINT_REG(controlObject), text.c_str(), x, y, alignment); + debugC(2, kDebugLevelGraphics, "drawing text %04x:%04x ('%s') to %d,%d, mode=%d", PRINT_REG(controlObject), text.c_str(), x, y, alignment); s->_gui->drawControlText(rect, controlObject, s->strSplit(text.c_str()).c_str(), fontId, alignment, style, hilite); return; @@ -845,7 +845,7 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) { mode = GET_SEL32V(s->_segMan, controlObject, mode); maxChars = GET_SEL32V(s->_segMan, controlObject, max); cursorPos = GET_SEL32V(s->_segMan, controlObject, cursor); - debugC(2, kDebugLevelGraphics, "drawing edit control %04x:%04x (text %04x:%04x, '%s') to %d,%d\n", PRINT_REG(controlObject), PRINT_REG(textReference), text.c_str(), x, y); + 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); s->_gui->drawControlTextEdit(rect, controlObject, s->strSplit(text.c_str(), NULL).c_str(), fontId, mode, style, cursorPos, maxChars, hilite); return; @@ -865,7 +865,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\n", PRINT_REG(controlObject), x, y - 1); + debugC(2, kDebugLevelGraphics, "drawing icon control %04x:%04x to %d,%d", PRINT_REG(controlObject), x, y - 1); s->_gui->drawControlIcon(rect, controlObject, viewId, loopNo, celNo, priority, style, hilite); return; @@ -913,7 +913,7 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) { } } - debugC(2, kDebugLevelGraphics, "drawing list control %04x:%04x to %d,%d, diff %d\n", PRINT_REG(controlObject), x, y, SCI_MAX_SAVENAME_LENGTH); + debugC(2, kDebugLevelGraphics, "drawing list control %04x:%04x to %d,%d, diff %d", PRINT_REG(controlObject), x, y, SCI_MAX_SAVENAME_LENGTH); s->_gui->drawControlList(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 8901fb1286..d9ebcd3286 100644 --- a/engines/sci/engine/klists.cpp +++ b/engines/sci/engine/klists.cpp @@ -118,7 +118,7 @@ reg_t kNewList(EngineState *s, int argc, reg_t *argv) { List *l; l = s->_segMan->allocateList(&listbase); l->first = l->last = NULL_REG; - debugC(2, kDebugLevelNodes, "New listbase at %04x:%04x\n", PRINT_REG(listbase)); + debugC(2, kDebugLevelNodes, "New listbase at %04x:%04x", PRINT_REG(listbase)); return listbase; // Return list base address } @@ -178,7 +178,7 @@ reg_t kNewNode(EngineState *s, int argc, reg_t *argv) { else s->r_acc = _k_new_node(s, argv[0], argv[1]); - debugC(2, kDebugLevelNodes, "New nodebase at %04x:%04x\n", PRINT_REG(s->r_acc)); + debugC(2, kDebugLevelNodes, "New nodebase at %04x:%04x", PRINT_REG(s->r_acc)); return s->r_acc; } @@ -225,7 +225,7 @@ void _k_add_to_front(EngineState *s, reg_t listbase, reg_t nodebase) { List *l = s->_segMan->lookupList(listbase); Node *new_n = s->_segMan->lookupNode(nodebase); - debugC(2, kDebugLevelNodes, "Adding node %04x:%04x to end of list %04x:%04x\n", PRINT_REG(nodebase), PRINT_REG(listbase)); + debugC(2, kDebugLevelNodes, "Adding node %04x:%04x to end of list %04x:%04x", PRINT_REG(nodebase), PRINT_REG(listbase)); // FIXME: This should be an error, but it's turned to a warning for now if (!new_n) @@ -248,7 +248,7 @@ void _k_add_to_end(EngineState *s, reg_t listbase, reg_t nodebase) { List *l = s->_segMan->lookupList(listbase); Node *new_n = s->_segMan->lookupNode(nodebase); - debugC(2, kDebugLevelNodes, "Adding node %04x:%04x to end of list %04x:%04x\n", PRINT_REG(nodebase), PRINT_REG(listbase)); + debugC(2, kDebugLevelNodes, "Adding node %04x:%04x to end of list %04x:%04x", PRINT_REG(nodebase), PRINT_REG(listbase)); // FIXME: This should be an error, but it's turned to a warning for now if (!new_n) @@ -344,26 +344,26 @@ 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\n", PRINT_REG(key), PRINT_REG(list_pos)); + debugC(2, kDebugLevelNodes, "Looking for key %04x:%04x in list %04x:%04x", PRINT_REG(key), PRINT_REG(list_pos)); checkListPointer(s->_segMan, argv[0]); node_pos = s->_segMan->lookupList(list_pos)->first; - debugC(2, kDebugLevelNodes, "First node at %04x:%04x\n", PRINT_REG(node_pos)); + debugC(2, 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\n", PRINT_REG(node_pos)); + debugC(2, kDebugLevelNodes, " Found key at %04x:%04x", PRINT_REG(node_pos)); return node_pos; } node_pos = n->succ; - debugC(2, kDebugLevelNodes, "NextNode at %04x:%04x\n", PRINT_REG(node_pos)); + debugC(2, kDebugLevelNodes, "NextNode at %04x:%04x", PRINT_REG(node_pos)); } - debugC(2, kDebugLevelNodes, "Looking for key without success\n"); + debugC(2, kDebugLevelNodes, "Looking for key without success"); return NULL_REG; } diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp index 13e55f3625..dc4c2ffc93 100644 --- a/engines/sci/engine/kmovement.cpp +++ b/engines/sci/engine/kmovement.cpp @@ -122,7 +122,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\n", c, tmp); + debugC(2, kDebugLevelBresen, "c: %d, tmp: %d", c, tmp); // Compute x step if (tmp != 0) @@ -154,8 +154,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\n", PRINT_REG(object)); - debugC(2, kDebugLevelBresen, "xStep: %d, yStep: %d\n", vx, vy); + debugC(2, kDebugLevelBresen, "SetJump for object at %04x:%04x", PRINT_REG(object)); + debugC(2, kDebugLevelBresen, "xStep: %d, yStep: %d", vx, vy); PUT_SEL32V(segMan, object, xStep, vx); PUT_SEL32V(segMan, object, yStep, vy); @@ -209,8 +209,8 @@ static void initialize_bresen(SegManager *segMan, int argc, reg_t *argv, reg_t m PUT_SEL32V(segMan, mover, dx, deltax_step); PUT_SEL32V(segMan, mover, dy, deltay_step); - debugC(2, kDebugLevelBresen, "Init bresen for mover %04x:%04x: d=(%d,%d)\n", PRINT_REG(mover), deltax, deltay); - debugC(2, kDebugLevelBresen, " steps=%d, mv=(%d, %d), i1= %d, i2=%d\n", + debugC(2, kDebugLevelBresen, "Init bresen for mover %04x:%04x: d=(%d,%d)", PRINT_REG(mover), deltax, deltay); + debugC(2, kDebugLevelBresen, " steps=%d, mv=(%d, %d), i1= %d, i2=%d", numsteps, deltax_step, deltay_step, i1, bdi*2); //PUT_SEL32V(segMan, mover, b_movCnt, numsteps); // Needed for HQ1/Ogre? @@ -306,13 +306,13 @@ reg_t kDoBresen(EngineState *s, int argc, reg_t *argv) { y = desty; completed = 1; - debugC(2, kDebugLevelBresen, "Finished mover %04x:%04x\n", PRINT_REG(mover)); + debugC(2, kDebugLevelBresen, "Finished mover %04x:%04x", PRINT_REG(mover)); } PUT_SEL32V(segMan, client, x, x); PUT_SEL32V(segMan, client, y, y); - debugC(2, kDebugLevelBresen, "New data: (x,y)=(%d,%d), di=%d\n", x, y, bdi); + debugC(2, kDebugLevelBresen, "New data: (x,y)=(%d,%d), di=%d", x, y, bdi); if (s->_kernel->_selectorCache.cantBeHere != -1) { invoke_selector(INV_SEL(client, cantBeHere, kStopOnInvalidSelector), 0); @@ -328,7 +328,7 @@ reg_t kDoBresen(EngineState *s, int argc, reg_t *argv) { PUT_SEL32V(segMan, client, y, oldy); PUT_SEL32V(segMan, client, signal, (signal | kSignalHitObstacle)); - debugC(2, kDebugLevelBresen, "Finished mover %04x:%04x by collision\n", PRINT_REG(mover)); + debugC(2, kDebugLevelBresen, "Finished mover %04x:%04x by collision", PRINT_REG(mover)); completed = 1; } @@ -397,7 +397,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) { destx = GET_SEL32V(segMan, mover, x); desty = GET_SEL32V(segMan, mover, y); - debugC(2, kDebugLevelBresen, "Doing avoider %04x:%04x (dest=%d,%d)\n", PRINT_REG(avoider), destx, desty); + debugC(2, kDebugLevelBresen, "Doing avoider %04x:%04x (dest=%d,%d)", PRINT_REG(avoider), destx, desty); if (invoke_selector(INV_SEL(mover, doit, kContinueOnInvalidSelector) , 0)) { error("Mover %04x:%04x of avoider %04x:%04x doesn't have a doit() funcselector", PRINT_REG(mover), PRINT_REG(avoider)); @@ -418,7 +418,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) { dy = desty - GET_SEL32V(segMan, client, y); angle = getAngle(dx, dy); - debugC(2, kDebugLevelBresen, "Movement (%d,%d), angle %d is %sblocked\n", dx, dy, angle, (s->r_acc.offset) ? " " : "not "); + debugC(2, 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 = (rand() & 1) ? 45 : (360 - 45); // Clockwise/counterclockwise @@ -428,7 +428,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) { int ystep = GET_SEL32V(segMan, client, yStep); int moves; - debugC(2, kDebugLevelBresen, " avoider %04x:%04x\n", PRINT_REG(avoider)); + debugC(2, kDebugLevelBresen, " avoider %04x:%04x", PRINT_REG(avoider)); for (moves = 0; moves < 8; moves++) { int move_x = (int)(sin(angle * PI / 180.0) * (xstep)); @@ -437,7 +437,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) { PUT_SEL32V(segMan, client, x, oldx + move_x); PUT_SEL32V(segMan, client, y, oldy + move_y); - debugC(2, kDebugLevelBresen, "Pos (%d,%d): Trying angle %d; delta=(%d,%d)\n", oldx, oldy, angle, move_x, move_y); + debugC(2, kDebugLevelBresen, "Pos (%d,%d): Trying angle %d; delta=(%d,%d)", oldx, oldy, angle, move_x, move_y); if (invoke_selector(INV_SEL(client, canBeHere, kContinueOnInvalidSelector) , 0)) { error("Client %04x:%04x of avoider %04x:%04x doesn't" @@ -449,7 +449,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) { PUT_SEL32V(segMan, client, y, oldy); if (s->r_acc.offset) { // We can be here - debugC(2, kDebugLevelBresen, "Success\n"); + debugC(2, kDebugLevelBresen, "Success"); PUT_SEL32V(segMan, client, heading, angle); return make_reg(0, angle); diff --git a/engines/sci/engine/kparse.cpp b/engines/sci/engine/kparse.cpp index fee6a171ee..4423b6928e 100644 --- a/engines/sci/engine/kparse.cpp +++ b/engines/sci/engine/kparse.cpp @@ -105,10 +105,10 @@ 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:\n", 0); + debugC(2, kDebugLevelParser, "Parsed to the following blocks:", 0); for (ResultWordList::const_iterator i = words.begin(); i != words.end(); ++i) - debugC(2, kDebugLevelParser, " Type[%04x] Group[%04x]\n", i->_class, i->_group); + debugC(2, kDebugLevelParser, " Type[%04x] Group[%04x]", i->_class, i->_group); #endif int syntax_fail = voc->parseGNF(words); @@ -120,7 +120,7 @@ reg_t kParse(EngineState *s, int argc, reg_t *argv) { invoke_selector(INV_SEL(s->_gameObj, syntaxFail, kStopOnInvalidSelector), 2, s->_voc->parser_base, stringpos); /* Issue warning */ - debugC(2, kDebugLevelParser, "Tree building failed\n"); + debugC(2, kDebugLevelParser, "Tree building failed"); } else { s->_voc->parserIsValid = true; @@ -137,7 +137,7 @@ reg_t kParse(EngineState *s, int argc, reg_t *argv) { PUT_SEL32V(segMan, event, claimed, 1); if (error) { s->_segMan->strcpy(s->_voc->parser_base, error); - debugC(2, kDebugLevelParser, "Word unknown: %s\n", error); + debugC(2, kDebugLevelParser, "Word unknown: %s", error); /* Issue warning: */ invoke_selector(INV_SEL(s->_gameObj, wordFail, kStopOnInvalidSelector), 2, s->_voc->parser_base, stringpos); @@ -180,7 +180,7 @@ reg_t kSetSynonyms(EngineState *s, int argc, reg_t *argv) { byte *synonyms = s->_segMan->getScript(seg)->getSynonyms(); if (synonyms) { - debugC(2, kDebugLevelParser, "Setting %d synonyms for script.%d\n", + debugC(2, kDebugLevelParser, "Setting %d synonyms for script.%d", numSynonyms, script); if (numSynonyms > 16384) { @@ -203,7 +203,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.\n", numSynonyms); + debugC(2, kDebugLevelParser, "A total of %d synonyms are active now.", numSynonyms); return s->r_acc; } diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp index 87c8eef96d..1fca13cb44 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -121,7 +121,7 @@ reg_t kClone(EngineState *s, int argc, reg_t *argv) { return NULL_REG; } - debugC(2, kDebugLevelMemory, "Attempting to clone from %04x:%04x\n", PRINT_REG(parent_addr)); + debugC(2, kDebugLevelMemory, "Attempting to clone from %04x:%04x", PRINT_REG(parent_addr)); clone_obj = s->_segMan->allocateClone(&clone_addr); diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index f4c264b72c..dad3727f32 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -214,7 +214,7 @@ reg_t kFormat(EngineState *s, int argc, reg_t *argv) { Common::String source_str = kernel_lookup_text(s, position, index); const char* source = source_str.c_str(); - debugC(2, kDebugLevelStrings, "Formatting \"%s\"\n", source); + debugC(2, kDebugLevelStrings, "Formatting \"%s\"", source); arguments = (uint16 *)malloc(sizeof(uint16) * argc); diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp index 1764109581..2fee80048b 100644 --- a/engines/sci/engine/segment.cpp +++ b/engines/sci/engine/segment.cpp @@ -322,9 +322,9 @@ reg_t Script::findCanonicAddress(SegManager *segMan, reg_t addr) { void Script::freeAtAddress(SegManager *segMan, reg_t addr) { /* - debugC(2, kDebugLevelGC, "[GC] Freeing script %04x:%04x\n", PRINT_REG(addr)); + debugC(2, kDebugLevelGC, "[GC] Freeing script %04x:%04x", PRINT_REG(addr)); if (_localsSegment) - debugC(2, kDebugLevelGC, "[GC] Freeing locals %04x:0000\n", _localsSegment); + debugC(2, kDebugLevelGC, "[GC] Freeing locals %04x:0000", _localsSegment); */ if (_markedAsDeleted) @@ -374,7 +374,7 @@ void CloneTable::listAllOutgoingReferences(reg_t addr, void *param, NoteCallback // Note that this also includes the 'base' object, which is part of the script and therefore also emits the locals. (*note)(param, clone->getPos()); - //debugC(2, kDebugLevelGC, "[GC] Reporting clone-pos %04x:%04x\n", PRINT_REG(clone->pos)); + //debugC(2, kDebugLevelGC, "[GC] Reporting clone-pos %04x:%04x", PRINT_REG(clone->pos)); } void CloneTable::freeAtAddress(SegManager *segMan, reg_t addr) { diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 2c033539c5..610a228b3f 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -64,12 +64,12 @@ static reg_t &validate_property(Object *obj, int index) { static reg_t dummyReg = NULL_REG; if (!obj) { - debugC(2, kDebugLevelVM, "[VM] Sending to disposed object!\n"); + debugC(2, kDebugLevelVM, "[VM] Sending to disposed object!"); return dummyReg; } if (index < 0 || (uint)index >= obj->getVarCount()) { - debugC(2, kDebugLevelVM, "[VM] Invalid property #%d (out of [0..%d]) requested!\n", + debugC(2, kDebugLevelVM, "[VM] Invalid property #%d (out of [0..%d]) requested!", index, obj->getVarCount()); return dummyReg; } @@ -126,8 +126,8 @@ static bool validate_variable(reg_t *r, reg_t *stack_base, int type, int max, in warning("[VM] Access would be outside even of the stack (%d); access denied", total_offset); return false; } else { - debugC(2, kDebugLevelVM, "%s\n", txt.c_str()); - debugC(2, kDebugLevelVM, "[VM] Access within stack boundaries; access granted.\n"); + debugC(2, kDebugLevelVM, "%s", txt.c_str()); + debugC(2, kDebugLevelVM, "[VM] Access within stack boundaries; access granted."); return true; } } @@ -1952,7 +1952,7 @@ void script_uninstantiate(SegManager *segMan, int script_nr) { // Explanation: I'm starting to believe that this work is done by SCI itself. scr->markDeleted(); - debugC(kDebugLevelScripts, "Unloaded script 0x%x.\n", script_nr); + debugC(kDebugLevelScripts, "Unloaded script 0x%x.", script_nr); return; } @@ -1998,7 +1998,7 @@ static EngineState *_game_run(EngineState *&s, int restoring) { s = successor; if (script_abort_flag == 2) { - debugC(2, kDebugLevelVM, "Restarting with replay()\n"); + debugC(2, kDebugLevelVM, "Restarting with replay()"); s->_executionStack.clear(); // Restart with replay _init_stack_base_with_selector(s, s->_kernel->_selectorCache.replay); @@ -2019,7 +2019,7 @@ static EngineState *_game_run(EngineState *&s, int restoring) { int game_run(EngineState **_s) { EngineState *s = *_s; - debugC(2, kDebugLevelVM, "Calling %s::play()\n", s->_gameId.c_str()); + debugC(2, kDebugLevelVM, "Calling %s::play()", s->_gameId.c_str()); _init_stack_base_with_selector(s, s->_kernel->_selectorCache.play); // Call the play selector // Now: Register the first element on the execution stack- @@ -2032,7 +2032,7 @@ int game_run(EngineState **_s) { // and ENGAGE! _game_run(*_s, 0); - debugC(2, kDebugLevelVM, "Game::play() finished.\n"); + debugC(2, kDebugLevelVM, "Game::play() finished."); return 0; } diff --git a/engines/sci/sound/iterator/core.cpp b/engines/sci/sound/iterator/core.cpp index daa92b70c5..c7c9ace028 100644 --- a/engines/sci/sound/iterator/core.cpp +++ b/engines/sci/sound/iterator/core.cpp @@ -559,7 +559,7 @@ void SfxState::updateMultiSong() { if (!newsong) { // Iterators should get freed when there's only one song left playing if(oldfirst && oldfirst->_status == SOUND_STATUS_STOPPED) { - debugC(2, kDebugLevelSound, "[SFX] Stopping song %lx\n", oldfirst->_handle); + debugC(2, kDebugLevelSound, "[SFX] Stopping song %lx", oldfirst->_handle); if (_player && oldfirst->_it) _player->iterator_message(SongIterator::Message(oldfirst->_it->ID, SIMSG_STOP)); } @@ -602,7 +602,7 @@ void SfxState::updateMultiSong() { oldseeker = oldseeker->_nextStopping) if (oldseeker->_nextPlaying == ¬_playing_anymore) { setSongStatus(oldseeker, SOUND_STATUS_SUSPENDED); - debugC(2, kDebugLevelSound, "[SFX] Stopping song %lx\n", oldseeker->_handle); + debugC(2, kDebugLevelSound, "[SFX] Stopping song %lx", oldseeker->_handle); if (_player && oldseeker->_it) _player->iterator_message(SongIterator::Message(oldseeker->_it->ID, SIMSG_STOP)); @@ -611,7 +611,7 @@ void SfxState::updateMultiSong() { for (newseeker = newsong; newseeker; newseeker = newseeker->_nextPlaying) { if (newseeker->_status != SOUND_STATUS_PLAYING && _player) { - debugC(2, kDebugLevelSound, "[SFX] Adding song %lx\n", newseeker->_it->ID); + debugC(2, kDebugLevelSound, "[SFX] Adding song %lx", newseeker->_it->ID); SongIterator *clonesong = newseeker->_it->clone(newseeker->_delay); _player->add_iterator(clonesong, g_system->getMillis()); diff --git a/engines/sci/sound/iterator/iterator.cpp b/engines/sci/sound/iterator/iterator.cpp index 620865c170..d3de8851db 100644 --- a/engines/sci/sound/iterator/iterator.cpp +++ b/engines/sci/sound/iterator/iterator.cpp @@ -247,7 +247,7 @@ int BaseSongIterator::parseMidiCommand(byte *buf, int *result, SongIteratorChann channel->state = SI_STATE_DELTA_TIME; channel->total_timepos = channel->loop_timepos; channel->last_cmd = 0xfe; - debugC(2, kDebugLevelSound, "Looping song iterator %08lx.\n", ID); + debugC(2, kDebugLevelSound, "Looping song iterator %08lx.", ID); return SI_LOOP; } else { channel->state = SI_STATE_FINISHED; @@ -402,7 +402,7 @@ int BaseSongIterator::processMidi(byte *buf, int *result, channel->state = SI_STATE_FINISHED; delay = (size * 50 + rate - 1) / rate; /* number of ticks to completion*/ - debugC(2, kDebugLevelSound, "delaying %d ticks\n", delay); + debugC(2, kDebugLevelSound, "delaying %d ticks", delay); return delay; } @@ -544,7 +544,7 @@ static int _sci0_get_pcm_data(Sci0SongIterator *self, } static Audio::AudioStream *makeStream(byte *data, int size, int rate) { - debugC(2, kDebugLevelSound, "Playing PCM data of size %d, rate %d\n", size, rate); + debugC(2, kDebugLevelSound, "Playing PCM data of size %d, rate %d", size, rate); // Duplicate the data byte *sound = (byte *)malloc(size); @@ -573,7 +573,7 @@ SongIterator *Sci0SongIterator::handleMessage(Message msg) { case _SIMSG_BASEMSG_PRINT: print_tabs_id(msg._arg.i, ID); - debugC(2, kDebugLevelSound, "SCI0: dev=%d, active-chan=%d, size=%d, loops=%d\n", + debugC(2, kDebugLevelSound, "SCI0: dev=%d, active-chan=%d, size=%d, loops=%d", _deviceId, _numActiveChannels, _data.size(), _loops); break; @@ -973,7 +973,7 @@ SongIterator *Sci1SongIterator::handleMessage(Message msg) { playmask |= _channels[i].playmask; print_tabs_id(msg._arg.i, ID); - debugC(2, kDebugLevelSound, "SCI1: chan-nr=%d, playmask=%04x\n", + debugC(2, kDebugLevelSound, "SCI1: chan-nr=%d, playmask=%04x", _numChannels, playmask); } break; @@ -1126,7 +1126,7 @@ public: SongIterator *CleanupSongIterator::handleMessage(Message msg) { if (msg._class == _SIMSG_BASEMSG_PRINT && msg._type == _SIMSG_BASEMSG_PRINT) { print_tabs_id(msg._arg.i, ID); - debugC(2, kDebugLevelSound, "CLEANUP\n"); + debugC(2, kDebugLevelSound, "CLEANUP"); } return NULL; @@ -1208,7 +1208,7 @@ SongIterator *FastForwardSongIterator::handleMessage(Message msg) { if (msg._class == _SIMSG_BASE && msg._type == _SIMSG_BASEMSG_PRINT) { print_tabs_id(msg._arg.i, ID); - debugC(2, kDebugLevelSound, "FASTFORWARD:\n"); + debugC(2, kDebugLevelSound, "FASTFORWARD:"); msg._arg.i++; } @@ -1511,7 +1511,7 @@ SongIterator *TeeSongIterator::handleMessage(Message msg) { if (msg._class == _SIMSG_BASE && msg._type == _SIMSG_BASEMSG_PRINT) { print_tabs_id(msg._arg.i, ID); - debugC(2, kDebugLevelSound, "TEE:\n"); + debugC(2, kDebugLevelSound, "TEE:"); msg._arg.i++; } @@ -1555,15 +1555,15 @@ int songit_next(SongIterator **it, byte *buf, int *result, int mask) { do { retval = (*it)->nextCommand(buf, result); if (retval == SI_MORPH) { - debugC(2, kDebugLevelSound, " Morphing %p (stored at %p)\n", (void *)*it, (void *)it); + debugC(2, kDebugLevelSound, " Morphing %p (stored at %p)", (void *)*it, (void *)it); if (!SIMSG_SEND((*it), SIMSG_ACK_MORPH)) { error("SI_MORPH failed. Breakpoint in %s, line %d", __FILE__, __LINE__); } else - debugC(2, kDebugLevelSound, "SI_MORPH successful\n"); + debugC(2, kDebugLevelSound, "SI_MORPH successful"); } if (retval == SI_FINISHED) - debugC(2, kDebugLevelSound, "[song-iterator] Song finished. mask = %04x, cm=%04x\n", + debugC(2, kDebugLevelSound, "[song-iterator] Song finished. mask = %04x, cm=%04x", mask, (*it)->channel_mask); if (retval == SI_FINISHED && (mask & IT_READER_MAY_CLEAN) diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index f7eb1962cb..a0f0a06ec8 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -95,26 +95,26 @@ void process_sound_events(EngineState *s) { /* Get all sound events, apply their switch (result) { case SI_LOOP: - debugC(2, kDebugLevelSound, "[process-sound] Song %04x:%04x looped (to %d)\n", + debugC(2, kDebugLevelSound, "[process-sound] Song %04x:%04x looped (to %d)", PRINT_REG(obj), cue); /* PUT_SEL32V(segMan, obj, loops, GET_SEL32V(segMan, obj, loop) - 1);*/ PUT_SEL32V(segMan, obj, signal, SIGNAL_OFFSET); break; case SI_RELATIVE_CUE: - debugC(2, kDebugLevelSound, "[process-sound] Song %04x:%04x received relative cue %d\n", + debugC(2, kDebugLevelSound, "[process-sound] Song %04x:%04x received relative cue %d", PRINT_REG(obj), cue); PUT_SEL32V(segMan, obj, signal, cue + 0x7f); break; case SI_ABSOLUTE_CUE: - debugC(2, kDebugLevelSound, "[process-sound] Song %04x:%04x received absolute cue %d\n", + debugC(2, kDebugLevelSound, "[process-sound] Song %04x:%04x received absolute cue %d", PRINT_REG(obj), cue); PUT_SEL32V(segMan, obj, signal, cue); break; case SI_FINISHED: - debugC(2, kDebugLevelSound, "[process-sound] Song %04x:%04x finished\n", + debugC(2, kDebugLevelSound, "[process-sound] Song %04x:%04x finished", PRINT_REG(obj)); PUT_SEL32V(segMan, obj, signal, SIGNAL_OFFSET); PUT_SEL32V(segMan, obj, state, kSoundStopped); @@ -389,7 +389,7 @@ void SoundCommandParser::cmdPlaySound(reg_t obj, int16 value) { PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET); return; } - debugC(2, kDebugLevelSound, "Initializing song number %d\n", songNumber); + debugC(2, kDebugLevelSound, "Initializing song number %d", songNumber); _state->sfx_add_song(build_iterator(_resMan, songNumber, SCI_SONG_ITERATOR_TYPE_SCI1, handle), 0, handle, songNumber); } @@ -734,21 +734,21 @@ void SoundCommandParser::cmdUpdateCues(reg_t obj, int16 value) { switch (result) { case SI_ABSOLUTE_CUE: - debugC(2, kDebugLevelSound, "--- [CUE] %04x:%04x Absolute Cue: %d\n", + debugC(2, kDebugLevelSound, "--- [CUE] %04x:%04x Absolute Cue: %d", PRINT_REG(obj), signal); - debugC(2, kDebugLevelSound, "abs-signal %04X\n", signal); + debugC(2, kDebugLevelSound, "abs-signal %04X", signal); PUT_SEL32V(_segMan, obj, signal, signal); break; case SI_RELATIVE_CUE: - debugC(2, kDebugLevelSound, "--- [CUE] %04x:%04x Relative Cue: %d\n", + debugC(2, kDebugLevelSound, "--- [CUE] %04x:%04x Relative Cue: %d", PRINT_REG(obj), signal); /* FIXME to match commented-out semantics * below, with proper storage of dataInc and * signal in the iterator code. */ PUT_SEL32V(_segMan, obj, dataInc, signal); - debugC(2, kDebugLevelSound, "rel-signal %04X\n", signal); + debugC(2, kDebugLevelSound, "rel-signal %04X", signal); if (_soundVersion == SCI_VERSION_1_EARLY) PUT_SEL32V(_segMan, obj, signal, signal); else @@ -756,7 +756,7 @@ void SoundCommandParser::cmdUpdateCues(reg_t obj, int16 value) { break; case SI_FINISHED: - debugC(2, kDebugLevelSound, "--- [FINISHED] %04x:%04x\n", PRINT_REG(obj)); + debugC(2, kDebugLevelSound, "--- [FINISHED] %04x:%04x", PRINT_REG(obj)); PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET); break; |