SCI: Remove extra '\n's in debugC messages

svn-id: r47707
This commit is contained in:
Willem Jan Palenstijn 2010-01-30 11:59:05 +00:00
parent 9449585893
commit 06bd17ee71
14 changed files with 87 additions and 87 deletions

View file

@ -38,7 +38,7 @@ struct WorklistManager {
if (!reg.segment) // No numbers if (!reg.segment) // No numbers
return; 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)) if (_map.contains(reg))
return; // already dealt with it 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 // Run Worklist Algorithm
while (!wm._worklist.empty()) { while (!wm._worklist.empty()) {
reg_t reg = wm._worklist.back(); reg_t reg = wm._worklist.back();
wm._worklist.pop_back(); wm._worklist.pop_back();
if (reg.segment != s->stack_segment) { // No need to repeat this one 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]) if (reg.segment < segMan->_heap.size() && segMan->_heap[reg.segment])
segMan->_heap[reg.segment]->listAllOutgoingReferences(reg, &wm, add_outgoing_refs); 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 // Not found -> we can free it
deallocator->mobj->freeAtAddress(deallocator->segMan, addr); deallocator->mobj->freeAtAddress(deallocator->segMan, addr);
#ifdef DEBUG_GC #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()]++; deallocator->segcount[deallocator->mobj->getType()]++;
#endif #endif
} }
@ -177,7 +177,7 @@ void run_gc(EngineState *s) {
SegManager *segMan = s->_segMan; SegManager *segMan = s->_segMan;
#ifdef DEBUG_GC #ifdef DEBUG_GC
debugC(2, kDebugLevelGC, "[GC] Running...\n"); debugC(2, kDebugLevelGC, "[GC] Running...");
memset(&(deallocator.segcount), 0, sizeof(int) * (SEG_TYPE_MAX + 1)); memset(&(deallocator.segcount), 0, sizeof(int) * (SEG_TYPE_MAX + 1));
#endif #endif
@ -199,10 +199,10 @@ void run_gc(EngineState *s) {
#ifdef DEBUG_GC #ifdef DEBUG_GC
{ {
int i; int i;
debugC(2, kDebugLevelGC, "[GC] Summary:\n"); debugC(2, kDebugLevelGC, "[GC] Summary:");
for (i = 0; i <= SEG_TYPE_MAX; i++) for (i = 0; i <= SEG_TYPE_MAX; i++)
if (deallocator.segcount[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 #endif
} }

View file

@ -423,7 +423,7 @@ int Kernel::findSelector(const char *selectorName) const {
return pos; 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; return -1;
} }
@ -473,7 +473,7 @@ reg_t kalloc(SegManager *segMan, const char *type, int space) {
reg_t reg; reg_t reg;
segMan->allocateHunkEntry(type, space, &reg); segMan->allocateHunkEntry(type, space, &reg);
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; return reg;
} }
@ -627,7 +627,7 @@ void Kernel::mapFunctions() {
} }
} // for all functions requesting to be mapped } // 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); mapped + ignored, _kernelNames.size(), mapped, ignored);
return; return;

View file

@ -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) { 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); FileHandle *f = getFileFromHandle(s, handle);
if (!f) if (!f)
@ -241,7 +241,7 @@ static void fgets_wrapper(EngineState *s, char *dest, int maxsize, int handle) {
dest[strSize - 1] = 0; 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) { static int _savegame_index_struct_compare(const void *a, const void *b) {

View file

@ -319,7 +319,7 @@ reg_t kGraph(EngineState *s, int argc, reg_t *argv) {
case K_GRAPH_ADJUST_PRIORITY: case K_GRAPH_ADJUST_PRIORITY:
// Seems to be only implemented for SCI0/SCI01 games // 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()); s->_gui->graphAdjustPriority(argv[1].toUint16(), argv[2].toUint16());
break; break;
@ -352,7 +352,7 @@ reg_t kTextSize(EngineState *s, int argc, reg_t *argv) {
if (text.empty() || !dest) { // Empty text if (text.empty() || !dest) { // Empty text
dest[2] = dest[3] = make_reg(0, 0); 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; return s->r_acc;
} }
@ -365,7 +365,7 @@ reg_t kTextSize(EngineState *s, int argc, reg_t *argv) {
#endif #endif
s->_gui->textSize(s->strSplit(text.c_str(), sep).c_str(), font_nr, maxwidth, &textWidth, &textHeight); 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[2] = make_reg(0, textHeight);
dest[3] = make_reg(0, textWidth); dest[3] = make_reg(0, textWidth);
return s->r_acc; return s->r_acc;
@ -504,7 +504,7 @@ reg_t kNumLoops(EngineState *s, int argc, reg_t *argv) {
#endif #endif
loopCount = s->_gui->getLoopCount(viewId); 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); return make_reg(0, loopCount);
} }
@ -522,7 +522,7 @@ reg_t kNumCels(EngineState *s, int argc, reg_t *argv) {
#endif #endif
celCount = s->_gui->getCelCount(viewId, loopNo); 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); return make_reg(0, celCount);
} }
@ -831,13 +831,13 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) {
switch (type) { switch (type) {
case SCI_CONTROLS_TYPE_BUTTON: 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); s->_gui->drawControlButton(rect, controlObject, s->strSplit(text.c_str(), NULL).c_str(), fontId, style, hilite);
return; return;
case SCI_CONTROLS_TYPE_TEXT: case SCI_CONTROLS_TYPE_TEXT:
alignment = GET_SEL32V(s->_segMan, controlObject, mode); 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); s->_gui->drawControlText(rect, controlObject, s->strSplit(text.c_str()).c_str(), fontId, alignment, style, hilite);
return; return;
@ -845,7 +845,7 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) {
mode = GET_SEL32V(s->_segMan, controlObject, mode); mode = GET_SEL32V(s->_segMan, controlObject, mode);
maxChars = GET_SEL32V(s->_segMan, controlObject, max); maxChars = GET_SEL32V(s->_segMan, controlObject, max);
cursorPos = GET_SEL32V(s->_segMan, controlObject, cursor); 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); s->_gui->drawControlTextEdit(rect, controlObject, s->strSplit(text.c_str(), NULL).c_str(), fontId, mode, style, cursorPos, maxChars, hilite);
return; return;
@ -865,7 +865,7 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) {
else else
priority = -1; 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); s->_gui->drawControlIcon(rect, controlObject, viewId, loopNo, celNo, priority, style, hilite);
return; 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); s->_gui->drawControlList(rect, controlObject, maxChars, listCount, listEntries, fontId, style, upperPos, cursorPos, isAlias, hilite);
free(listEntries); free(listEntries);
delete[] listStrings; delete[] listStrings;

View file

@ -118,7 +118,7 @@ reg_t kNewList(EngineState *s, int argc, reg_t *argv) {
List *l; List *l;
l = s->_segMan->allocateList(&listbase); l = s->_segMan->allocateList(&listbase);
l->first = l->last = NULL_REG; 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 return listbase; // Return list base address
} }
@ -178,7 +178,7 @@ reg_t kNewNode(EngineState *s, int argc, reg_t *argv) {
else else
s->r_acc = _k_new_node(s, argv[0], argv[1]); 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; 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); List *l = s->_segMan->lookupList(listbase);
Node *new_n = s->_segMan->lookupNode(nodebase); 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 // FIXME: This should be an error, but it's turned to a warning for now
if (!new_n) 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); List *l = s->_segMan->lookupList(listbase);
Node *new_n = s->_segMan->lookupNode(nodebase); 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 // FIXME: This should be an error, but it's turned to a warning for now
if (!new_n) if (!new_n)
@ -344,26 +344,26 @@ reg_t kFindKey(EngineState *s, int argc, reg_t *argv) {
reg_t key = argv[1]; reg_t key = argv[1];
reg_t list_pos = argv[0]; 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]); checkListPointer(s->_segMan, argv[0]);
node_pos = s->_segMan->lookupList(list_pos)->first; 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()) { while (!node_pos.isNull()) {
Node *n = s->_segMan->lookupNode(node_pos); Node *n = s->_segMan->lookupNode(node_pos);
if (n->key == key) { 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; return node_pos;
} }
node_pos = n->succ; 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; return NULL_REG;
} }

View file

@ -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(dx)
// POST: (dx != 0) ==> abs(tmp) ~>=~ abs(dy) // 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 // Compute x step
if (tmp != 0) if (tmp != 0)
@ -154,8 +154,8 @@ reg_t kSetJump(EngineState *s, int argc, reg_t *argv) {
// Always force vy to be upwards // Always force vy to be upwards
vy = -abs(vy); vy = -abs(vy);
debugC(2, kDebugLevelBresen, "SetJump for object at %04x:%04x\n", PRINT_REG(object)); debugC(2, kDebugLevelBresen, "SetJump for object at %04x:%04x", PRINT_REG(object));
debugC(2, kDebugLevelBresen, "xStep: %d, yStep: %d\n", vx, vy); debugC(2, kDebugLevelBresen, "xStep: %d, yStep: %d", vx, vy);
PUT_SEL32V(segMan, object, xStep, vx); PUT_SEL32V(segMan, object, xStep, vx);
PUT_SEL32V(segMan, object, yStep, vy); 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, dx, deltax_step);
PUT_SEL32V(segMan, mover, dy, deltay_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, "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\n", debugC(2, kDebugLevelBresen, " steps=%d, mv=(%d, %d), i1= %d, i2=%d",
numsteps, deltax_step, deltay_step, i1, bdi*2); numsteps, deltax_step, deltay_step, i1, bdi*2);
//PUT_SEL32V(segMan, mover, b_movCnt, numsteps); // Needed for HQ1/Ogre? //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; y = desty;
completed = 1; 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, x, x);
PUT_SEL32V(segMan, client, y, y); 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) { if (s->_kernel->_selectorCache.cantBeHere != -1) {
invoke_selector(INV_SEL(client, cantBeHere, kStopOnInvalidSelector), 0); 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, y, oldy);
PUT_SEL32V(segMan, client, signal, (signal | kSignalHitObstacle)); 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; completed = 1;
} }
@ -397,7 +397,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) {
destx = GET_SEL32V(segMan, mover, x); destx = GET_SEL32V(segMan, mover, x);
desty = GET_SEL32V(segMan, mover, y); 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)) { 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)); 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); dy = desty - GET_SEL32V(segMan, client, y);
angle = getAngle(dx, dy); 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 if (s->r_acc.offset) { // isBlocked() returned non-zero
int rotation = (rand() & 1) ? 45 : (360 - 45); // Clockwise/counterclockwise 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 ystep = GET_SEL32V(segMan, client, yStep);
int moves; 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++) { for (moves = 0; moves < 8; moves++) {
int move_x = (int)(sin(angle * PI / 180.0) * (xstep)); 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, x, oldx + move_x);
PUT_SEL32V(segMan, client, y, oldy + move_y); 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)) { if (invoke_selector(INV_SEL(client, canBeHere, kContinueOnInvalidSelector) , 0)) {
error("Client %04x:%04x of avoider %04x:%04x doesn't" 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); PUT_SEL32V(segMan, client, y, oldy);
if (s->r_acc.offset) { // We can be here if (s->r_acc.offset) { // We can be here
debugC(2, kDebugLevelBresen, "Success\n"); debugC(2, kDebugLevelBresen, "Success");
PUT_SEL32V(segMan, client, heading, angle); PUT_SEL32V(segMan, client, heading, angle);
return make_reg(0, angle); return make_reg(0, angle);

View file

@ -105,10 +105,10 @@ reg_t kParse(EngineState *s, int argc, reg_t *argv) {
s->r_acc = make_reg(0, 1); s->r_acc = make_reg(0, 1);
#ifdef DEBUG_PARSER #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) 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 #endif
int syntax_fail = voc->parseGNF(words); 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); invoke_selector(INV_SEL(s->_gameObj, syntaxFail, kStopOnInvalidSelector), 2, s->_voc->parser_base, stringpos);
/* Issue warning */ /* Issue warning */
debugC(2, kDebugLevelParser, "Tree building failed\n"); debugC(2, kDebugLevelParser, "Tree building failed");
} else { } else {
s->_voc->parserIsValid = true; s->_voc->parserIsValid = true;
@ -137,7 +137,7 @@ reg_t kParse(EngineState *s, int argc, reg_t *argv) {
PUT_SEL32V(segMan, event, claimed, 1); PUT_SEL32V(segMan, event, claimed, 1);
if (error) { if (error) {
s->_segMan->strcpy(s->_voc->parser_base, 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: */ /* Issue warning: */
invoke_selector(INV_SEL(s->_gameObj, wordFail, kStopOnInvalidSelector), 2, s->_voc->parser_base, stringpos); 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(); byte *synonyms = s->_segMan->getScript(seg)->getSynonyms();
if (synonyms) { if (synonyms) {
debugC(2, kDebugLevelParser, "Setting %d synonyms for script.%d\n", debugC(2, kDebugLevelParser, "Setting %d synonyms for script.%d",
numSynonyms, script); numSynonyms, script);
if (numSynonyms > 16384) { if (numSynonyms > 16384) {
@ -203,7 +203,7 @@ reg_t kSetSynonyms(EngineState *s, int argc, reg_t *argv) {
node = s->_segMan->lookupNode(node->succ); 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; return s->r_acc;
} }

View file

@ -121,7 +121,7 @@ reg_t kClone(EngineState *s, int argc, reg_t *argv) {
return NULL_REG; 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); clone_obj = s->_segMan->allocateClone(&clone_addr);

View file

@ -214,7 +214,7 @@ reg_t kFormat(EngineState *s, int argc, reg_t *argv) {
Common::String source_str = kernel_lookup_text(s, position, index); Common::String source_str = kernel_lookup_text(s, position, index);
const char* source = source_str.c_str(); 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); arguments = (uint16 *)malloc(sizeof(uint16) * argc);

View file

@ -322,9 +322,9 @@ reg_t Script::findCanonicAddress(SegManager *segMan, reg_t addr) {
void Script::freeAtAddress(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) if (_localsSegment)
debugC(2, kDebugLevelGC, "[GC] Freeing locals %04x:0000\n", _localsSegment); debugC(2, kDebugLevelGC, "[GC] Freeing locals %04x:0000", _localsSegment);
*/ */
if (_markedAsDeleted) 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 that this also includes the 'base' object, which is part of the script and therefore also emits the locals.
(*note)(param, clone->getPos()); (*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) { void CloneTable::freeAtAddress(SegManager *segMan, reg_t addr) {

View file

@ -64,12 +64,12 @@ static reg_t &validate_property(Object *obj, int index) {
static reg_t dummyReg = NULL_REG; static reg_t dummyReg = NULL_REG;
if (!obj) { if (!obj) {
debugC(2, kDebugLevelVM, "[VM] Sending to disposed object!\n"); debugC(2, kDebugLevelVM, "[VM] Sending to disposed object!");
return dummyReg; return dummyReg;
} }
if (index < 0 || (uint)index >= obj->getVarCount()) { 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()); index, obj->getVarCount());
return dummyReg; 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); warning("[VM] Access would be outside even of the stack (%d); access denied", total_offset);
return false; return false;
} else { } else {
debugC(2, kDebugLevelVM, "%s\n", txt.c_str()); debugC(2, kDebugLevelVM, "%s", txt.c_str());
debugC(2, kDebugLevelVM, "[VM] Access within stack boundaries; access granted.\n"); debugC(2, kDebugLevelVM, "[VM] Access within stack boundaries; access granted.");
return true; 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. // Explanation: I'm starting to believe that this work is done by SCI itself.
scr->markDeleted(); scr->markDeleted();
debugC(kDebugLevelScripts, "Unloaded script 0x%x.\n", script_nr); debugC(kDebugLevelScripts, "Unloaded script 0x%x.", script_nr);
return; return;
} }
@ -1998,7 +1998,7 @@ static EngineState *_game_run(EngineState *&s, int restoring) {
s = successor; s = successor;
if (script_abort_flag == 2) { if (script_abort_flag == 2) {
debugC(2, kDebugLevelVM, "Restarting with replay()\n"); debugC(2, kDebugLevelVM, "Restarting with replay()");
s->_executionStack.clear(); // Restart with replay s->_executionStack.clear(); // Restart with replay
_init_stack_base_with_selector(s, s->_kernel->_selectorCache.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) { int game_run(EngineState **_s) {
EngineState *s = *_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 _init_stack_base_with_selector(s, s->_kernel->_selectorCache.play); // Call the play selector
// Now: Register the first element on the execution stack- // Now: Register the first element on the execution stack-
@ -2032,7 +2032,7 @@ int game_run(EngineState **_s) {
// and ENGAGE! // and ENGAGE!
_game_run(*_s, 0); _game_run(*_s, 0);
debugC(2, kDebugLevelVM, "Game::play() finished.\n"); debugC(2, kDebugLevelVM, "Game::play() finished.");
return 0; return 0;
} }

View file

@ -559,7 +559,7 @@ void SfxState::updateMultiSong() {
if (!newsong) { if (!newsong) {
// Iterators should get freed when there's only one song left playing // Iterators should get freed when there's only one song left playing
if(oldfirst && oldfirst->_status == SOUND_STATUS_STOPPED) { 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) if (_player && oldfirst->_it)
_player->iterator_message(SongIterator::Message(oldfirst->_it->ID, SIMSG_STOP)); _player->iterator_message(SongIterator::Message(oldfirst->_it->ID, SIMSG_STOP));
} }
@ -602,7 +602,7 @@ void SfxState::updateMultiSong() {
oldseeker = oldseeker->_nextStopping) oldseeker = oldseeker->_nextStopping)
if (oldseeker->_nextPlaying == &not_playing_anymore) { if (oldseeker->_nextPlaying == &not_playing_anymore) {
setSongStatus(oldseeker, SOUND_STATUS_SUSPENDED); 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) if (_player && oldseeker->_it)
_player->iterator_message(SongIterator::Message(oldseeker->_it->ID, SIMSG_STOP)); _player->iterator_message(SongIterator::Message(oldseeker->_it->ID, SIMSG_STOP));
@ -611,7 +611,7 @@ void SfxState::updateMultiSong() {
for (newseeker = newsong; newseeker; newseeker = newseeker->_nextPlaying) { for (newseeker = newsong; newseeker; newseeker = newseeker->_nextPlaying) {
if (newseeker->_status != SOUND_STATUS_PLAYING && _player) { 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); SongIterator *clonesong = newseeker->_it->clone(newseeker->_delay);
_player->add_iterator(clonesong, g_system->getMillis()); _player->add_iterator(clonesong, g_system->getMillis());

View file

@ -247,7 +247,7 @@ int BaseSongIterator::parseMidiCommand(byte *buf, int *result, SongIteratorChann
channel->state = SI_STATE_DELTA_TIME; channel->state = SI_STATE_DELTA_TIME;
channel->total_timepos = channel->loop_timepos; channel->total_timepos = channel->loop_timepos;
channel->last_cmd = 0xfe; channel->last_cmd = 0xfe;
debugC(2, kDebugLevelSound, "Looping song iterator %08lx.\n", ID); debugC(2, kDebugLevelSound, "Looping song iterator %08lx.", ID);
return SI_LOOP; return SI_LOOP;
} else { } else {
channel->state = SI_STATE_FINISHED; channel->state = SI_STATE_FINISHED;
@ -402,7 +402,7 @@ int BaseSongIterator::processMidi(byte *buf, int *result,
channel->state = SI_STATE_FINISHED; channel->state = SI_STATE_FINISHED;
delay = (size * 50 + rate - 1) / rate; /* number of ticks to completion*/ 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; return delay;
} }
@ -544,7 +544,7 @@ static int _sci0_get_pcm_data(Sci0SongIterator *self,
} }
static Audio::AudioStream *makeStream(byte *data, int size, int rate) { 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 // Duplicate the data
byte *sound = (byte *)malloc(size); byte *sound = (byte *)malloc(size);
@ -573,7 +573,7 @@ SongIterator *Sci0SongIterator::handleMessage(Message msg) {
case _SIMSG_BASEMSG_PRINT: case _SIMSG_BASEMSG_PRINT:
print_tabs_id(msg._arg.i, ID); 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); _deviceId, _numActiveChannels, _data.size(), _loops);
break; break;
@ -973,7 +973,7 @@ SongIterator *Sci1SongIterator::handleMessage(Message msg) {
playmask |= _channels[i].playmask; playmask |= _channels[i].playmask;
print_tabs_id(msg._arg.i, ID); 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); _numChannels, playmask);
} }
break; break;
@ -1126,7 +1126,7 @@ public:
SongIterator *CleanupSongIterator::handleMessage(Message msg) { SongIterator *CleanupSongIterator::handleMessage(Message msg) {
if (msg._class == _SIMSG_BASEMSG_PRINT && msg._type == _SIMSG_BASEMSG_PRINT) { if (msg._class == _SIMSG_BASEMSG_PRINT && msg._type == _SIMSG_BASEMSG_PRINT) {
print_tabs_id(msg._arg.i, ID); print_tabs_id(msg._arg.i, ID);
debugC(2, kDebugLevelSound, "CLEANUP\n"); debugC(2, kDebugLevelSound, "CLEANUP");
} }
return NULL; return NULL;
@ -1208,7 +1208,7 @@ SongIterator *FastForwardSongIterator::handleMessage(Message msg) {
if (msg._class == _SIMSG_BASE && msg._type == _SIMSG_BASEMSG_PRINT) { if (msg._class == _SIMSG_BASE && msg._type == _SIMSG_BASEMSG_PRINT) {
print_tabs_id(msg._arg.i, ID); print_tabs_id(msg._arg.i, ID);
debugC(2, kDebugLevelSound, "FASTFORWARD:\n"); debugC(2, kDebugLevelSound, "FASTFORWARD:");
msg._arg.i++; msg._arg.i++;
} }
@ -1511,7 +1511,7 @@ SongIterator *TeeSongIterator::handleMessage(Message msg) {
if (msg._class == _SIMSG_BASE && msg._type == _SIMSG_BASEMSG_PRINT) { if (msg._class == _SIMSG_BASE && msg._type == _SIMSG_BASEMSG_PRINT) {
print_tabs_id(msg._arg.i, ID); print_tabs_id(msg._arg.i, ID);
debugC(2, kDebugLevelSound, "TEE:\n"); debugC(2, kDebugLevelSound, "TEE:");
msg._arg.i++; msg._arg.i++;
} }
@ -1555,15 +1555,15 @@ int songit_next(SongIterator **it, byte *buf, int *result, int mask) {
do { do {
retval = (*it)->nextCommand(buf, result); retval = (*it)->nextCommand(buf, result);
if (retval == SI_MORPH) { 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)) { if (!SIMSG_SEND((*it), SIMSG_ACK_MORPH)) {
error("SI_MORPH failed. Breakpoint in %s, line %d", __FILE__, __LINE__); error("SI_MORPH failed. Breakpoint in %s, line %d", __FILE__, __LINE__);
} else } else
debugC(2, kDebugLevelSound, "SI_MORPH successful\n"); debugC(2, kDebugLevelSound, "SI_MORPH successful");
} }
if (retval == SI_FINISHED) 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); mask, (*it)->channel_mask);
if (retval == SI_FINISHED if (retval == SI_FINISHED
&& (mask & IT_READER_MAY_CLEAN) && (mask & IT_READER_MAY_CLEAN)

View file

@ -95,26 +95,26 @@ void process_sound_events(EngineState *s) { /* Get all sound events, apply their
switch (result) { switch (result) {
case SI_LOOP: 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); PRINT_REG(obj), cue);
/* PUT_SEL32V(segMan, obj, loops, GET_SEL32V(segMan, obj, loop) - 1);*/ /* PUT_SEL32V(segMan, obj, loops, GET_SEL32V(segMan, obj, loop) - 1);*/
PUT_SEL32V(segMan, obj, signal, SIGNAL_OFFSET); PUT_SEL32V(segMan, obj, signal, SIGNAL_OFFSET);
break; break;
case SI_RELATIVE_CUE: 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); PRINT_REG(obj), cue);
PUT_SEL32V(segMan, obj, signal, cue + 0x7f); PUT_SEL32V(segMan, obj, signal, cue + 0x7f);
break; break;
case SI_ABSOLUTE_CUE: 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); PRINT_REG(obj), cue);
PUT_SEL32V(segMan, obj, signal, cue); PUT_SEL32V(segMan, obj, signal, cue);
break; break;
case SI_FINISHED: 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)); PRINT_REG(obj));
PUT_SEL32V(segMan, obj, signal, SIGNAL_OFFSET); PUT_SEL32V(segMan, obj, signal, SIGNAL_OFFSET);
PUT_SEL32V(segMan, obj, state, kSoundStopped); 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); PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET);
return; 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, _state->sfx_add_song(build_iterator(_resMan, songNumber, SCI_SONG_ITERATOR_TYPE_SCI1,
handle), 0, handle, songNumber); handle), 0, handle, songNumber);
} }
@ -734,21 +734,21 @@ void SoundCommandParser::cmdUpdateCues(reg_t obj, int16 value) {
switch (result) { switch (result) {
case SI_ABSOLUTE_CUE: 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); 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); PUT_SEL32V(_segMan, obj, signal, signal);
break; break;
case SI_RELATIVE_CUE: 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); PRINT_REG(obj), signal);
/* FIXME to match commented-out semantics /* FIXME to match commented-out semantics
* below, with proper storage of dataInc and * below, with proper storage of dataInc and
* signal in the iterator code. */ * signal in the iterator code. */
PUT_SEL32V(_segMan, obj, dataInc, signal); 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) if (_soundVersion == SCI_VERSION_1_EARLY)
PUT_SEL32V(_segMan, obj, signal, signal); PUT_SEL32V(_segMan, obj, signal, signal);
else else
@ -756,7 +756,7 @@ void SoundCommandParser::cmdUpdateCues(reg_t obj, int16 value) {
break; break;
case SI_FINISHED: 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); PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET);
break; break;