[Scummvm-cvs-logs] SF.net SVN: scummvm:[42167] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Jul 6 12:39:23 CEST 2009


Revision: 42167
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42167&view=rev
Author:   thebluegr
Date:     2009-07-06 10:39:22 +0000 (Mon, 06 Jul 2009)

Log Message:
-----------
Replaced sciprintf() calls with printf, DebugPrintf, warning and error calls

Modified Paths:
--------------
    scummvm/trunk/engines/sci/console.cpp
    scummvm/trunk/engines/sci/engine/gc.cpp
    scummvm/trunk/engines/sci/engine/grammar.cpp
    scummvm/trunk/engines/sci/engine/kernel.cpp
    scummvm/trunk/engines/sci/engine/kevent.cpp
    scummvm/trunk/engines/sci/engine/kfile.cpp
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/kmisc.cpp
    scummvm/trunk/engines/sci/engine/kmovement.cpp
    scummvm/trunk/engines/sci/engine/kpathing.cpp
    scummvm/trunk/engines/sci/engine/ksound.cpp
    scummvm/trunk/engines/sci/engine/kstring.cpp
    scummvm/trunk/engines/sci/engine/memobj.cpp
    scummvm/trunk/engines/sci/engine/said.cpp
    scummvm/trunk/engines/sci/engine/said.y
    scummvm/trunk/engines/sci/engine/savegame.cpp
    scummvm/trunk/engines/sci/engine/script.cpp
    scummvm/trunk/engines/sci/engine/scriptdebug.cpp
    scummvm/trunk/engines/sci/engine/seg_manager.cpp
    scummvm/trunk/engines/sci/engine/vm.cpp
    scummvm/trunk/engines/sci/gfx/font.cpp
    scummvm/trunk/engines/sci/gfx/gfx_driver.cpp
    scummvm/trunk/engines/sci/gfx/gfx_gui.cpp
    scummvm/trunk/engines/sci/gfx/gfx_pixmap_scale.cpp
    scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp
    scummvm/trunk/engines/sci/gfx/gfx_state_internal.h
    scummvm/trunk/engines/sci/gfx/gfx_support.cpp
    scummvm/trunk/engines/sci/gfx/gfx_system.h
    scummvm/trunk/engines/sci/gfx/gfx_tools.cpp
    scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp
    scummvm/trunk/engines/sci/gfx/menubar.cpp
    scummvm/trunk/engines/sci/gfx/operations.cpp
    scummvm/trunk/engines/sci/gfx/res_cursor.cpp
    scummvm/trunk/engines/sci/gfx/res_font.cpp
    scummvm/trunk/engines/sci/gfx/res_pal.cpp
    scummvm/trunk/engines/sci/gfx/res_pic.cpp
    scummvm/trunk/engines/sci/gfx/res_view.cpp
    scummvm/trunk/engines/sci/resource.cpp
    scummvm/trunk/engines/sci/sci.cpp
    scummvm/trunk/engines/sci/sci.h
    scummvm/trunk/engines/sci/sfx/iterator.cpp
    scummvm/trunk/engines/sci/sfx/softseq/amiga.cpp
    scummvm/trunk/engines/sci/sfx/songlib.cpp
    scummvm/trunk/engines/sci/tools.cpp
    scummvm/trunk/engines/sci/tools.h
    scummvm/trunk/engines/sci/vocabulary.cpp
    scummvm/trunk/engines/sci/vocabulary.h

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/console.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -461,6 +461,7 @@
 
 int parseNodes(EngineState *s, int *i, int *pos, int type, int nr, int argc, const char **argv) {
 	int nextToken = 0, nextValue = 0, newPos = 0, oldPos = 0;
+	Console *con = ((SciEngine *)g_engine)->getSciDebugger();
 
 	if (type == kParseNil)
 		return 0;
@@ -471,11 +472,11 @@
 		return *pos;
 	}
 	if (type == kParseEndOfInput) {
-		sciprintf("Unbalanced parentheses\n");
+		con->DebugPrintf("Unbalanced parentheses\n");
 		return -1;
 	}
 	if (type == kParseClosingParenthesis) {
-		sciprintf("Syntax error at token %d\n", *i);
+		con->DebugPrintf("Syntax error at token %d\n", *i);
 		return -1;
 	}
 
@@ -505,7 +506,7 @@
 
 	const char *token = argv[(*i)++];
 	if (strcmp(token, ")"))
-		sciprintf("Expected ')' at token %d\n", *i);
+		con->DebugPrintf("Expected ')' at token %d\n", *i);
 
 	return oldPos;
 }
@@ -2032,7 +2033,7 @@
 bool Console::cmdBacktrace(int argc, const char **argv) {
 	DebugPrintf("Dumping the send/self/super/call/calle/callb stack:\n");
 
-	DebugPrintf("Call stack (current base: 0x%x):\n", _vm->_gamestate->execution_stack_base);
+	printf("Call stack (current base: 0x%x):\n", _vm->_gamestate->execution_stack_base);
 	Common::List<ExecStack>::iterator iter;
 	uint i = 0;
 
@@ -2045,17 +2046,17 @@
 		switch (call.type) {
 
 		case EXEC_STACK_TYPE_CALL: {// Normal function
-			sciprintf(" %x:[%x]  %s::%s(", i, call.origin, objname, (call.selector == -1) ? "<call[be]?>" :
+			printf(" %x:[%x]  %s::%s(", i, call.origin, objname, (call.selector == -1) ? "<call[be]?>" :
 			          selector_name(_vm->_gamestate, call.selector));
 		}
 		break;
 
 		case EXEC_STACK_TYPE_KERNEL: // Kernel function
-			sciprintf(" %x:[%x]  k%s(", i, call.origin, _vm->_gamestate->_kernel->getKernelName(-(call.selector) - 42).c_str());
+			printf(" %x:[%x]  k%s(", i, call.origin, _vm->_gamestate->_kernel->getKernelName(-(call.selector) - 42).c_str());
 			break;
 
 		case EXEC_STACK_TYPE_VARSELECTOR:
-			sciprintf(" %x:[%x] vs%s %s::%s (", i, call.origin, (call.argc) ? "write" : "read",
+			printf(" %x:[%x] vs%s %s::%s (", i, call.origin, (call.argc) ? "write" : "read",
 			          objname, _vm->_gamestate->_kernel->getSelectorName(call.selector).c_str());
 			break;
 		}
@@ -2066,31 +2067,31 @@
 			totalparamc = 16;
 
 		for (paramc = 1; paramc <= totalparamc; paramc++) {
-			sciprintf("%04x:%04x", PRINT_REG(call.variables_argp[paramc]));
+			printf("%04x:%04x", PRINT_REG(call.variables_argp[paramc]));
 
 			if (paramc < call.argc)
-				sciprintf(", ");
+				printf(", ");
 		}
 
 		if (call.argc > 16)
-			sciprintf("...");
+			printf("...");
 
-		sciprintf(")\n    obj@%04x:%04x", PRINT_REG(call.objp));
+		printf(")\n    obj@%04x:%04x", PRINT_REG(call.objp));
 		if (call.type == EXEC_STACK_TYPE_CALL) {
-			sciprintf(" pc=%04x:%04x", PRINT_REG(call.addr.pc));
+			printf(" pc=%04x:%04x", PRINT_REG(call.addr.pc));
 			if (call.sp == CALL_SP_CARRY)
-				sciprintf(" sp,fp:carry");
+				printf(" sp,fp:carry");
 			else {
-				sciprintf(" sp=ST:%04x", (unsigned)(call.sp - _vm->_gamestate->stack_base));
-				sciprintf(" fp=ST:%04x", (unsigned)(call.fp - _vm->_gamestate->stack_base));
+				printf(" sp=ST:%04x", (unsigned)(call.sp - _vm->_gamestate->stack_base));
+				printf(" fp=ST:%04x", (unsigned)(call.fp - _vm->_gamestate->stack_base));
 			}
 		} else
-			sciprintf(" pc:none");
+			printf(" pc:none");
 
-		sciprintf(" argp:ST:%04x", (unsigned)(call.variables_argp - _vm->_gamestate->stack_base));
+		printf(" argp:ST:%04x", (unsigned)(call.variables_argp - _vm->_gamestate->stack_base));
 		if (call.type == EXEC_STACK_TYPE_CALL)
-			sciprintf(" script: %d", (*(Script *)_vm->_gamestate->seg_manager->_heap[call.addr.pc.segment]).nr);
-		sciprintf("\n");
+			printf(" script: %d", (*(Script *)_vm->_gamestate->seg_manager->_heap[call.addr.pc.segment]).nr);
+		printf("\n");
 	}
 
 	return 0;
@@ -2290,21 +2291,21 @@
 	selector_id = _vm->_gamestate->_kernel->findSelector(selector_name);
 
 	if (selector_id < 0) {
-		sciprintf("Unknown selector: \"%s\"\n", selector_name);
-		return 1;
+		DebugPrintf("Unknown selector: \"%s\"\n", selector_name);
+		return true;
 	}
 
 	o = obj_get(_vm->_gamestate, object);
 	if (o == NULL) {
-		sciprintf("Address \"%04x:%04x\" is not an object\n", PRINT_REG(object));
-		return 1;
+		DebugPrintf("Address \"%04x:%04x\" is not an object\n", PRINT_REG(object));
+		return true;
 	}
 
 	SelectorType selector_type = lookup_selector(_vm->_gamestate, object, selector_id, 0, &fptr);
 
 	if (selector_type == kSelectorNone) {
-		sciprintf("Object does not support selector: \"%s\"\n", selector_name);
-		return 1;
+		DebugPrintf("Object does not support selector: \"%s\"\n", selector_name);
+		return true;
 	}
 
 	stackframe[0] = make_reg(0, selector_id);
@@ -3043,42 +3044,43 @@
 	Object *obj = obj_get(s, pos);
 	Object *var_container = obj;
 	int i;
+	Console *con = ((SciEngine *)g_engine)->getSciDebugger();
 
 	if (!obj) {
-		sciprintf("[%04x:%04x]: Not an object.", PRINT_REG(pos));
+		con->DebugPrintf("[%04x:%04x]: Not an object.", PRINT_REG(pos));
 		return 1;
 	}
 
 	// Object header
-	sciprintf("[%04x:%04x] %s : %3d vars, %3d methods\n", PRINT_REG(pos), obj_get_name(s, pos),
+	printf("[%04x:%04x] %s : %3d vars, %3d methods\n", PRINT_REG(pos), obj_get_name(s, pos),
 				obj->_variables.size(), obj->methods_nr);
 
 	if (!(obj->_variables[SCRIPT_INFO_SELECTOR].offset & SCRIPT_INFO_CLASS))
 		var_container = obj_get(s, obj->_variables[SCRIPT_SUPERCLASS_SELECTOR]);
-	sciprintf("  -- member variables:\n");
+	printf("  -- member variables:\n");
 	for (i = 0; (uint)i < obj->_variables.size(); i++) {
-		sciprintf("    ");
+		printf("    ");
 		if (i < var_container->variable_names_nr) {
-			sciprintf("[%03x] %s = ", VM_OBJECT_GET_VARSELECTOR(var_container, i), selector_name(s, VM_OBJECT_GET_VARSELECTOR(var_container, i)));
+			printf("[%03x] %s = ", VM_OBJECT_GET_VARSELECTOR(var_container, i), selector_name(s, VM_OBJECT_GET_VARSELECTOR(var_container, i)));
 		} else
-			sciprintf("p#%x = ", i);
+			printf("p#%x = ", i);
 
 		reg_t val = obj->_variables[i];
-		sciprintf("%04x:%04x", PRINT_REG(val));
+		printf("%04x:%04x", PRINT_REG(val));
 
 		Object *ref = obj_get(s, val);
 		if (ref)
-			sciprintf(" (%s)", obj_get_name(s, val));
+			printf(" (%s)", obj_get_name(s, val));
 
-		sciprintf("\n");
+		printf("\n");
 	}
-	sciprintf("  -- methods:\n");
+	printf("  -- methods:\n");
 	for (i = 0; i < obj->methods_nr; i++) {
 		reg_t fptr = VM_OBJECT_READ_FUNCTION(obj, i);
-		sciprintf("    [%03x] %s = %04x:%04x\n", VM_OBJECT_GET_FUNCSELECTOR(obj, i), selector_name(s, VM_OBJECT_GET_FUNCSELECTOR(obj, i)), PRINT_REG(fptr));
+		printf("    [%03x] %s = %04x:%04x\n", VM_OBJECT_GET_FUNCSELECTOR(obj, i), selector_name(s, VM_OBJECT_GET_FUNCSELECTOR(obj, i)), PRINT_REG(fptr));
 	}
 	if (s->seg_manager->_heap[pos.segment]->getType() == MEM_OBJ_SCRIPT)
-		sciprintf("\nOwner script:\t%d\n", s->seg_manager->getScript(pos.segment)->nr);
+		printf("\nOwner script:\t%d\n", s->seg_manager->getScript(pos.segment)->nr);
 
 	return 0;
 }
@@ -3129,39 +3131,39 @@
 
 	GETRECT(view, loop, signal, cel);
 
-	sciprintf("\n-- View information:\ncel %d/%d/%d at ", view, loop, cel);
+	printf("\n-- View information:\ncel %d/%d/%d at ", view, loop, cel);
 
 	x = GET_SELECTOR(pos, x);
 	y = GET_SELECTOR(pos, y);
 	priority = GET_SELECTOR(pos, priority);
 	if (s->_kernel->_selectorMap.z > 0) {
 		z = GET_SELECTOR(pos, z);
-		sciprintf("(%d,%d,%d)\n", x, y, z);
+		printf("(%d,%d,%d)\n", x, y, z);
 	} else
-		sciprintf("(%d,%d)\n", x, y);
+		printf("(%d,%d)\n", x, y);
 
 	if (priority == -1)
-		sciprintf("No priority.\n\n");
+		printf("No priority.\n\n");
 	else
-		sciprintf("Priority = %d (band starts at %d)\n\n", priority, PRIORITY_BAND_FIRST(priority));
+		printf("Priority = %d (band starts at %d)\n\n", priority, PRIORITY_BAND_FIRST(priority));
 
 	if (have_rects) {
-		sciprintf("nsRect: [%d..%d]x[%d..%d]\n", nsLeft, nsRight, nsTop, nsBottom);
-		sciprintf("lsRect: [%d..%d]x[%d..%d]\n", lsLeft, lsRight, lsTop, lsBottom);
-		sciprintf("brRect: [%d..%d]x[%d..%d]\n", brLeft, brRight, brTop, brBottom);
+		printf("nsRect: [%d..%d]x[%d..%d]\n", nsLeft, nsRight, nsTop, nsBottom);
+		printf("lsRect: [%d..%d]x[%d..%d]\n", lsLeft, lsRight, lsTop, lsBottom);
+		printf("brRect: [%d..%d]x[%d..%d]\n", brLeft, brRight, brTop, brBottom);
 	}
 
 	nsrect = get_nsrect(s, pos, 0);
 	nsrect_clipped = get_nsrect(s, pos, 1);
 	brrect = set_base(s, pos);
-	sciprintf("new nsRect: [%d..%d]x[%d..%d]\n", nsrect.x, nsrect.xend, nsrect.y, nsrect.yend);
-	sciprintf("new clipped nsRect: [%d..%d]x[%d..%d]\n", nsrect_clipped.x, nsrect_clipped.xend, nsrect_clipped.y, nsrect_clipped.yend);
-	sciprintf("new brRect: [%d..%d]x[%d..%d]\n", brrect.x, brrect.xend, brrect.y, brrect.yend);
-	sciprintf("\n signals = %04x:\n", signal);
+	printf("new nsRect: [%d..%d]x[%d..%d]\n", nsrect.x, nsrect.xend, nsrect.y, nsrect.yend);
+	printf("new clipped nsRect: [%d..%d]x[%d..%d]\n", nsrect_clipped.x, nsrect_clipped.xend, nsrect_clipped.y, nsrect_clipped.yend);
+	printf("new brRect: [%d..%d]x[%d..%d]\n", brrect.x, brrect.xend, brrect.y, brrect.yend);
+	printf("\n signals = %04x:\n", signal);
 
 	for (i = 0; i < 16; i++)
 		if (signal & (1 << i))
-			sciprintf("  %04x: %s\n", 1 << i, signals[i]);
+			printf("  %04x: %s\n", 1 << i, signals[i]);
 }
 #endif
 #undef GETRECT
@@ -3183,17 +3185,17 @@
 	int brLeft, brRight, brBottom, brTop;
 
 	if (!s) {
-		sciprintf("Not in debug state!\n");
+		printf("Not in debug state!\n");
 		return 1;
 	}
 
 	if ((pos < 4) || (pos > 0xfff0)) {
-		sciprintf("Invalid address.\n");
+		printf("Invalid address.\n");
 		return 1;
 	}
 
 	if (((int16)READ_LE_UINT16(s->heap + pos + SCRIPT_OBJECT_MAGIC_OFFSET)) != SCRIPT_OBJECT_MAGIC_NUMBER) {
-		sciprintf("Not an object.\n");
+		printf("Not an object.\n");
 		return 0;
 	}
 
@@ -3204,7 +3206,7 @@
 	    (lookup_selector(s, pos, s->_kernel->_selectorMap.nsTop, NULL) == kSelectorVariable);
 
 	if (!is_view) {
-		sciprintf("Not a dynamic View object.\n");
+		printf("Not a dynamic View object.\n");
 		return 0;
 	}
 
@@ -3239,7 +3241,7 @@
 	int opcode, opnumber;
 
 	if (!g_debugstate_valid) {
-		sciprintf("Not in debug state\n");
+		printf("Not in debug state\n");
 		return 1;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/gc.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/gc.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/gc.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -29,7 +29,6 @@
 namespace Sci {
 
 //#define DEBUG_GC
-//#define DEBUG_GC_VERBOSE
 
 struct WorklistManager {
 	Common::Array<reg_t> _worklist;
@@ -39,9 +38,7 @@
 		if (!reg.segment) // No numbers
 			return;
 
-	#ifdef DEBUG_GC_VERBOSE
-		sciprintf("[GC] Adding %04x:%04x\n", PRINT_REG(reg));
-	#endif
+		debugC(2, kDebugLevelGC, "[GC] Adding %04x:%04x\n", PRINT_REG(reg));
 
 		if (_map.contains(reg))
 			return; // already dealt with it
@@ -92,10 +89,9 @@
 		for (pos = s->stack_base; pos < xs.sp; pos++)
 			wm.push(*pos);
 	}
-#ifdef DEBUG_GC_VERBOSE
-	sciprintf("[GC] -- Finished adding value stack");
-#endif
 
+	debugC(2, kDebugLevelGC, "[GC] -- Finished adding value stack");
+
 	// Init: Execution Stack
 	Common::List<ExecStack>::iterator iter;
 	for (iter = s->_executionStack.begin();
@@ -109,10 +105,9 @@
 				wm.push(*(es.getVarPointer(s)));
 		}
 	}
-#ifdef DEBUG_GC_VERBOSE
-	sciprintf("[GC] -- Finished adding execution stack");
-#endif
 
+	debugC(2, kDebugLevelGC, "[GC] -- Finished adding execution stack");
+
 	// Init: Explicitly loaded scripts
 	for (i = 1; i < sm->_heap.size(); i++)
 		if (sm->_heap[i]
@@ -129,18 +124,15 @@
 				}
 			}
 		}
-#ifdef DEBUG_GC_VERBOSE
-	sciprintf("[GC] -- Finished explicitly loaded scripts, done with root set");
-#endif
 
+	debugC(2, kDebugLevelGC, "[GC] -- Finished explicitly loaded scripts, done with root set\n");
+
 	// 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
-#ifdef DEBUG_GC_VERBOSE
-			sciprintf("[GC] Checking %04x:%04x\n", PRINT_REG(reg));
-#endif
+			debugC(2, kDebugLevelGC, "[GC] Checking %04x:%04x\n", PRINT_REG(reg));
 			if (reg.segment < sm->_heap.size() && sm->_heap[reg.segment])
 				sm->_heap[reg.segment]->listAllOutgoingReferences(s, reg, &wm, add_outgoing_refs);
 		}
@@ -170,7 +162,7 @@
 		// Not found -> we can free it
 		deallocator->mobj->freeAtAddress(deallocator->segmgr, addr);
 #ifdef DEBUG_GC
-		sciprintf("[GC] Deallocating %04x:%04x\n", PRINT_REG(addr));
+		debugC(2, kDebugLevelGC, "[GC] Deallocating %04x:%04x\n", PRINT_REG(addr));
 		deallocator->segcount[deallocator->mobj->getType()]++;
 #endif
 	}
@@ -183,7 +175,7 @@
 	SegManager *sm = s->seg_manager;
 
 #ifdef DEBUG_GC
-	sciprintf("[GC] Running...\n");
+	debugC(2, kDebugLevelGC, "[GC] Running...\n");
 	memset(&(deallocator.segcount), 0, sizeof(int) * (MEM_OBJ_MAX + 1));
 #endif
 
@@ -205,10 +197,10 @@
 #ifdef DEBUG_GC
 	{
 		int i;
-		sciprintf("[GC] Summary:\n");
+		debugC(2, kDebugLevelGC, "[GC] Summary:\n");
 		for (i = 0; i <= MEM_OBJ_MAX; i++)
 			if (deallocator.segcount[i])
-				sciprintf("\t%d\t* %s\n", deallocator.segcount[i], deallocator.segnames[i]);
+				debugC(2, kDebugLevelGC, "\t%d\t* %s\n", deallocator.segcount[i], deallocator.segnames[i]);
 	}
 #endif
 }

Modified: scummvm/trunk/engines/sci/engine/grammar.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/grammar.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/grammar.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -51,51 +51,51 @@
 	int wspace = 0;
 
 	if (!rule) {
-		sciprintf("NULL rule");
+		warning("NULL rule");
 		return;
 	}
 
-	sciprintf("[%03x] -> ", rule->id);
+	printf("[%03x] -> ", rule->id);
 
 	if (!rule->length)
-		sciprintf("e");
+		printf("e");
 
 	for (i = 0; i < rule->length; i++) {
 		uint token = rule->data[i];
 
 		if (token == TOKEN_OPAREN) {
 			if (i == rule->first_special)
-				sciprintf("_");
+				printf("_");
 
-			sciprintf("(");
+			printf("(");
 			wspace = 0;
 		} else if (token == TOKEN_CPAREN) {
 			if (i == rule->first_special)
-				sciprintf("_");
+				printf("_");
 
-			sciprintf(")");
+			printf(")");
 			wspace = 0;
 		} else {
 			if (wspace)
-				sciprintf(" ");
+				printf(" ");
 
 			if (i == rule->first_special)
-				sciprintf("_");
+				printf("_");
 			if (token & TOKEN_TERMINAL_CLASS)
-				sciprintf("C(%04x)", token & 0xffff);
+				printf("C(%04x)", token & 0xffff);
 			else if (token & TOKEN_TERMINAL_GROUP)
-				sciprintf("G(%04x)", token & 0xffff);
+				printf("G(%04x)", token & 0xffff);
 			else if (token & TOKEN_STUFFING_WORD)
-				sciprintf("%03x", token & 0xffff);
+				printf("%03x", token & 0xffff);
 			else
-				sciprintf("[%03x]", token); /* non-terminal */
+				printf("[%03x]", token); /* non-terminal */
 			wspace = 1;
 		}
 
 		if (i == rule->first_special)
-			sciprintf("_");
+			printf("_");
 	}
-	sciprintf(" [%d specials]", rule->specials_nr);
+	printf(" [%d specials]", rule->specials_nr);
 }
 
 static void _vfree(parse_rule_t *rule) {
@@ -287,12 +287,12 @@
 
 static void _vprl(parse_rule_list_t *list, int pos) {
 	if (list) {
-		sciprintf("R%03d: ", pos);
+		printf("R%03d: ", pos);
 		vocab_print_rule(list->rule);
-		sciprintf("\n");
+		printf("\n");
 		_vprl(list->next, pos + 1);
 	} else {
-		sciprintf("%d rules total.\n", pos);
+		printf("%d rules total.\n", pos);
 	}
 }
 
@@ -466,9 +466,9 @@
 			else
 				writepos = _vbpt_append(nodes, pos, writepos, token & 0xffff);
 		} else {
-			sciprintf("\nError in parser (grammar.cpp, _vbpt_write_subexpression()): Rule data broken in rule ");
+			printf("\nError in parser (grammar.cpp, _vbpt_write_subexpression()): Rule data broken in rule ");
 			vocab_print_rule(rule);
-			sciprintf(", at token position %d\n", *pos);
+			printf(", at token position %d\n", *pos);
 			return rulepos;
 		}
 	}

Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -610,15 +610,15 @@
 				_kernelFuncs[functnr].signature = kfunct_mappers[found].signature;
 				kernel_compile_signature(&(_kernelFuncs[functnr].signature));
 				++mapped;
-			} else
+			} else {
+				//warning("Ignoring function %s\n", kfunct_mappers[found].name);
 				++ignored;
+			}
 		}
 	} // for all functions requesting to be mapped
 
-	sciprintf("Handled %d/%d kernel functions, mapping %d", mapped + ignored, getKernelNamesSize(), mapped);
-	if (ignored)
-		sciprintf(" and ignoring %d", ignored);
-	sciprintf(".\n");
+	debugC(2, kDebugLevelVM, "Handled %d/%d kernel functions, mapping %d and ignoring %d.\n", 
+				mapped + ignored, getKernelNamesSize(), mapped, ignored);
 
 	return;
 }
@@ -696,12 +696,12 @@
 			int type = determine_reg_type(s, *argv, *sig & KSIG_ALLOW_INV);
 
 			if (!type) {
-				sciprintf("[KERN] Could not determine type of ref %04x:%04x; failing signature check\n", PRINT_REG(*argv));
+				warning("[KERN] Could not determine type of ref %04x:%04x; failing signature check", PRINT_REG(*argv));
 				return false;
 			}
 
 			if (type & KSIG_INVALID) {
-				sciprintf("[KERN] ref %04x:%04x was determined to be a %s, but the reference itself is invalid\n",
+				warning("[KERN] ref %04x:%04x was determined to be a %s, but the reference itself is invalid",
 				          PRINT_REG(*argv), kernel_argtype_description(type));
 				return false;
 			}

Modified: scummvm/trunk/engines/sci/engine/kevent.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kevent.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/kevent.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -87,11 +87,11 @@
 
 	case SCI_EVT_KEYBOARD:
 		if ((e.buckybits & SCI_EVM_LSHIFT) && (e.buckybits & SCI_EVM_RSHIFT) && (e.data == '-')) {
-			sciprintf("Debug mode activated\n");
+			printf("Debug mode activated\n");
 			debugState.seeking = kDebugSeekNothing;
 			debugState.runningStep = 0;
 		} else if ((e.buckybits & SCI_EVM_CTRL) && (e.data == '`')) {
-			sciprintf("Debug mode activated\n");
+			printf("Debug mode activated\n");
 			debugState.seeking = kDebugSeekNothing;
 			debugState.runningStep = 0;
 		} else {

Modified: scummvm/trunk/engines/sci/engine/kfile.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kfile.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/kfile.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -334,7 +334,7 @@
 void delete_savegame(EngineState *s, int savedir_nr) {
 	Common::String filename = ((Sci::SciEngine*)g_engine)->getSavegameName(savedir_nr);
 
-	sciprintf("Deleting savegame '%s'\n", filename.c_str());
+	//printf("Deleting savegame '%s'\n", filename.c_str());
 
 	Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager();
 	saveFileMan->removeSavefile(filename);
@@ -664,14 +664,14 @@
 				shrink_execution_stack(s, s->execution_stack_base + 1);
 			} else {
 				s->r_acc = make_reg(0, 1);
-				sciprintf("Restoring failed (game_id = '%s').\n", game_id);
+				warning("Restoring failed (game_id = '%s')", game_id);
 			}
 			return s->r_acc;
 		}
 	}
 
 	s->r_acc = make_reg(0, 1);
-	sciprintf("Savegame #%d not found!\n", savedir_nr);
+	warning("Savegame #%d not found", savedir_nr);
 
 	return s->r_acc;
 }

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -417,7 +417,7 @@
 				s->visual->draw(Common::Point(0, 0));
 
 			gfxop_update(s->gfx_state);
-			sciprintf("Switching visible map to %x\n", s->pic_visible_map);
+			debugC(2, kDebugLevelGraphics, "Switching visible map to %x\n", s->pic_visible_map);
 		}
 		break;
 
@@ -439,14 +439,13 @@
 }
 
 void _k_redraw_box(EngineState *s, int x1, int y1, int x2, int y2) {
-	sciprintf("_k_redraw_box(): Unimplemented!\n");
+	warning("_k_redraw_box(): Unimplemented");
 #if 0
 	int i;
 	ViewObject *list = s->dyn_views;
 
-	sciprintf("Reanimating views\n", s->dyn_views_nr);
+	printf("Reanimating views\n", s->dyn_views_nr);
 
-
 	for (i = 0;i < s->dyn_views_nr;i++) {
 		*(list[i].underBitsp) = graph_save_box(s, list[i].nsLeft, list[i].nsTop, list[i].nsRight - list[i].nsLeft,
 												list[i].nsBottom - list[i].nsTop, SCI_MAP_VISUAL | SCI_MAP_PRIORITY);
@@ -2464,7 +2463,7 @@
 	while (id > 0 && (!s->visual->_portRefs[id] || (s->visual->_portRefs[id]->_flags & GFXW_FLAG_NO_IMPLICIT_SWITCH)))
 		id--;
 
-	sciprintf("Activating port %d after disposing window %d\n", id, goner_nr);
+	debugC(2, kDebugLevelGraphics, "Activating port %d after disposing window %d\n", id, goner_nr);
 	s->port = (id >= 0) ? s->visual->_portRefs[id] : 0;
 
 	if (!s->port)

Modified: scummvm/trunk/engines/sci/engine/kmisc.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmisc.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/kmisc.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -94,7 +94,7 @@
 }
 
 reg_t kSetDebug(EngineState *s, int funct_nr, int argc, reg_t *argv) {
-	sciprintf("Debug mode activated\n");
+	printf("Debug mode activated\n");
 
 	debugState.seeking = kDebugSeekNothing;
 	debugState.runningStep = 0;
@@ -238,14 +238,21 @@
 }
 
 reg_t kstub(EngineState *s, int funct_nr, int argc, reg_t *argv) {
-	sciprintf("Unimplemented syscall: %s[%x](", s->_kernel->getKernelName(funct_nr).c_str(), funct_nr);
+	char tmpbuf[200];
+	sprintf(tmpbuf, "Unimplemented syscall: %s[%x](", 
+					s->_kernel->getKernelName(funct_nr).c_str(), funct_nr);
 
 	for (int i = 0; i < argc; i++) {
-		sciprintf("%04x:%04x", PRINT_REG(argv[i]));
-		if (i + 1 < argc) sciprintf(", ");
+		char tmpbuf2[20];
+		sprintf(tmpbuf2, "%04x:%04x", PRINT_REG(argv[i]));
+		if (i + 1 < argc)
+			strcat(tmpbuf2, ", ");
+		strcat(tmpbuf, tmpbuf2);
 	}
-	sciprintf(")\n");
+	strcat(tmpbuf, ")\n");
 
+	warning(tmpbuf);
+
 	return NULL_REG;
 }
 

Modified: scummvm/trunk/engines/sci/engine/kmovement.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmovement.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/kmovement.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -275,7 +275,7 @@
 
 		buf = s->seg_manager->getScript(fptr.segment)->buf + fptr.offset;
 		handle_movecnt = (s->_version <= SCI_VERSION_0 || checksum_bytes(buf, 8) == 0x216) ? INCREMENT_MOVECNT : IGNORE_MOVECNT;
-		sciprintf("b-moveCnt action based on checksum: %s\n", handle_movecnt == IGNORE_MOVECNT ? "ignore" : "increment");
+		printf("b-moveCnt action based on checksum: %s\n", handle_movecnt == IGNORE_MOVECNT ? "ignore" : "increment");
 	} else {
 		warning("bresenham_autodetect failed");
 		handle_movecnt = INCREMENT_MOVECNT; // Most games do this, so best guess
@@ -313,7 +313,7 @@
 	bdelta = GET_SEL32SV(mover, b_incr);
 	axis = GET_SEL32SV(mover, b_xAxis);
 
-	//sciprintf("movecnt %d, move speed %d\n", movcnt, max_movcnt);
+	//printf("movecnt %d, move speed %d\n", movcnt, max_movcnt);
 
 	if (handle_movecnt) {
 		if (max_movcnt > movcnt) {

Modified: scummvm/trunk/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kpathing.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -410,24 +410,24 @@
 	int is_reg_t = polygon_is_reg_t(point_array, size);
 	Common::Point point;
 
-	sciprintf("%i:", type);
+	printf("%i:", type);
 
 	for (i = 0; i < size; i++) {
 		point = read_point(point_array, is_reg_t, i);
-		sciprintf(" (%i, %i)", point.x, point.y);
+		printf(" (%i, %i)", point.x, point.y);
 	}
 
 	point = read_point(point_array, is_reg_t, 0);
-	sciprintf(" (%i, %i);\n", point.x, point.y);
+	printf(" (%i, %i);\n", point.x, point.y);
 }
 
 static void print_input(EngineState *s, reg_t poly_list, Common::Point start, Common::Point end, int opt) {
 	List *list;
 	Node *node;
 
-	sciprintf("Start point: (%i, %i)\n", start.x, start.y);
-	sciprintf("End point: (%i, %i)\n", end.x, end.y);
-	sciprintf("Optimization level: %i\n", opt);
+	printf("Start point: (%i, %i)\n", start.x, start.y);
+	printf("End point: (%i, %i)\n", end.x, end.y);
+	printf("Optimization level: %i\n", opt);
 
 	if (!poly_list.segment)
 		return;
@@ -439,7 +439,7 @@
 		return;
 	}
 
-	sciprintf("Polygons:\n");
+	printf("Polygons:\n");
 	node = lookup_node(s, list->first);
 
 	while (node) {
@@ -1539,7 +1539,7 @@
 		}
 
 		if (min == HUGE_DISTANCE) {
-			sciprintf("[avoidpath] Warning: end point (%i, %i) is unreachable\n", s->vertex_end->v.x, s->vertex_end->v.y);
+			warning("[avoidpath] End point (%i, %i) is unreachable", s->vertex_end->v.x, s->vertex_end->v.y);
 			return;
 		}
 
@@ -1629,13 +1629,13 @@
 	POLY_SET_POINT(oref, offset, Common::Point(POLY_LAST_POINT, POLY_LAST_POINT));
 
 #ifdef DEBUG_AVOIDPATH
-	sciprintf("[avoidpath] Returning path:");
+	printf("[avoidpath] Returning path:");
 	for (int i = 0; i < offset; i++) {
 		Common::Point pt;
 		POLY_GET_POINT(oref, i, pt);
-		sciprintf(" (%i, %i)", pt.x, pt.y);
+		printf(" (%i, %i)", pt.x, pt.y);
 	}
-	sciprintf("\n");
+	printf("\n");
 #endif
 
 	return output;
@@ -1677,7 +1677,7 @@
 		PathfindingState *p;
 
 #ifdef DEBUG_AVOIDPATH
-		sciprintf("[avoidpath] Pathfinding input:\n");
+		printf("[avoidpath] Pathfinding input:\n");
 		draw_point(s, start, 1);
 		draw_point(s, end, 0);
 
@@ -1690,16 +1690,16 @@
 		p = convert_polygon_set(s, poly_list, start, end, opt);
 
 		if (p && intersecting_polygons(p)) {
-			sciprintf("[avoidpath] Error: input set contains (self-)intersecting polygons\n");
+			warning("[avoidpath] input set contains (self-)intersecting polygons");
 			delete p;
 			p = NULL;
 		}
 
 		if (!p) {
 			byte *oref;
-			sciprintf("[avoidpath] Error: pathfinding failed for following input:\n");
+			printf("[avoidpath] Error: pathfinding failed for following input:\n");
 			print_input(s, poly_list, start, end, opt);
-			sciprintf("[avoidpath] Returning direct path from start point to end point\n");
+			printf("[avoidpath] Returning direct path from start point to end point\n");
 			oref = s->seg_manager->allocDynmem(POLY_POINT_SIZE * 3,
 			                                   AVOIDPATH_DYNMEM_STRING, &output);
 
@@ -1720,8 +1720,7 @@
 	}
 
 	default:
-		warning("Unknown AvoidPath subfunction %d",
-		         argc);
+		warning("Unknown AvoidPath subfunction %d", argc);
 		return NULL_REG;
 		break;
 	}

Modified: scummvm/trunk/engines/sci/engine/ksound.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/ksound.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/ksound.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -194,7 +194,7 @@
 			break;
 
 		default:
-			sciprintf("Unexpected result from sfx_poll: %d\n", result);
+			warning("Unexpected result from sfx_poll: %d", result);
 			break;
 		}
 	}
@@ -215,63 +215,63 @@
 	debugC(2, kDebugLevelSound, "Command 0x%x", command);
 	switch (command) {
 	case 0:
-		sciprintf("[InitObj]");
+		debugC(2, kDebugLevelSound, "[InitObj]");
 		break;
 	case 1:
-		sciprintf("[Play]");
+		debugC(2, kDebugLevelSound, "[Play]");
 		break;
 	case 2:
-		sciprintf("[NOP]");
+		debugC(2, kDebugLevelSound, "[NOP]");
 		break;
 	case 3:
-		sciprintf("[DisposeHandle]");
+		debugC(2, kDebugLevelSound, "[DisposeHandle]");
 		break;
 	case 4:
-		sciprintf("[SetSoundOn(?)]");
+		debugC(2, kDebugLevelSound, "[SetSoundOn(?)]");
 		break;
 	case 5:
-		sciprintf("[Stop]");
+		debugC(2, kDebugLevelSound, "[Stop]");
 		break;
 	case 6:
-		sciprintf("[Suspend]");
+		debugC(2, kDebugLevelSound, "[Suspend]");
 		break;
 	case 7:
-		sciprintf("[Resume]");
+		debugC(2, kDebugLevelSound, "[Resume]");
 		break;
 	case 8:
-		sciprintf("[Get(Set?)Volume]");
+		debugC(2, kDebugLevelSound, "[Get(Set?)Volume]");
 		break;
 	case 9:
-		sciprintf("[Signal: Obj changed]");
+		debugC(2, kDebugLevelSound, "[Signal: Obj changed]");
 		break;
 	case 10:
-		sciprintf("[Fade(?)]");
+		debugC(2, kDebugLevelSound, "[Fade(?)]");
 		break;
 	case 11:
-		sciprintf("[ChkDriver]");
+		debugC(2, kDebugLevelSound, "[ChkDriver]");
 		break;
 	case 12:
-		sciprintf("[PlayNextSong (formerly StopAll)]");
+		debugC(2, kDebugLevelSound, "[PlayNextSong (formerly StopAll)]");
 		break;
 	default:
-		sciprintf("[unknown]");
+		debugC(2, kDebugLevelSound, "[unknown]");
 		break;
 	}
 
-	sciprintf("(");
+	debugC(2, kDebugLevelSound, "(");
 	for (i = 1; i < argc; i++) {
-		sciprintf("%04x:%04x", PRINT_REG(argv[i]));
+		debugC(2, kDebugLevelSound, "%04x:%04x", PRINT_REG(argv[i]));
 		if (i + 1 < argc)
-			sciprintf(", ");
+			debugC(2, kDebugLevelSound, ", ");
 	}
-	sciprintf(")\n");
+	debugC(2, kDebugLevelSound, ")\n");
 #endif	// DEBUG_SOUND
 
 
 	switch (command) {
 	case _K_SCI0_SOUND_INIT_HANDLE:
 		if (obj.segment) {
-			sciprintf("Initializing song number %d\n", GET_SEL32V(obj, number));
+			debugC(2, kDebugLevelSound, "Initializing song number %d\n", GET_SEL32V(obj, number));
 			s->_sound.sfx_add_song(build_iterator(s, number, SCI_SONG_ITERATOR_TYPE_SCI0,
 			                                               handle), 0, handle, number);
 
@@ -395,62 +395,62 @@
 		debugC(2, kDebugLevelSound, "Command 0x%x", command);
 		switch (command) {
 		case 0:
-			sciprintf("[MasterVolume]");
+			debugC(2, kDebugLevelSound, "[MasterVolume]");
 			break;
 		case 1:
-			sciprintf("[Mute]");
+			debugC(2, kDebugLevelSound, "[Mute]");
 			break;
 		case 2:
-			sciprintf("[NOP(2)]");
+			debugC(2, kDebugLevelSound, "[NOP(2)]");
 			break;
 		case 3:
-			sciprintf("[GetPolyphony]");
+			debugC(2, kDebugLevelSound, "[GetPolyphony]");
 			break;
 		case 4:
-			sciprintf("[Update]");
+			debugC(2, kDebugLevelSound, "[Update]");
 			break;
 		case 5:
-			sciprintf("[Init]");
+			debugC(2, kDebugLevelSound, "[Init]");
 			break;
 		case 6:
-			sciprintf("[Dispose]");
+			debugC(2, kDebugLevelSound, "[Dispose]");
 			break;
 		case 7:
-			sciprintf("[Play]");
+			debugC(2, kDebugLevelSound, "[Play]");
 			break;
 		case 8:
-			sciprintf("[Stop]");
+			debugC(2, kDebugLevelSound, "[Stop]");
 			break;
 		case 9:
-			sciprintf("[Suspend]");
+			debugC(2, kDebugLevelSound, "[Suspend]");
 			break;
 		case 10:
-			sciprintf("[Fade]");
+			debugC(2, kDebugLevelSound, "[Fade]");
 			break;
 		case 11:
-			sciprintf("[UpdateCues]");
+			debugC(2, kDebugLevelSound, "[UpdateCues]");
 			break;
 		case 12:
-			sciprintf("[MidiSend]");
+			debugC(2, kDebugLevelSound, "[MidiSend]");
 			break;
 		case 13:
-			sciprintf("[Reverb]");
+			debugC(2, kDebugLevelSound, "[Reverb]");
 			break;
 		case 14:
-			sciprintf("[Hold]");
+			debugC(2, kDebugLevelSound, "[Hold]");
 			break;
 		default:
-			sciprintf("[unknown]");
+			debugC(2, kDebugLevelSound, "[unknown]");
 			break;
 		}
 
-		sciprintf("(");
+		debugC(2, kDebugLevelSound, "(");
 		for (i = 1; i < argc; i++) {
-			sciprintf("%04x:%04x", PRINT_REG(argv[i]));
+			debugC(2, kDebugLevelSound, "%04x:%04x", PRINT_REG(argv[i]));
 			if (i + 1 < argc)
-				sciprintf(", ");
+				debugC(2, kDebugLevelSound, ", ");
 		}
-		sciprintf(")\n");
+		debugC(2, kDebugLevelSound, ")\n");
 	}
 #endif
 
@@ -504,7 +504,7 @@
 		//int pri = GET_SEL32V(obj, pri);
 
 		if (obj.segment && (s->resmgr->testResource(ResourceId(kResourceTypeSound, number)))) {
-			sciprintf("Initializing song number %d\n", number);
+			debugC(2, kDebugLevelSound, "Initializing song number %d\n", number);
 			s->_sound.sfx_add_song(build_iterator(s, number, SCI_SONG_ITERATOR_TYPE_SCI1,
 			                                      handle), 0, handle, number);
 			PUT_SEL32(obj, nodePtr, obj);
@@ -685,80 +685,80 @@
 		debugC(2, kDebugLevelSound, "Command 0x%x", command);
 		switch (command) {
 		case 0:
-			sciprintf("[MasterVolume]");
+			debugC(2, kDebugLevelSound, "[MasterVolume]");
 			break;
 		case 1:
-			sciprintf("[Mute]");
+			debugC(2, kDebugLevelSound, "[Mute]");
 			break;
 		case 2:
-			sciprintf("[NOP(2)]");
+			debugC(2, kDebugLevelSound, "[NOP(2)]");
 			break;
 		case 3:
-			sciprintf("[GetPolyphony]");
+			debugC(2, kDebugLevelSound, "[GetPolyphony]");
 			break;
 		case 4:
-			sciprintf("[GetAudioCapability]");
+			debugC(2, kDebugLevelSound, "[GetAudioCapability]");
 			break;
 		case 5:
-			sciprintf("[GlobalSuspend]");
+			debugC(2, kDebugLevelSound, "[GlobalSuspend]");
 			break;
 		case 6:
-			sciprintf("[Init]");
+			debugC(2, kDebugLevelSound, "[Init]");
 			break;
 		case 7:
-			sciprintf("[Dispose]");
+			debugC(2, kDebugLevelSound, "[Dispose]");
 			break;
 		case 8:
-			sciprintf("[Play]");
+			debugC(2, kDebugLevelSound, "[Play]");
 			break;
 		case 9:
-			sciprintf("[Stop]");
+			debugC(2, kDebugLevelSound, "[Stop]");
 			break;
 		case 10:
-			sciprintf("[SuspendHandle]");
+			debugC(2, kDebugLevelSound, "[SuspendHandle]");
 			break;
 		case 11:
-			sciprintf("[Fade]");
+			debugC(2, kDebugLevelSound, "[Fade]");
 			break;
 		case 12:
-			sciprintf("[Hold]");
+			debugC(2, kDebugLevelSound, "[Hold]");
 			break;
 		case 13:
-			sciprintf("[Unused(13)]");
+			debugC(2, kDebugLevelSound, "[Unused(13)]");
 			break;
 		case 14:
-			sciprintf("[SetVolume]");
+			debugC(2, kDebugLevelSound, "[SetVolume]");
 			break;
 		case 15:
-			sciprintf("[SetPriority]");
+			debugC(2, kDebugLevelSound, "[SetPriority]");
 			break;
 		case 16:
-			sciprintf("[SetLoop]");
+			debugC(2, kDebugLevelSound, "[SetLoop]");
 			break;
 		case 17:
-			sciprintf("[UpdateCues]");
+			debugC(2, kDebugLevelSound, "[UpdateCues]");
 			break;
 		case 18:
-			sciprintf("[MidiSend]");
+			debugC(2, kDebugLevelSound, "[MidiSend]");
 			break;
 		case 19:
-			sciprintf("[Reverb]");
+			debugC(2, kDebugLevelSound, "[Reverb]");
 			break;
 		case 20:
-			sciprintf("[UpdateVolPri]");
+			debugC(2, kDebugLevelSound, "[UpdateVolPri]");
 			break;
 		default:
-			sciprintf("[unknown]");
+			debugC(2, kDebugLevelSound, "[unknown]");
 			break;
 		}
 
-		sciprintf("(");
+		debugC(2, kDebugLevelSound, "(");
 		for (i = 1; i < argc; i++) {
-			sciprintf("%04x:%04x", PRINT_REG(argv[i]));
+			debugC(2, kDebugLevelSound, "%04x:%04x", PRINT_REG(argv[i]));
 			if (i + 1 < argc)
-				sciprintf(", ");
+				debugC(2, kDebugLevelSound, ", ");
 		}
-		sciprintf(")\n");
+		debugC(2, kDebugLevelSound, ")\n");
 	}
 #endif	// DEBUG_SOUND
 
@@ -808,11 +808,11 @@
 
 		if (!GET_SEL32V(obj, nodePtr) && obj.segment) {
 			if (!s->resmgr->testResource(ResourceId(kResourceTypeSound, number))) {
-				sciprintf("Could not open song number %d\n", number);
+				warning("Could not open song number %d", number);
 				return NULL_REG;
 			}
 
-			sciprintf("Initializing song number %d\n", number);
+			debugC(2, kDebugLevelSound, "Initializing song number %d\n", number);
 			s->_sound.sfx_add_song(build_iterator(s, number, SCI_SONG_ITERATOR_TYPE_SCI1,
 			                          handle), 0, handle, number);
 			PUT_SEL32(obj, nodePtr, obj);
@@ -838,7 +838,7 @@
 		}
 
 		if (obj.segment && (s->resmgr->testResource(ResourceId(kResourceTypeSound, number)))) {
-			sciprintf("Initializing song number %d\n", number);
+			debugC(2, kDebugLevelSound, "Initializing song number %d\n", number);
 			s->_sound.sfx_add_song(build_iterator(s, number, SCI_SONG_ITERATOR_TYPE_SCI1,
 			                                    handle), 0, handle, number);
 			PUT_SEL32(obj, nodePtr, obj);

Modified: scummvm/trunk/engines/sci/engine/kstring.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kstring.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/kstring.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -112,7 +112,7 @@
 	if (new_lastmatch  != SAID_NO_MATCH) { /* Build and possibly display a parse tree */
 
 #ifdef DEBUG_PARSER
-		sciprintf("Match.\n");
+		printf("kSaid: Match.\n");
 #endif
 
 		s->r_acc = make_reg(0, 1);
@@ -193,11 +193,6 @@
 
 	s->parser_event = event;
 
-	if (s->parser_valid == 2) {
-		sciprintf("Parsing skipped: Parser in simparse mode\n");
-		return s->r_acc;
-	}
-
 	bool res = s->_vocabulary->tokenizeString(words, string, &error);
 	s->parser_valid = 0; /* not valid */
 

Modified: scummvm/trunk/engines/sci/engine/memobj.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/memobj.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/memobj.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -159,7 +159,7 @@
 
 byte *Script::dereference(reg_t pointer, int *size) {
 	if (pointer.offset > buf_size) {
-		sciprintf("Error: Attempt to dereference invalid pointer %04x:%04x into script segment (script size=%d)\n",
+		warning("Attempt to dereference invalid pointer %04x:%04x into script segment (script size=%d)\n",
 				  PRINT_REG(pointer), (uint)buf_size);
 		return NULL;
 	}
@@ -231,9 +231,9 @@
 
 void Script::freeAtAddress(SegManager *segmgr, reg_t addr) {
 	/*
-		sciprintf("[GC] Freeing script %04x:%04x\n", PRINT_REG(addr));
+		debugC(2, kDebugLevelGC, "[GC] Freeing script %04x:%04x\n", PRINT_REG(addr));
 		if (locals_segment)
-			sciprintf("[GC] Freeing locals %04x:0000\n", locals_segment);
+			debugC(2, kDebugLevelGC, "[GC] Freeing locals %04x:0000\n", locals_segment);
 	*/
 
 	if (_markedAsDeleted)
@@ -289,7 +289,7 @@
 
 	// Note that this also includes the 'base' object, which is part of the script and therefore also emits the locals.
 	(*note)(param, clone->pos);
-	//sciprintf("[GC] Reporting clone-pos %04x:%04x\n", PRINT_REG(clone->pos));
+	//debugC(2, kDebugLevelGC, "[GC] Reporting clone-pos %04x:%04x\n", PRINT_REG(clone->pos));
 }
 
 void CloneTable::freeAtAddress(SegManager *segmgr, reg_t addr) {
@@ -302,15 +302,15 @@
 
 #ifdef GC_DEBUG
 	if (!(victim_obj->flags & OBJECT_FLAG_FREED))
-		sciprintf("[GC] Warning: Clone %04x:%04x not reachable and not freed (freeing now)\n", PRINT_REG(addr));
+		warning("[GC] Clone %04x:%04x not reachable and not freed (freeing now)", PRINT_REG(addr));
 #ifdef GC_DEBUG_VERBOSE
 	else
-		sciprintf("[GC-DEBUG] Clone %04x:%04x: Freeing\n", PRINT_REG(addr));
+		warning("[GC-DEBUG] Clone %04x:%04x: Freeing", PRINT_REG(addr));
 #endif
 #endif
 	/*
-		sciprintf("[GC] Clone %04x:%04x: Freeing\n", PRINT_REG(addr));
-		sciprintf("[GC] Clone had pos %04x:%04x\n", PRINT_REG(victim_obj->pos));
+		warning("[GC] Clone %04x:%04x: Freeing", PRINT_REG(addr));
+		warning("[GC] Clone had pos %04x:%04x", PRINT_REG(victim_obj->pos));
 	*/
 	clone_table->freeEntry(addr.offset);
 }

Modified: scummvm/trunk/engines/sci/engine/said.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/said.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/said.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -172,9 +172,10 @@
 
 
 #ifdef SCI_DEBUG_PARSE_TREE_AUGMENTATION
-#define scidprintf sciprintf
+#define scidprintf printf
 #else
-#define scidprintf if (0) sciprintf
+void print_nothing(...) { }
+#define scidprintf print_nothing
 #endif
 
 
@@ -2027,23 +2028,23 @@
 	if (nextitem == SAID_TERM)
 		yyparse();
 	else {
-		sciprintf("Error: SAID spec is too long\n");
+		warning("SAID spec is too long");
 		return 1;
 	}
 
 	if (said_parse_error) {
-		sciprintf("Error while parsing SAID spec: %s\n", said_parse_error);
+		warning("Error while parsing SAID spec: %s", said_parse_error);
 		free(said_parse_error);
 		return 1;
 	}
 
 	if (said_tree_pos == 0) {
-		sciprintf("Error: Out of tree space while parsing SAID spec\n");
+		warning("Out of tree space while parsing SAID spec");
 		return 1;
 	}
 
 	if (said_blessed != 1) {
-		sciprintf("Error: Found multiple top branches\n");
+		warning("Found multiple top branches");
 		return 1;
 	}
 
@@ -2146,7 +2147,7 @@
 		if ((word = aug_get_wgroup(tree, pos))) { // found a word
 			if (!refbranch && major == WORD_TYPE_BASE) {
 				if ((*base_words_nr) == maxwords) {
-					sciprintf("Out of regular words\n");
+					warning("Out of regular words");
 					return; // return gracefully
 				}
 
@@ -2156,7 +2157,7 @@
 			}
 			if (major == WORD_TYPE_REF || refbranch) {
 				if ((*ref_words_nr) == maxwords) {
-					sciprintf("Out of reference words\n");
+					warning("Out of reference words");
 					return; // return gracefully
 				}
 
@@ -2165,7 +2166,7 @@
 
 			}
 			if (major != WORD_TYPE_SYNTACTIC_SUGAR && major != WORD_TYPE_BASE && major != WORD_TYPE_REF)
-				sciprintf("aug_find_words_recursively(): Unknown word type %03x\n", major);
+				warning("aug_find_words_recursively(): Unknown word type %03x", major);
 
 		} else // Did NOT find a word group: Attempt to recurse
 			aug_find_words_recursively(tree, pos, base_words, base_words_nr,
@@ -2210,7 +2211,7 @@
 	int cmajor, cminor, cpos;
 	cpos = aug_get_first_child(saidt, augment_pos, &cmajor, &cminor);
 	if (!cpos) {
-		sciprintf("augment_match_expression_p(): Empty condition\n");
+		warning("augment_match_expression_p(): Empty condition");
 		return 1;
 	}
 
@@ -2246,7 +2247,7 @@
 					gchild = aug_get_next_sibling(saidt, gchild, &gc_major, &gc_minor);
 				}
 			} else
-				sciprintf("augment_match_expression_p(): Unknown type 141 minor number %3x\n", cminor);
+				warning("augment_match_expression_p(): Unknown type 141 minor number %3x", cminor);
 
 			cpos = aug_get_next_sibling(saidt, cpos, &cmajor, &cminor);
 
@@ -2277,7 +2278,7 @@
 					gchild = aug_get_next_sibling(saidt, gchild, &gc_major, &gc_minor);
 				}
 			} else
-				sciprintf("augment_match_expression_p(): Unknown type 144 minor number %3x\n", cminor);
+				warning("augment_match_expression_p(): Unknown type 144 minor number %3x", cminor);
 
 			cpos = aug_get_next_sibling(saidt, cpos, &cmajor, &cminor);
 
@@ -2303,17 +2304,17 @@
 			break;
 
 		default:
-			sciprintf("augment_match_expression_p(): (subp1) Unkonwn sub-bracket predicate %03x\n", cmajor);
+			warning("augment_match_expression_p(): (subp1) Unkonwn sub-bracket predicate %03x", cmajor);
 		}
 
 		break;
 
 	default:
-		sciprintf("augment_match_expression_p(): Unknown predicate %03x\n", major);
+		warning("augment_match_expression_p(): Unknown predicate %03x", major);
 
 	}
 
-	scidprintf("Generic failure\n");
+	warning("augment_match_expression_p(): Generic failure");
 
 	return 0;
 }
@@ -2371,13 +2372,13 @@
 			aug_find_words(parset, parse_branch, base_words, &base_words_nr, ref_words, &ref_words_nr, AUGMENT_MAX_WORDS);
 			foundwords |= (ref_words_nr | base_words_nr);
 #ifdef SCI_DEBUG_PARSE_TREE_AUGMENTATION
-			sciprintf("%d base words:", base_words_nr);
+			printf("%d base words:", base_words_nr);
 			for (i = 0; i < base_words_nr; i++)
-				sciprintf(" %03x", base_words[i]);
-			sciprintf("\n%d reference words:", ref_words_nr);
+				printf(" %03x", base_words[i]);
+			printf("\n%d reference words:", ref_words_nr);
 			for (i = 0; i < ref_words_nr; i++)
-				sciprintf(" %03x", ref_words[i]);
-			sciprintf("\n");
+				printf(" %03x", ref_words[i]);
+			printf("\n");
 #endif
 
 			success = augment_sentence_expression(saidt, augment_pos, parset, parse_basepos, major, minor,
@@ -2407,13 +2408,13 @@
 
 	parse_basepos = aug_get_base_node(parset);
 	if (!parse_basepos) {
-		sciprintf("augment_parse_nodes(): Parse tree is corrupt\n");
+		warning("augment_parse_nodes(): Parse tree is corrupt");
 		return 0;
 	}
 
 	augment_basepos = aug_get_base_node(saidt);
 	if (!augment_basepos) {
-		sciprintf("augment_parse_nodes(): Said tree is corrupt\n");
+		warning("augment_parse_nodes(): Said tree is corrupt");
 		return 0;
 	}
 
@@ -2447,7 +2448,7 @@
 
 	if (s->parser_valid) {
 		if (said_parse_spec(s, spec)) {
-			sciprintf("Offending spec was: ");
+			printf("Offending spec was: ");
 			s->_vocabulary->decipherSaidBlock(spec);
 			return SAID_NO_MATCH;
 		}

Modified: scummvm/trunk/engines/sci/engine/said.y
===================================================================
--- scummvm/trunk/engines/sci/engine/said.y	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/said.y	2009-07-06 10:39:22 UTC (rev 42167)
@@ -65,9 +65,10 @@
 
 
 #ifdef SCI_DEBUG_PARSE_TREE_AUGMENTATION
-#define scidprintf sciprintf
+#define scidprintf printf
 #else
-#define scidprintf if (0) sciprintf
+void print_nothing(...) { }
+#define scidprintf print_nothing
 #endif
 
 
@@ -383,23 +384,23 @@
 	if (nextitem == SAID_TERM)
 		yyparse();
 	else {
-		sciprintf("Error: SAID spec is too long\n");
+		warning("SAID spec is too long");
 		return 1;
 	}
 
 	if (said_parse_error) {
-		sciprintf("Error while parsing SAID spec: %s\n", said_parse_error);
+		warning("Error while parsing SAID spec: %s", said_parse_error);
 		free(said_parse_error);
 		return 1;
 	}
 
 	if (said_tree_pos == 0) {
-		sciprintf("Error: Out of tree space while parsing SAID spec\n");
+		warning("Out of tree space while parsing SAID spec");
 		return 1;
 	}
 
 	if (said_blessed != 1) {
-		sciprintf("Error: Found multiple top branches\n");
+		warning("Found multiple top branches");
 		return 1;
 	}
 
@@ -502,7 +503,7 @@
 		if ((word = aug_get_wgroup(tree, pos))) { // found a word
 			if (!refbranch && major == WORD_TYPE_BASE) {
 				if ((*base_words_nr) == maxwords) {
-					sciprintf("Out of regular words\n");
+					warning("Out of regular words");
 					return; // return gracefully
 				}
 
@@ -512,7 +513,7 @@
 			}
 			if (major == WORD_TYPE_REF || refbranch) {
 				if ((*ref_words_nr) == maxwords) {
-					sciprintf("Out of reference words\n");
+					warning("Out of reference words");
 					return; // return gracefully
 				}
 
@@ -521,7 +522,7 @@
 
 			}
 			if (major != WORD_TYPE_SYNTACTIC_SUGAR && major != WORD_TYPE_BASE && major != WORD_TYPE_REF)
-				sciprintf("aug_find_words_recursively(): Unknown word type %03x\n", major);
+				warning("aug_find_words_recursively(): Unknown word type %03x", major);
 
 		} else // Did NOT find a word group: Attempt to recurse
 			aug_find_words_recursively(tree, pos, base_words, base_words_nr,
@@ -566,7 +567,7 @@
 	int cmajor, cminor, cpos;
 	cpos = aug_get_first_child(saidt, augment_pos, &cmajor, &cminor);
 	if (!cpos) {
-		sciprintf("augment_match_expression_p(): Empty condition\n");
+		warning("augment_match_expression_p(): Empty condition");
 		return 1;
 	}
 
@@ -602,7 +603,7 @@
 					gchild = aug_get_next_sibling(saidt, gchild, &gc_major, &gc_minor);
 				}
 			} else
-				sciprintf("augment_match_expression_p(): Unknown type 141 minor number %3x\n", cminor);
+				warning("augment_match_expression_p(): Unknown type 141 minor number %3x", cminor);
 
 			cpos = aug_get_next_sibling(saidt, cpos, &cmajor, &cminor);
 
@@ -633,7 +634,7 @@
 					gchild = aug_get_next_sibling(saidt, gchild, &gc_major, &gc_minor);
 				}
 			} else
-				sciprintf("augment_match_expression_p(): Unknown type 144 minor number %3x\n", cminor);
+				warning("augment_match_expression_p(): Unknown type 144 minor number %3x", cminor);
 
 			cpos = aug_get_next_sibling(saidt, cpos, &cmajor, &cminor);
 
@@ -659,13 +660,13 @@
 			break;
 
 		default:
-			sciprintf("augment_match_expression_p(): (subp1) Unkonwn sub-bracket predicate %03x\n", cmajor);
+			warning("augment_match_expression_p(): (subp1) Unkonwn sub-bracket predicate %03x", cmajor);
 		}
 
 		break;
 
 	default:
-		sciprintf("augment_match_expression_p(): Unknown predicate %03x\n", major);
+		warning("augment_match_expression_p(): Unknown predicate %03x", major);
 
 	}
 
@@ -727,13 +728,13 @@
 			aug_find_words(parset, parse_branch, base_words, &base_words_nr, ref_words, &ref_words_nr, AUGMENT_MAX_WORDS);
 			foundwords |= (ref_words_nr | base_words_nr);
 #ifdef SCI_DEBUG_PARSE_TREE_AUGMENTATION
-			sciprintf("%d base words:", base_words_nr);
+			printf("%d base words:", base_words_nr);
 			for (i = 0; i < base_words_nr; i++)
-				sciprintf(" %03x", base_words[i]);
-			sciprintf("\n%d reference words:", ref_words_nr);
+				printf(" %03x", base_words[i]);
+			printf("\n%d reference words:", ref_words_nr);
 			for (i = 0; i < ref_words_nr; i++)
-				sciprintf(" %03x", ref_words[i]);
-			sciprintf("\n");
+				printf(" %03x", ref_words[i]);
+			printf("\n");
 #endif
 
 			success = augment_sentence_expression(saidt, augment_pos, parset, parse_basepos, major, minor,
@@ -763,13 +764,13 @@
 
 	parse_basepos = aug_get_base_node(parset);
 	if (!parse_basepos) {
-		sciprintf("augment_parse_nodes(): Parse tree is corrupt\n");
+		warning("augment_parse_nodes(): Parse tree is corrupt");
 		return 0;
 	}
 
 	augment_basepos = aug_get_base_node(saidt);
 	if (!augment_basepos) {
-		sciprintf("augment_parse_nodes(): Said tree is corrupt\n");
+		warning("augment_parse_nodes(): Said tree is corrupt");
 		return 0;
 	}
 
@@ -803,7 +804,7 @@
 
 	if (s->parser_valid) {
 		if (said_parse_spec(s, spec)) {
-			sciprintf("Offending spec was: ");
+			warning("Offending spec was: ");
 			s->_vocabulary->decypherSaidBlock(spec);
 			return SAID_NO_MATCH;
 		}

Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -464,15 +464,15 @@
 	meta.savegame_time = ((curTime.tm_hour & 0xFF) << 16) | (((curTime.tm_min) & 0xFF) << 8) | ((curTime.tm_sec) & 0xFF);
 
 	if (s->execution_stack_base) {
-		sciprintf("Cannot save from below kernel function\n");
+		warning("Cannot save from below kernel function");
 		return 1;
 	}
 
 /*
 	if (s->sound_server) {
 		if ((s->sound_server->save)(s, dirname)) {
-			sciprintf("Saving failed for the sound subsystem\n");
-			chdir("..");
+			warning("Saving failed for the sound subsystem");
+			//chdir("..");
 			return 1;
 		}
 	}
@@ -616,7 +616,7 @@
 						base_obj = obj_get(s, scr->_objects[j]._variables[SCRIPT_SPECIES_SELECTOR]);
 
 						if (!base_obj) {
-							sciprintf("Object without a base class: Script %d, index %d (reg address %04x:%04x\n",
+							warning("Object without a base class: Script %d, index %d (reg address %04x:%04x",
 								  scr->nr, j, PRINT_REG(scr->_objects[j]._variables[SCRIPT_SPECIES_SELECTOR]));
 							continue;
 						}
@@ -646,18 +646,18 @@
 				CloneTable *ct = (CloneTable *)mobj;
 
 				/*
-				sciprintf("Free list: ");
+				printf("Free list: ");
 				for (uint j = ct->first_free; j != HEAPENTRY_INVALID; j = ct->_table[j].next_free) {
-					sciprintf("%d ", j);
+					printf("%d ", j);
 				}
-				sciprintf("\n");
+				printf("\n");
 
-				sciprintf("Entries w/zero vars: ");
+				printf("Entries w/zero vars: ");
 				for (uint j = 0; j < ct->_table.size(); j++) {
 					if (ct->_table[j].variables == NULL)
-						sciprintf("%d ", j);
+						printf("%d ", j);
 				}
-				sciprintf("\n");
+				printf("\n");
 				*/
 
 				for (uint j = 0; j < ct->_table.size(); j++) {
@@ -669,7 +669,7 @@
 					CloneTable::Entry &seeker = ct->_table[j];
 					base_obj = obj_get(s, seeker._variables[SCRIPT_SPECIES_SELECTOR]);
 					if (!base_obj) {
-						sciprintf("Clone entry without a base class: %d\n", j);
+						printf("Clone entry without a base class: %d\n", j);
 						seeker.base = seeker.base_obj = NULL;
 						seeker.base_vars = seeker.base_method = NULL;
 					} else {
@@ -729,7 +729,7 @@
 /*
 	if (s->sound_server) {
 		if ((s->sound_server->restore)(s, dirname)) {
-			sciprintf("Restoring failed for the sound subsystem\n");
+			warning("Restoring failed for the sound subsystem");
 			return NULL;
 		}
 	}
@@ -746,9 +746,9 @@
 	if ((meta.savegame_version < MINIMUM_SAVEGAME_VERSION) ||
 	    (meta.savegame_version > CURRENT_SAVEGAME_VERSION)) {
 		if (meta.savegame_version < MINIMUM_SAVEGAME_VERSION)
-			sciprintf("Old savegame version detected- can't load\n");
+			warning("Old savegame version detected- can't load");
 		else
-			sciprintf("Savegame version is %d- maximum supported is %0d\n", meta.savegame_version, CURRENT_SAVEGAME_VERSION);
+			warning("Savegame version is %d- maximum supported is %0d", meta.savegame_version, CURRENT_SAVEGAME_VERSION);
 
 		return NULL;
 	}
@@ -864,9 +864,9 @@
 	if ((meta->savegame_version < MINIMUM_SAVEGAME_VERSION) ||
 	    (meta->savegame_version > CURRENT_SAVEGAME_VERSION)) {
 		if (meta->savegame_version < MINIMUM_SAVEGAME_VERSION)
-			sciprintf("Old savegame version detected- can't load\n");
+			warning("Old savegame version detected- can't load");
 		else
-			sciprintf("Savegame version is %d- maximum supported is %0d\n", meta->savegame_version, CURRENT_SAVEGAME_VERSION);
+			warning("Savegame version is %d- maximum supported is %0d", meta->savegame_version, CURRENT_SAVEGAME_VERSION);
 
 		return false;
 	}

Modified: scummvm/trunk/engines/sci/engine/script.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/script.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/script.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -103,7 +103,7 @@
 		g_opcode_formats[op_lofss][0] = Script_Offset;
 		break;
 	default:
-		sciprintf("script_adjust_opcode_formats(): Unknown script version %d\n", res_version);
+		error("script_adjust_opcode_formats(): Unknown script version %d\n", res_version);
 	}
 }
 
@@ -215,28 +215,27 @@
 	int namepos = (int16)READ_LE_UINT16((unsigned char *) data + 14 + seeker);
 	int i = 0;
 
-	sciprintf("Object\n");
+	printf("Object\n");
 
 	Common::hexdump((unsigned char *) data + seeker, objsize - 4, 16, seeker);
 	//-4 because the size includes the two-word header
 
-	sciprintf("Name: %s\n", namepos ? ((char *)(data + namepos)) : "<unknown>");
-	sciprintf("Superclass: %x\n", superclass);
-	sciprintf("Species: %x\n", species);
-	sciprintf("-info-:%x\n", (int16)READ_LE_UINT16((unsigned char *) data + 12 + seeker) & 0xffff);
+	printf("Name: %s\n", namepos ? ((char *)(data + namepos)) : "<unknown>");
+	printf("Superclass: %x\n", superclass);
+	printf("Species: %x\n", species);
+	printf("-info-:%x\n", (int16)READ_LE_UINT16((unsigned char *) data + 12 + seeker) & 0xffff);
 
-	sciprintf("Function area offset: %x\n", (int16)READ_LE_UINT16((unsigned char *) data + seeker + 4));
-	sciprintf("Selectors [%x]:\n", selectors = (selectorsize = (int16)READ_LE_UINT16((unsigned char *) data + seeker + 6)));
+	printf("Function area offset: %x\n", (int16)READ_LE_UINT16((unsigned char *) data + seeker + 4));
+	printf("Selectors [%x]:\n", selectors = (selectorsize = (int16)READ_LE_UINT16((unsigned char *) data + seeker + 6)));
 
 	seeker += 8;
 
 	while (selectors--) {
-		sciprintf("  [#%03x] = 0x%x\n", i++, (int16)READ_LE_UINT16((unsigned char *)data + seeker) & 0xffff);
-
+		printf("  [#%03x] = 0x%x\n", i++, (int16)READ_LE_UINT16((unsigned char *)data + seeker) & 0xffff);
 		seeker += 2;
 	}
 
-	sciprintf("Overridden functions: %x\n", selectors = overloads = (int16)READ_LE_UINT16((unsigned char *)data + seeker));
+	printf("Overridden functions: %x\n", selectors = overloads = (int16)READ_LE_UINT16((unsigned char *)data + seeker));
 
 	seeker += 2;
 
@@ -244,8 +243,8 @@
 		while (overloads--) {
 			int selector = (int16)READ_LE_UINT16((unsigned char *) data + (seeker));
 
-			sciprintf("  [%03x] %s: @", selector & 0xffff, (selector >= 0 && selector < (int)_selectorNames.size()) ? _selectorNames[selector].c_str() : "<?>");
-			sciprintf("%04x\n", (int16)READ_LE_UINT16((unsigned char *)data + seeker + selectors*2 + 2) & 0xffff);
+			printf("  [%03x] %s: @", selector & 0xffff, (selector >= 0 && selector < (int)_selectorNames.size()) ? _selectorNames[selector].c_str() : "<?>");
+			printf("%04x\n", (int16)READ_LE_UINT16((unsigned char *)data + seeker + selectors*2 + 2) & 0xffff);
 
 			seeker += 2;
 		}
@@ -257,17 +256,17 @@
 	int superclass = (int16)READ_LE_UINT16((unsigned char *) data + 10 + seeker);
 	int namepos = (int16)READ_LE_UINT16((unsigned char *) data + 14 + seeker);
 
-	sciprintf("Class\n");
+	printf("Class\n");
 
 	Common::hexdump((unsigned char *) data + seeker, objsize - 4, 16, seeker);
 
-	sciprintf("Name: %s\n", namepos ? ((char *)data + namepos) : "<unknown>");
-	sciprintf("Superclass: %x\n", superclass);
-	sciprintf("Species: %x\n", species);
-	sciprintf("-info-:%x\n", (int16)READ_LE_UINT16((unsigned char *)data + 12 + seeker) & 0xffff);
+	printf("Name: %s\n", namepos ? ((char *)data + namepos) : "<unknown>");
+	printf("Superclass: %x\n", superclass);
+	printf("Species: %x\n", species);
+	printf("-info-:%x\n", (int16)READ_LE_UINT16((unsigned char *)data + 12 + seeker) & 0xffff);
 
-	sciprintf("Function area offset: %x\n", (int16)READ_LE_UINT16((unsigned char *)data + seeker + 4));
-	sciprintf("Selectors [%x]:\n", selectors = (selectorsize = (int16)READ_LE_UINT16((unsigned char *)data + seeker + 6)));
+	printf("Function area offset: %x\n", (int16)READ_LE_UINT16((unsigned char *)data + seeker + 4));
+	printf("Selectors [%x]:\n", selectors = (selectorsize = (int16)READ_LE_UINT16((unsigned char *)data + seeker + 6)));
 
 	seeker += 8;
 	selectorsize <<= 1;
@@ -275,7 +274,7 @@
 	while (selectors--) {
 		int selector = (int16)READ_LE_UINT16((unsigned char *) data + (seeker) + selectorsize);
 
-		sciprintf("  [%03x] %s = 0x%x\n", 0xffff & selector, (selector >= 0 && selector < (int)_selectorNames.size()) ? _selectorNames[selector].c_str() : "<?>",
+		printf("  [%03x] %s = 0x%x\n", 0xffff & selector, (selector >= 0 && selector < (int)_selectorNames.size()) ? _selectorNames[selector].c_str() : "<?>",
 		          (int16)READ_LE_UINT16((unsigned char *)data + seeker) & 0xffff);
 
 		seeker += 2;
@@ -283,16 +282,16 @@
 
 	seeker += selectorsize;
 
-	sciprintf("Overloaded functions: %x\n", selectors = overloads = (int16)READ_LE_UINT16((unsigned char *)data + seeker));
+	printf("Overloaded functions: %x\n", selectors = overloads = (int16)READ_LE_UINT16((unsigned char *)data + seeker));
 
 	seeker += 2;
 
 	while (overloads--) {
 		int selector = (int16)READ_LE_UINT16((unsigned char *)data + (seeker));
 		fprintf(stderr, "selector=%d; selectorNames.size() =%d\n", selector, _selectorNames.size());
-		sciprintf("  [%03x] %s: @", selector & 0xffff, (selector >= 0 && selector < (int)_selectorNames.size()) ?
+		printf("  [%03x] %s: @", selector & 0xffff, (selector >= 0 && selector < (int)_selectorNames.size()) ?
 		          _selectorNames[selector].c_str() : "<?>");
-		sciprintf("%04x\n", (int16)READ_LE_UINT16((unsigned char *)data + seeker + selectors * 2 + 2) & 0xffff);
+		printf("%04x\n", (int16)READ_LE_UINT16((unsigned char *)data + seeker + selectors * 2 + 2) & 0xffff);
 
 		seeker += 2;
 	}
@@ -304,7 +303,7 @@
 	Resource *script = _resmgr->findResource(ResourceId(kResourceTypeScript, scriptNumber), 0);
 
 	if (!script) {
-		sciprintf("Script not found!\n");
+		warning("dissectScript(): Script not found!\n");
 		return;
 	}
 
@@ -314,17 +313,17 @@
 		unsigned int seeker = _seeker + 4;
 
 		if (!objtype) {
-			sciprintf("End of script object (#0) encountered.\n");
-			sciprintf("Classes: %i, Objects: %i, Export: %i,\n Var: %i (all base 10)",
+			printf("End of script object (#0) encountered.\n");
+			printf("Classes: %i, Objects: %i, Export: %i,\n Var: %i (all base 10)",
 			          objectctr[6], objectctr[1], objectctr[7], objectctr[10]);
 			return;
 		}
 
-		sciprintf("\n");
+		printf("\n");
 
 		objsize = (int16)READ_LE_UINT16(script->data + _seeker + 2);
 
-		sciprintf("Obj type #%x, size 0x%x: ", objtype, objsize);
+		printf("Obj type #%x, size 0x%x: ", objtype, objsize);
 
 		_seeker += objsize;
 
@@ -336,72 +335,72 @@
 			break;
 
 		case SCI_OBJ_CODE: {
-			sciprintf("Code\n");
+			printf("Code\n");
 			Common::hexdump(script->data + seeker, objsize - 4, 16, seeker);
 		};
 		break;
 
 		case 3: {
-			sciprintf("<unknown>\n");
+			printf("<unknown>\n");
 			Common::hexdump(script->data + seeker, objsize - 4, 16, seeker);
 		};
 		break;
 
 		case SCI_OBJ_SAID: {
-			sciprintf("Said\n");
+			printf("Said\n");
 			Common::hexdump(script->data + seeker, objsize - 4, 16, seeker);
 
-			sciprintf("%04x: ", seeker);
+			printf("%04x: ", seeker);
 			while (seeker < _seeker) {
 				unsigned char nextitem = script->data [seeker++];
 				if (nextitem == 0xFF)
-					sciprintf("\n%04x: ", seeker);
+					printf("\n%04x: ", seeker);
 				else if (nextitem >= 0xF0) {
 					switch (nextitem) {
 					case 0xf0:
-						sciprintf(", ");
+						printf(", ");
 						break;
 					case 0xf1:
-						sciprintf("& ");
+						printf("& ");
 						break;
 					case 0xf2:
-						sciprintf("/ ");
+						printf("/ ");
 						break;
 					case 0xf3:
-						sciprintf("( ");
+						printf("( ");
 						break;
 					case 0xf4:
-						sciprintf(") ");
+						printf(") ");
 						break;
 					case 0xf5:
-						sciprintf("[ ");
+						printf("[ ");
 						break;
 					case 0xf6:
-						sciprintf("] ");
+						printf("] ");
 						break;
 					case 0xf7:
-						sciprintf("# ");
+						printf("# ");
 						break;
 					case 0xf8:
-						sciprintf("< ");
+						printf("< ");
 						break;
 					case 0xf9:
-						sciprintf("> ");
+						printf("> ");
 						break;
 					}
 				} else {
 					nextitem = nextitem << 8 | script->data [seeker++];
-					sciprintf("%s[%03x] ", vocab->getAnyWordFromGroup(nextitem), nextitem);
+					printf("%s[%03x] ", vocab->getAnyWordFromGroup(nextitem), nextitem);
 				}
 			}
-			sciprintf("\n");
+			printf("\n");
 		}
 		break;
 
 		case SCI_OBJ_STRINGS: {
-			sciprintf("Strings\n");
+			printf("Strings\n");
 			while (script->data [seeker]) {
-				sciprintf("%04x: %s\n", seeker, script->data + seeker);
+				printf("%04x: %s\n", seeker, script->data + seeker);
 				seeker += strlen((char *)script->data + seeker) + 1;
 			}
 			seeker++; // the ending zero byte
@@ -413,37 +412,37 @@
 			break;
 
 		case SCI_OBJ_EXPORTS: {
-			sciprintf("Exports\n");
+			printf("Exports\n");
 			Common::hexdump((unsigned char *)script->data + seeker, objsize - 4, 16, seeker);
 		};
 		break;
 
 		case SCI_OBJ_POINTERS: {
-			sciprintf("Pointers\n");
+			printf("Pointers\n");
 			Common::hexdump(script->data + seeker, objsize - 4, 16, seeker);
 		};
 		break;
 
 		case 9: {
-			sciprintf("<unknown>\n");
+			printf("<unknown>\n");
 			Common::hexdump(script->data + seeker, objsize - 4, 16, seeker);
 		};
 		break;
 
 		case SCI_OBJ_LOCALVARS: {
-			sciprintf("Local vars\n");
+			printf("Local vars\n");
 			Common::hexdump(script->data + seeker, objsize - 4, 16, seeker);
 		};
 		break;
 
 		default:
-			sciprintf("Unsupported!\n");
+			printf("Unsupported!\n");
 			return;
 		}
 
 	}
 
-	sciprintf("Script ends without terminator\n");
+	printf("Script ends without terminator\n");
 }
 
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/engine/scriptdebug.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -42,7 +42,7 @@
 	int selectors;
 
 	if (!obj) {
-		sciprintf("Applied propertyOffsetToId on non-object at %04x:%04x\n", PRINT_REG(objp));
+		warning("Applied propertyOffsetToId on non-object at %04x:%04x", PRINT_REG(objp));
 		return -1;
 	}
 
@@ -59,7 +59,7 @@
 	}
 
 	if (prop_ofs < 0 || (prop_ofs >> 1) >= selectors) {
-		sciprintf("Applied propertyOffsetToId to invalid property offset %x (property #%d not in [0..%d]) on object at %04x:%04x\n",
+		warning("Applied propertyOffsetToId to invalid property offset %x (property #%d not in [0..%d]) on object at %04x:%04x",
 		          prop_ofs, prop_ofs >> 1, selectors - 1, PRINT_REG(objp));
 		return -1;
 	}
@@ -81,7 +81,7 @@
 	int i = 0;
 
 	if (!mobj) {
-		sciprintf("Disassembly failed: Segment %04x non-existant or not a script\n", pos.segment);
+		warning("Disassembly failed: Segment %04x non-existant or not a script", pos.segment);
 		return retval;
 	} else
 		script_entity = (Script *)mobj;
@@ -90,7 +90,7 @@
 	scr_size = script_entity->buf_size;
 
 	if (pos.offset >= scr_size) {
-		sciprintf("Trying to disassemble beyond end of script\n");
+		warning("Trying to disassemble beyond end of script");
 		return pos;
 	}
 
@@ -98,13 +98,13 @@
 	opcode = opsize >> 1;
 
 	if (!debugState.isValid) {
-		sciprintf("Not in debug state\n");
+		warning("Not in debug state");
 		return retval;
 	}
 
 	opsize &= 1; // byte if true, word if false
 
-	sciprintf("%04x:%04x: ", PRINT_REG(pos));
+	printf("%04x:%04x: ", PRINT_REG(pos));
 
 	if (print_bytecode) {
 		while (g_opcode_formats[opcode][i]) {
@@ -140,36 +140,36 @@
 		}
 
 		if (pos.offset + bytecount > scr_size) {
-			sciprintf("Operation arguments extend beyond end of script\n");
+			warning("Operation arguments extend beyond end of script");
 			return retval;
 		}
 
 		for (i = 0; i < bytecount; i++)
-			sciprintf("%02x ", scr[pos.offset + i]);
+			printf("%02x ", scr[pos.offset + i]);
 
 		for (i = bytecount; i < 5; i++)
-			sciprintf("   ");
+			printf("   ");
 	}
 
 	if (print_bw_tag)
-		sciprintf("[%c] ", opsize ? 'B' : 'W');
-	sciprintf("%s", s->_kernel->getOpcode(opcode).name.c_str());
+		printf("[%c] ", opsize ? 'B' : 'W');
+	printf("%s", s->_kernel->getOpcode(opcode).name.c_str());
 
 	i = 0;
 	while (g_opcode_formats[opcode][i]) {
 		switch (g_opcode_formats[opcode][i++]) {
 		case Script_Invalid:
-			sciprintf("-Invalid operation-");
+			warning("-Invalid operation-");
 			break;
 
 		case Script_SByte:
 		case Script_Byte:
-			sciprintf(" %02x", scr[retval.offset++]);
+			printf(" %02x", scr[retval.offset++]);
 			break;
 
 		case Script_Word:
 		case Script_SWord:
-			sciprintf(" %04x", 0xffff & (scr[retval.offset] | (scr[retval.offset+1] << 8)));
+			printf(" %04x", 0xffff & (scr[retval.offset] | (scr[retval.offset+1] << 8)));
 			retval.offset += 2;
 			break;
 
@@ -188,11 +188,11 @@
 			}
 
 			if (opcode == op_callk)
-				sciprintf(" %s[%x]", (param_value < s->_kernel->_kernelFuncs.size()) ?
+				printf(" %s[%x]", (param_value < s->_kernel->_kernelFuncs.size()) ?
 							((param_value < s->_kernel->getKernelNamesSize()) ? s->_kernel->getKernelName(param_value).c_str() : "[Unknown(postulated)]")
 							: "<invalid>", param_value);
 			else
-				sciprintf(opsize ? " %02x" : " %04x", param_value);
+				printf(opsize ? " %02x" : " %04x", param_value);
 
 			break;
 
@@ -203,7 +203,7 @@
 				param_value = 0xffff & (scr[retval.offset] | (scr[retval.offset+1] << 8));
 				retval.offset += 2;
 			}
-			sciprintf(opsize ? " %02x" : " %04x", param_value);
+			printf(opsize ? " %02x" : " %04x", param_value);
 			break;
 
 		case Script_SRelative:
@@ -213,7 +213,7 @@
 				param_value = 0xffff & (scr[retval.offset] | (scr[retval.offset+1] << 8));
 				retval.offset += 2;
 			}
-			sciprintf(opsize ? " %02x  [%04x]" : " %04x  [%04x]", param_value, (0xffff) & (retval.offset + param_value));
+			printf(opsize ? " %02x  [%04x]" : " %04x  [%04x]", param_value, (0xffff) & (retval.offset + param_value));
 			break;
 
 		case Script_End:
@@ -221,7 +221,7 @@
 			break;
 
 		default:
-			sciprintf("Internal assertion failed in 'disassemble', %s, L%d\n", __FILE__, __LINE__);
+			error("Internal assertion failed in disassemble()");
 
 		}
 	}
@@ -232,11 +232,11 @@
 			int prop_ofs = scr[pos.offset + 1];
 			int prop_id = propertyOffsetToId(s, prop_ofs, *debugState.p_objp);
 
-			sciprintf("	(%s)", selector_name(s, prop_id));
+			printf("	(%s)", selector_name(s, prop_id));
 		}
 	}
 
-	sciprintf("\n");
+	printf("\n");
 
 	if (pos == *debugState.p_pc) { // Extra information if debugging the current opcode
 		if (opcode == op_callk) {
@@ -246,14 +246,14 @@
 			if (!(s->_flags & GF_SCI0_OLD))
 				argc += (*debugState.p_restadjust);
 
-			sciprintf(" Kernel params: (");
+			printf(" Kernel params: (");
 
 			for (int j = 0; j < argc; j++) {
-				sciprintf("%04x:%04x", PRINT_REG((*debugState.p_sp)[j - stackframe]));
+				printf("%04x:%04x", PRINT_REG((*debugState.p_sp)[j - stackframe]));
 				if (j + 1 < argc)
-					sciprintf(", ");
+					printf(", ");
 			}
-			sciprintf(")\n");
+			printf(")\n");
 		} else if ((opcode == op_send) || (opcode == op_self)) {
 			int restmod = *debugState.p_restadjust;
 			int stackframe = (scr[pos.offset + 1] >> 1) + restmod;
@@ -278,32 +278,32 @@
 				if (!name)
 					name = "<invalid>";
 
-				sciprintf("  %s::%s[", name, (selector > s->_kernel->getSelectorNamesSize()) ? "<invalid>" : selector_name(s, selector));
+				printf("  %s::%s[", name, (selector > s->_kernel->getSelectorNamesSize()) ? "<invalid>" : selector_name(s, selector));
 
 				switch (lookup_selector(s, called_obj_addr, selector, 0, &fun_ref)) {
 				case kSelectorMethod:
-					sciprintf("FUNCT");
+					printf("FUNCT");
 					argc += restmod;
 					restmod = 0;
 					break;
 				case kSelectorVariable:
-					sciprintf("VAR");
+					printf("VAR");
 					break;
 				case kSelectorNone:
-					sciprintf("INVALID");
+					printf("INVALID");
 					break;
 				}
 
-				sciprintf("](");
+				printf("](");
 
 				while (argc--) {
-					sciprintf("%04x:%04x", PRINT_REG(sb[- stackframe + 2]));
+					printf("%04x:%04x", PRINT_REG(sb[- stackframe + 2]));
 					if (argc)
-						sciprintf(", ");
+						printf(", ");
 					stackframe--;
 				}
 
-				sciprintf(")\n");
+				printf(")\n");
 				stackframe -= 2;
 			} // while (stackframe > 0)
 		} // Send-like opcodes
@@ -328,11 +328,11 @@
 	debugState.p_pp = pp;
 	debugState.p_objp = objp;
 	debugState.p_restadjust = restadjust;
-	sciprintf("%d: acc=%04x:%04x  ", script_step_counter, PRINT_REG(s->r_acc));
+	printf("%d: acc=%04x:%04x  ", script_step_counter, PRINT_REG(s->r_acc));
 	debugState.isValid = true;
 	disassemble(s, *pc, 0, 1);
 	if (debugState.seeking == kDebugSeekGlobal)
-		sciprintf("Global %d (0x%x) = %04x:%04x\n", debugState.seekSpecial,
+		printf("Global %d (0x%x) = %04x:%04x\n", debugState.seekSpecial,
 		          debugState.seekSpecial, PRINT_REG(s->script_000->locals_block->_locals[debugState.seekSpecial]));
 
 	debugState.isValid = old_debugstate;
@@ -404,7 +404,7 @@
 		debugState.p_var_max = variables_nr;
 		debugState.p_var_base = variables_base;
 		
-		sciprintf("Step #%d\n", script_step_counter);
+		printf("Step #%d\n", script_step_counter);
 		disassemble(s, *pc, 0, 1);
 	}
 

Modified: scummvm/trunk/engines/sci/engine/seg_manager.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/seg_manager.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -121,7 +121,7 @@
 	// allocate the MemObject
 	mem = memObjAllocate(*seg_id, script_nr, MEM_OBJ_SCRIPT);
 	if (!mem) {
-		sciprintf("%s, %d, Not enough memory, ", __FILE__, __LINE__);
+		error("allocateScript: Not enough memory");
 		return NULL;
 	}
 
@@ -154,10 +154,10 @@
 		}
 
 		if (scr.buf_size > 65535) {
-			sciprintf("Script and heap sizes combined exceed 64K.\n"
+			error("Script and heap sizes combined exceed 64K.\n"
 			          "This means a fundamental design bug was made in SCI\n"
 			          "regarding SCI1.1 games.\nPlease report this so it can be"
-			          "fixed in the next major version!\n");
+			          "fixed in the next major version");
 			return;
 		}
 	}
@@ -172,7 +172,7 @@
 	dbgPrint("scr.buf ", scr.buf);
 	if (!scr.buf) {
 		scr.freeScript();
-		sciprintf("SegManager: Not enough memory space for script size");
+		warning("SegManager: Not enough memory space for script size");
 		scr.buf_size = 0;
 		return 0;
 	}
@@ -235,7 +235,7 @@
 MemObject *SegManager::memObjAllocate(SegmentId segid, int hash_id, MemObjectType type) {
 	MemObject *mem = MemObject::createMemObject(type);
 	if (!mem) {
-		sciprintf("SegManager: invalid mobj ");
+		warning("SegManager: invalid mobj");
 		return NULL;
 	}
 
@@ -313,7 +313,7 @@
 		return 0;
 
 	if (rel & 1) {
-		sciprintf("Error: Attempt to relocate odd variable #%d.5e (relative to %04x)\n", idx, block_location);
+		warning("Attempt to relocate odd variable #%d.5e (relative to %04x)\n", idx, block_location);
 		return 0;
 	}
 	block[idx].segment = segment; // Perform relocation
@@ -372,18 +372,17 @@
 			}
 
 			if (!done) {
-				sciprintf("While processing relocation block %04x:%04x:\n", PRINT_REG(block));
-				sciprintf("Relocation failed for index %04x (%d/%d)\n", pos, i + 1, count);
+				printf("While processing relocation block %04x:%04x:\n", PRINT_REG(block));
+				printf("Relocation failed for index %04x (%d/%d)\n", pos, i + 1, count);
 				if (scr->locals_block)
-					sciprintf("- locals: %d at %04x\n", scr->locals_block->_locals.size(), scr->locals_offset);
+					printf("- locals: %d at %04x\n", scr->locals_block->_locals.size(), scr->locals_offset);
 				else
-					sciprintf("- No locals\n");
+					printf("- No locals\n");
 				for (k = 0; k < scr->_objects.size(); k++)
-					sciprintf("- obj#%d at %04x w/ %d vars\n", k, scr->_objects[k].pos.offset, scr->_objects[k]._variables.size());
-// SQ3 script 71 has broken relocation entries.
-// Since this is mainstream, we can't break out as we used to do.
-				sciprintf("Trying to continue anyway...\n");
-//				BREAKPOINT();
+					printf("- obj#%d at %04x w/ %d vars\n", k, scr->_objects[k].pos.offset, scr->_objects[k]._variables.size());
+				// SQ3 script 71 has broken relocation entries.
+				// Since this is mainstream, we can't break out as we used to do.
+				printf("Trying to continue anyway...\n");
 			}
 		}
 	}
@@ -413,15 +412,15 @@
 			}
 
 			if (!done) {
-				sciprintf("While processing relocation block %04x:%04x:\n", PRINT_REG(block));
-				sciprintf("Relocation failed for index %04x (%d/%d)\n", pos, i + 1, count);
+				printf("While processing relocation block %04x:%04x:\n", PRINT_REG(block));
+				printf("Relocation failed for index %04x (%d/%d)\n", pos, i + 1, count);
 				if (scr->locals_block)
-					sciprintf("- locals: %d at %04x\n", scr->locals_block->_locals.size(), scr->locals_offset);
+					printf("- locals: %d at %04x\n", scr->locals_block->_locals.size(), scr->locals_offset);
 				else
-					sciprintf("- No locals\n");
+					printf("- No locals\n");
 				for (k = 0; k < scr->_objects.size(); k++)
-					sciprintf("- obj#%d at %04x w/ %d vars\n", k, scr->_objects[k].pos.offset, scr->_objects[k]._variables.size());
-				sciprintf("Triggering breakpoint...\n");
+					printf("- obj#%d at %04x w/ %d vars\n", k, scr->_objects[k].pos.offset, scr->_objects[k]._variables.size());
+				printf("Triggering breakpoint...\n");
 				error("Breakpoint in %s, line %d", __FILE__, __LINE__);
 			}
 		}
@@ -596,7 +595,7 @@
 	scr->locals_offset = location.offset;
 
 	if (!(location.offset + count * 2 + 1 < scr->buf_size)) {
-		sciprintf("Locals extend beyond end of script: offset %04x, count %x vs size %x\n", location.offset, count, (uint)scr->buf_size);
+		warning("Locals extend beyond end of script: offset %04x, count %x vs size %x", location.offset, count, (uint)scr->buf_size);
 		count = (scr->buf_size - location.offset) >> 1;
 	}
 
@@ -719,7 +718,7 @@
 uint16 SegManager::validateExportFunc(int pubfunct, SegmentId seg) {
 	Script *scr = getScript(seg);
 	if (scr->exports_nr <= pubfunct) {
-		sciprintf("pubfunct is invalid");
+		warning("validateExportFunc(): pubfunct is invalid");
 		return 0;
 	}
 
@@ -735,7 +734,7 @@
 	HunkTable *ht = (HunkTable *)GET_SEGMENT(*this, addr.segment, MEM_OBJ_HUNK);
 
 	if (!ht) {
-		sciprintf("Attempt to free Hunk from address %04x:%04x: Invalid segment type\n", PRINT_REG(addr));
+		warning("Attempt to free Hunk from address %04x:%04x: Invalid segment type", PRINT_REG(addr));
 		return;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -27,6 +27,7 @@
 #include "common/stack.h"
 
 #include "sci/sci.h"
+#include "sci/console.h"
 #include "sci/debug.h"	// for g_debug_weak_validations
 #include "sci/resource.h"
 #include "sci/engine/state.h"
@@ -135,10 +136,10 @@
 		if (type == VAR_PARAM || type == VAR_TEMP) {
 			int total_offset = r - stack_base;
 			if (total_offset < 0 || total_offset >= VM_STACK_SIZE) {
-				sciprintf("[VM] Access would be outside even of the stack (%d); access denied\n", total_offset);
+				warning("[VM] Access would be outside even of the stack (%d); access denied", total_offset);
 				return 1;
 			} else {
-				sciprintf("[VM] Access within stack boundaries; access granted.\n");
+				debugC(2, kDebugLevelVM, "[VM] Access within stack boundaries; access granted.\n");
 				return 0;
 			}
 		}
@@ -255,7 +256,8 @@
 		bp = s->bp_list;
 		while (bp) {
 			if (bp->type == BREAK_EXPORT && bp->data.address == bpaddress) {
-				sciprintf("Break on script %d, export %d\n", script, pubfunct);
+				Console *con = ((SciEngine *)g_engine)->getSciDebugger();
+				con->DebugPrintf("Break on script %d, export %d\n", script, pubfunct);
 				breakpointFlag = true;
 				break;
 			}
@@ -319,7 +321,8 @@
 					cmplen = 256;
 
 				if (bp->type == BREAK_SELECTOR && !strncmp(bp->data.name, method_name, cmplen)) {
-					sciprintf("Break on %s (in [%04x:%04x])\n", method_name, PRINT_REG(send_obj));
+					Console *con = ((SciEngine *)g_engine)->getSciDebugger();
+					con->DebugPrintf("Break on %s (in [%04x:%04x])\n", method_name, PRINT_REG(send_obj));
 					print_send_action = 1;
 					breakpointFlag = true;
 					break;
@@ -329,7 +332,7 @@
 		}
 
 #ifdef VM_DEBUG_SEND
-		sciprintf("Send to %04x:%04x, selector %04x (%s):", PRINT_REG(send_obj), selector, s->_selectorNames[selector].c_str());
+		printf("Send to %04x:%04x, selector %04x (%s):", PRINT_REG(send_obj), selector, s->_selectorNames[selector].c_str());
 #endif // VM_DEBUG_SEND
 
 		ObjVarRef varp;
@@ -349,17 +352,16 @@
 		case kSelectorVariable:
 
 #ifdef VM_DEBUG_SEND
-			sciprintf("Varselector: ");
 			if (argc)
-				sciprintf("Write %04x:%04x\n", PRINT_REG(argp[1]));
+				printf("Varselector: Write %04x:%04x\n", PRINT_REG(argp[1]));
 			else
-				sciprintf("Read\n");
+				printf("Varselector: Read\n");
 #endif // VM_DEBUG_SEND
 
 			switch (argc) {
 			case 0:   // Read selector
 				if (print_send_action) {
-					sciprintf("[read selector]\n");
+					printf("[read selector]\n");
 					print_send_action = 0;
 				}
 				// fallthrough
@@ -372,7 +374,7 @@
 						reg_t oldReg = *varp.getPointer(s);
 						reg_t newReg = argp[1];
 
-						sciprintf("[write to selector: change %04x:%04x to %04x:%04x]\n", PRINT_REG(oldReg), PRINT_REG(newReg));
+						printf("[write to selector: change %04x:%04x to %04x:%04x]\n", PRINT_REG(oldReg), PRINT_REG(newReg));
 						print_send_action = 0;
 					}
 					CallsStruct call;
@@ -386,9 +388,8 @@
 				break;
 #ifdef STRICT_SEND
 			default:
-				sciprintf("Send error: Variable selector %04x in %04x:%04x called with %04x params\n", selector, PRINT_REG(send_obj), argc);
-				script_debug_flag = 1; // Enter debug mode
 				debugState.seeking = debugState.runningStep = 0;
+				error("Send error: Variable selector %04x in %04x:%04x called with %04x params", selector, PRINT_REG(send_obj), argc);
 #endif
 			}
 			break;
@@ -396,16 +397,16 @@
 		case kSelectorMethod:
 
 #ifdef VM_DEBUG_SEND
-			sciprintf("Funcselector(");
+			printf("Funcselector(");
 			for (int i = 0; i < argc; i++) {
-				sciprintf(PREG, PRINT_REG(argp[i+1]));
+				printf(PREG, PRINT_REG(argp[i+1]));
 				if (i + 1 < argc)
-					sciprintf(", ");
+					printf(", ");
 			}
-			sciprintf(") at %04x:%04x\n", PRINT_REG(funcp));
+			printf(") at %04x:%04x\n", PRINT_REG(funcp));
 #endif // VM_DEBUG_SEND
 			if (print_send_action) {
-				sciprintf("[invoke selector]\n");
+				printf("[invoke selector]\n");
 				print_send_action = 0;
 			}
 
@@ -461,7 +462,7 @@
 	// Returns new TOS element for the execution stack
 	// locals_segment may be -1 if derived from the called object
 
-	//sciprintf("Exec stack: [%d/%d], origin %d, at %p\n", s->execution_stack_pos, s->_executionStack.size(), origin, s->execution_stack);
+	//printf("Exec stack: [%d/%d], origin %d, at %p\n", s->execution_stack_pos, s->_executionStack.size(), origin, s->execution_stack);
 
 	ExecStack xstack;
 
@@ -506,7 +507,7 @@
 	MemObject *mobj = GET_SEGMENT_ANY(*s->seg_manager, base.segment);
 
 	if (!mobj) {
-		error("[VM] Error: Attempt to add %d to invalid pointer %04x:%04x!", offset, PRINT_REG(base));
+		error("[VM] Error: Attempt to add %d to invalid pointer %04x:%04x", offset, PRINT_REG(base));
 		return NULL_REG;
 	}
 
@@ -524,7 +525,7 @@
 		break;
 
 	default:
-		sciprintf("[VM] Error: Attempt to add %d to pointer %04x:%04x: Pointer arithmetics of this type unsupported!", offset, PRINT_REG(base));
+		error("[VM] Error: Attempt to add %d to pointer %04x:%04x: Pointer arithmetics of this type unsupported", offset, PRINT_REG(base));
 		return NULL_REG;
 
 	}
@@ -1585,18 +1586,18 @@
 		*heap = s->resmgr->findResource(ResourceId(kResourceTypeHeap, script_nr), 0);
 
 	if (!*script || (s->_version >= SCI_VERSION_1_1 && !heap)) {
-		sciprintf("Script 0x%x requested but not found\n", script_nr);
+		warning("Script 0x%x requested but not found", script_nr);
 		if (s->_version >= SCI_VERSION_1_1) {
 			if (*heap)
-				sciprintf("Inconsistency: heap resource WAS found\n");
+				warning("Inconsistency: heap resource WAS found");
 			else if (*script)
-				sciprintf("Inconsistency: script resource WAS found\n");
+				warning("Inconsistency: script resource WAS found");
 		}
 		return 0;
 	}
 
 	if (NULL == s) {
-		sciprintf("vm.c: script_instantiate(): NULL passed for \"s\"\n");
+		warning("script_instantiate_common(): script_instantiate(): NULL passed for \"s\"");
 		return 0;
 	}
 
@@ -1897,7 +1898,7 @@
 	if (s->_version < SCI_VERSION_1_1)
 		script_uninstantiate_sci0(s, script_nr, reg.segment);
 	else
-		sciprintf("FIXME: Add proper script uninstantiation for SCI 1.1\n");
+		warning("FIXME: Add proper script uninstantiation for SCI 1.1");
 
 	if (scr->getLockers())
 		return; // if xxx.lockers > 0
@@ -1948,7 +1949,7 @@
 				s = successor;
 
 				if (script_abort_flag == 2) {
-					sciprintf("Restarting with replay()\n");
+					debugC(2, kDebugLevelVM, "Restarting with replay()\n");
 					s->_executionStack.clear(); // Restart with replay
 
 					_init_stack_base_with_selector(s, s->_kernel->_selectorMap.replay);
@@ -1971,19 +1972,19 @@
 int game_run(EngineState **_s) {
 	EngineState *s = *_s;
 
-	sciprintf(" Calling %s::play()\n", s->_gameName.c_str());
+	debugC(2, kDebugLevelVM, "Calling %s::play()\n", s->_gameName.c_str());
 	_init_stack_base_with_selector(s, s->_kernel->_selectorMap.play); // Call the play selector
 
 	// Now: Register the first element on the execution stack-
 	if (!send_selector(s, s->game_obj, s->game_obj, s->stack_base, 2, s->stack_base)) {
 		printObject(s, s->game_obj);
-		sciprintf("Failed to run the game! Aborting...\n");
+		warning("Failed to run the game! Aborting...");
 		return 1;
 	}
 	// and ENGAGE!
 	_game_run(*_s, 0);
 
-	sciprintf(" Game::play() finished.\n");
+	debugC(2, kDebugLevelVM, "Game::play() finished.\n");
 
 	return 0;
 }

Modified: scummvm/trunk/engines/sci/gfx/font.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/font.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/gfx/font.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -186,7 +186,7 @@
 		int ch = (int) text[i];
 
 		if (ch >= font->chars_nr) {
-			GFXERROR("Invalid character 0x%02x encountered!\n", text[i]);
+			error("Invalid character 0x%02x encountered", text[i]);
 			return NULL;
 		}
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_driver.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -205,7 +205,7 @@
 		g_system->updateScreen();
 		break;
 	default:
-		GFXERROR("Invalid buffer %d in update!\n", buffer);
+		error("Invalid buffer %d in update", buffer);
 		return GFX_ERROR;
 	}
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_gui.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/gfx/gfx_gui.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -81,14 +81,14 @@
 	gfx_color_t black = s->ega_colors[0];
 
 	if (!status_bar->_visual) {
-		GFXERROR("Attempt to change title bar without visual!\n");
+		error("Attempt to change title bar without visual");
 		return;
 	}
 
 	state = status_bar->_visual->_gfxState;
 
 	if (!state) {
-		GFXERROR("Attempt to change title bar with stateless visual!\n");
+		error("Attempt to change title bar with stateless visual");
 		return;
 	}
 
@@ -121,7 +121,8 @@
 
 static void sciw_make_window_fit(rect_t *rect, GfxPort *parent) {
 	// This window is meant to cover the whole screen, so we allow it to go through.
-	if (rect->width == 319 && rect->height == 189) return;
+	if (rect->width == 319 && rect->height == 189)
+		return;
 
 	if (rect->x + rect->width > parent->_bounds.x + parent->_bounds.width)
 		rect->x -= (rect->x + rect->width) - (parent->_bounds.x + parent->_bounds.width) + 2;
@@ -220,7 +221,7 @@
 
 		if (!(flags & kWindowNoDropShadow)) {
 			if (gfxop_set_color(state, &black, 0, 0, 0, 0x80, bgcolor.priority, -1)) {
-				GFXERROR("Could not get black/semitrans color entry!\n");
+				error("Could not get black/semitrans color entry");
 				return NULL;
 			}
 
@@ -236,7 +237,7 @@
 		// Draw frame
 
 		if (gfxop_set_color(state, &black, 0, 0, 0, 0, bgcolor.priority, -1)) {
-			GFXERROR("Could not get black color entry!\n");
+			error("Could not get black color entry");
 			return NULL;
 		}
 
@@ -418,7 +419,7 @@
 	gfxw_set_id(list, ID.segment, ID.offset);
 
 	if (!port->_visual) {
-		GFXERROR("Attempting to create icon control for virtual port!\n");
+		error("Attempting to create icon control for virtual port");
 		return NULL;
 	}
 
@@ -429,7 +430,7 @@
 	                          ALIGN_LEFT, ALIGN_TOP, GFXW_VIEW_FLAG_DONT_MODIFY_OFFSET);
 
 	if (!icon) {
-		GFXERROR("Attempt to create icon control with cel %d/%d/%d (invalid)\n", view, loop, cel);
+		error("Attempt to create icon control with cel %d/%d/%d (invalid)", view, loop, cel);
 		return NULL;
 	}
 
@@ -461,7 +462,7 @@
 	columns = (zone.height - 20);
 
 	if (font_height <= 0) {
-		GFXERROR("Attempt to create list control with invalid font %d\n", font_nr);
+		error("Attempt to create list control with invalid font %d", font_nr);
 		delete list;
 		return NULL;
 	}
@@ -565,7 +566,7 @@
 		return NULL;
 
 	if (selection >= (int)menubar->_menus.size()) {
-		GFXERROR("Attempt to make menu #%d of %d\n", selection, menubar->_menus.size());
+		error("Attempt to make menu #%d of %d", selection, menubar->_menus.size());
 		return NULL;
 	}
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_pixmap_scale.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_pixmap_scale.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/gfx/gfx_pixmap_scale.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -517,8 +517,7 @@
 		break;
 
 	default:
-		GFXERROR("Invalid mode->bytespp=%d\n", mode->bytespp);
-
+		error("Invalid mode->bytespp=%d", mode->bytespp);
 	}
 
 	if (pxm->flags & GFX_PIXMAP_FLAG_SCALED_INDEX) {
@@ -562,8 +561,7 @@
 		break;
 
 	default:
-		GFXERROR("Invalid mode->bytespp=%d\n", mode->bytespp);
-
+		error("Invalid mode->bytespp=%d", mode->bytespp);
 	}
 
 }
@@ -599,7 +597,7 @@
 		break;
 
 	default:
-		GFXERROR("Invalid mode->bytespp=%d\n", mode->bytespp);
+		error("Invalid mode->bytespp=%d", mode->bytespp);
 
 	}
 }
@@ -638,7 +636,7 @@
 		break;
 
 	default:
-		GFXERROR("Attempt to filter pixmap %04x in invalid mode #%d\n", pxm->ID, filter);
+		error("Attempt to filter pixmap %04x in invalid mode #%d", pxm->ID, filter);
 
 		if (!was_allocated) {
 			if (!mode->alpha_mask && pxm->colors_nr() < GFX_PIC_COLORS)

Modified: scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -165,7 +165,7 @@
 
 	case GFX_RESOURCE_TYPES_NR:
 	default:
-		GFXERROR("Invalid resource type: %d\n", type);
+		error("Invalid resource type: %d", type);
 		return -1;
 	}
 }
@@ -349,7 +349,7 @@
 #endif
 
 		if (!pic) {
-			GFXERROR("Failed to allocate scaled pic!\n");
+			error("Failed to allocate scaled pic");
 			return NULL;
 		}
 
@@ -358,7 +358,7 @@
 		if (need_unscaled) {
 			unscaled_pic = gfxr_init_pic(&mode_1x1_color_index, GFXR_RES_ID(GFX_RESOURCE_TYPE_PIC, num), _version >= SCI_VERSION_01_VGA);
 			if (!unscaled_pic) {
-				GFXERROR("Failed to allocate unscaled pic!\n");
+				error("Failed to allocate unscaled pic");
 				return NULL;
 			}
 			gfxr_clear_pic0(pic, SCI_TITLEBAR_SIZE);

Modified: scummvm/trunk/engines/sci/gfx/gfx_state_internal.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_state_internal.h	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/gfx/gfx_state_internal.h	2009-07-06 10:39:22 UTC (rev 42167)
@@ -132,7 +132,7 @@
 	}
 
 	/**
-	 * Prints a string representation of the widget with sciprintf.
+	 * Prints a string representation of the widget with printf.
 	 *
 	 * Will recursively print all of the widget's contents if the widget
 	 * contains further sub-widgets

Modified: scummvm/trunk/engines/sci/gfx/gfx_support.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_support.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/gfx/gfx_support.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -94,7 +94,7 @@
 		return;
 
 	default:
-		GFXERROR("pixelwidth=%d not supported!\n", pixelwidth);
+		error("pixelwidth=%d not supported", pixelwidth);
 		return;
 
 	}
@@ -292,7 +292,7 @@
 
 		alpha_mask = mode->alpha_mask;
 		if (!alpha_mask && pxm->alpha_map) {
-			GFXERROR("Invalid alpha mode: both pxm->alpha_map and alpha_mask are white!\n");
+			error("Invalid alpha mode: both pxm->alpha_map and alpha_mask are white");
 			return GFX_ERROR;
 		}
 
@@ -335,7 +335,7 @@
 					        xl, yl, alpha, bytes_per_alpha_line, bytes_per_alpha_pixel, alpha_mask, alpha_min,
 					        0, 0, 0, 0);
 				else {
-					GFXERROR("Invalid mode->bytespp: %d\n", mode->bytespp);
+					error("Invalid mode->bytespp: %d", mode->bytespp);
 					return GFX_ERROR;
 				}
 			} else { // priority
@@ -344,7 +344,7 @@
 					        xl, yl, alpha, bytes_per_alpha_line, bytes_per_alpha_pixel, alpha_mask, alpha_min,
 					        priority_pos, priority_line_width, priority_skip, priority);
 				else {
-					GFXERROR("Invalid mode->bytespp: %d\n", mode->bytespp);
+					error("Invalid mode->bytespp: %d", mode->bytespp);
 					return GFX_ERROR;
 				}
 			}

Modified: scummvm/trunk/engines/sci/gfx/gfx_system.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_system.h	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/gfx/gfx_system.h	2009-07-06 10:39:22 UTC (rev 42167)
@@ -35,9 +35,6 @@
 
 #define GFX_DEBUG
 
-/* General output macros */
-#define GFXERROR sciprintf("GFX Error: %s, L%d:", __FILE__, __LINE__); error
-
 /***********************/
 /*** Data structures ***/
 /***********************/

Modified: scummvm/trunk/engines/sci/gfx/gfx_tools.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_tools.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/gfx/gfx_tools.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -245,7 +245,7 @@
 	old_data = pixmap->index_data;
 
 	if (!old_data) {
-		GFXERROR("Attempt to scale index data without index data!\n");
+		error("Attempt to scale index data without index data!\n");
 		return pixmap;
 	}
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp	2009-07-06 07:40:28 UTC (rev 42166)
+++ scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp	2009-07-06 10:39:22 UTC (rev 42167)
@@ -81,7 +81,7 @@
 
 static void indent(int indentation) {
 	for (int i = 0; i < indentation; i++)
-		sciprintf("    ");
+		printf("    ");
 }
 
 void GfxWidget::printIntern(int indentation) const {
@@ -92,35 +92,35 @@
 
 	if (_magic == GFXW_MAGIC_VALID) {
 		if (_visual)
-			sciprintf("v ");
+			printf("v ");
 		else
-			sciprintf("NoVis ");
+			printf("NoVis ");
 	} else if (_magic == GFXW_MAGIC_INVALID)
-		sciprintf("INVALID ");
+		printf("INVALID ");
 
-	sciprintf("S%08x", _serial);
+	printf("S%08x", _serial);
 
 	if (_ID != GFXW_NO_ID) {
-		sciprintf("#%x", _ID);
+		printf("#%x", _ID);
 
 		if (_subID != GFXW_NO_ID)
-			sciprintf(":%x ", _subID);
+			printf(":%x ", _subID);
 		else
-			sciprintf(" ");
+			printf(" ");
 	}
 
-	sciprintf("[(%d,%d)(%dx%d)]", _bounds.x, _bounds.y, _bounds.width, _bounds.height);
+	printf("[(%d,%d)(%dx%d)]", _bounds.x, _bounds.y, _bounds.width, _bounds.height);
 
 	for (i = 0; i < strlen(flags_list); i++)
 		if (_flags & (1 << i))
-			sciprintf("%c", flags_list[i]);
+			printf("%c", flags_list[i]);
 
-	sciprintf(" ");
+	printf(" ");
 }
 
 void GfxWidget::print(int indentation) const {
 	printIntern(indentation);
-	sciprintf("<untyped #%d>", _type);
+	printf("<untyped #%d>", _type);
 }
 
 GfxWidget::GfxWidget(gfxw_widget_type_t type_) {
@@ -149,13 +149,13 @@
 
 static int verify_widget(GfxWidget *widget) {
 	if (!widget) {
-		GFXERROR("Attempt to use NULL widget\n");
+		warning("Attempt to use NULL widget");
 		return 1;
 	} else if (widget->_magic != GFXW_MAGIC_VALID) {
 		if (widget->_magic == GFXW_MAGIC_INVALID) {
-			GFXERROR("Attempt to use invalidated widget\n");
+			warning("Attempt to use invalidated widget");
 		} else {
-			GFXERROR("Attempt to use non-widget\n");
+			warning("Attempt to use non-widget");
 		}
 		return 1;
 	}
@@ -163,13 +163,13 @@
 }
 
 #define VERIFY_WIDGET(w) \
-	if (verify_widget((GfxWidget *)(w))) { GFXERROR("Error occured while validating widget\n"); }
+	if (verify_widget((GfxWidget *)(w))) { error("Error occured while validating widget"); }
 
 #define GFX_ASSERT(_x) \
 { \
 	int retval = (_x); \
 	if (retval == GFX_ERROR) { \
-		GFXERROR("Error occured while drawing widget!\n"); \
+		warning("Error occured while drawing widget"); \
 		return 1; \
 	} else if (retval == GFX_FATAL) { \
 		error("Fatal error occured while drawing widget!\nGraphics state invalid; aborting program..."); \
@@ -183,23 +183,23 @@
 // Assertion for drawing
 #define DRAW_ASSERT(widget, exp_type) \
 	if (!(widget)) { \
-		sciprintf("L%d: NULL widget", __LINE__); \
+		printf("L%d: NULL widget", __LINE__); \
 		return 1; \
 	} \
 	if ((widget)->_type != (exp_type)) { \
-		sciprintf("L%d: Error in widget: Expected type " # exp_type "(%d) but got %d\n", __LINE__, exp_type, (widget)->_type); \
-		sciprintf("Erroneous widget: "); \
+		printf("L%d: Error in widget: Expected type " # exp_type "(%d) but got %d\n", __LINE__, exp_type, (widget)->_type); \
+		printf("Erroneous widget: "); \
 		widget->print(4); \
-		sciprintf("\n"); \
+		printf("\n"); \
 		return 1; \
 	} \
 	if (!(widget->_flags & GFXW_FLAG_VISIBLE)) \
 		return 0; \
 	if (!(widget->_type == GFXW_VISUAL || widget->_visual)) { \
-		sciprintf("L%d: Error while drawing widget: Widget has no visual\n", __LINE__); \
-		sciprintf("Erroneous widget: "); \
+		printf("L%d: Error while drawing widget: Widget has no visual\n", __LINE__); \
+		printf("Erroneous widget: "); \
 		widget->print(1); \
-		sciprintf("\n"); \
+		printf("\n"); \
 		return 1; \
 	}
 
@@ -253,8 +253,7 @@
 	GfxWidget **seekerp;
 
 	if (!container) {
-		GFXERROR("Attempt to remove widget from NULL container!\n");
-		error("gfxw_remove_widget_from_container() failed. Breakpoint in %s, line %d", __FILE__, __LINE__);
+		error("Attempt to remove widget from NULL container!\n");
 	}
 
 	seekerp = &(container->_contents);
@@ -271,10 +270,10 @@
 		seekerp = &((*seekerp)->_next);
 
 	if (!*seekerp) {
-		GFXERROR("Internal error: Attempt to remove widget from container it was not contained in!\n");
-		sciprintf("Widget:");
+		printf("Internal error: Attempt to remove widget from container it was not contained in!\n");
+		printf("Widget:");
 		widget->print(1);
-		sciprintf("Container:");
+		printf("Container:");
 		widget->print(1);
 		error("gfxw_remove_widget_from_container() failed. Breakpoint in %s, line %d", __FILE__, __LINE__);
 		return;
@@ -341,7 +340,7 @@
 
 void GfxBox::print(int indentation) const {
 	printIntern(indentation);
-	sciprintf("BOX");
+	printf("BOX");
 }
 
 static int _gfxwop_box_superarea_of(GfxWidget *widget, GfxWidget *other) {
@@ -472,7 +471,7 @@
 
 void GfxRect::print(int indentation) const {
 	printIntern(indentation);
-	sciprintf("RECT");
+	printf("RECT");
 }
 
 void _gfxw_set_ops_RECT(GfxWidget *prim) {
@@ -518,7 +517,7 @@
 
 void GfxLine::print(int indentation) const {
 	printIntern(indentation);
-//	sciprintf("LINE");
+//	printf("LINE");
 }
 
 void _gfxw_set_ops_LINE(GfxWidget *prim) {
@@ -598,13 +597,13 @@
 	printIntern(indentation);
 
 	if (_type == GFXW_STATIC_VIEW)
-		sciprintf("STATICVIEW");
+		printf("STATICVIEW");
 	else if (_type == GFXW_VIEW)
-		sciprintf("VIEW");
+		printf("VIEW");
 	else
 		error("GfxView::print: Invalid type %d", _type);
 
-	sciprintf("(%d/%d/%d)@(%d,%d)[p:%d,c:%d]", _view, _loop, _cel, _pos.x, _pos.y,
+	printf("(%d/%d/%d)@(%d,%d)[p:%d,c:%d]", _view, _loop, _cel, _pos.x, _pos.y,
 	          (_color.mask & GFX_MASK_PRIORITY) ? _color.priority : -1,
 	          (_color.mask & GFX_MASK_CONTROL) ? _color.control : -1);
 }
@@ -675,13 +674,13 @@
 	printIntern(indentation);
 
 	if (_type == GFXW_DYN_VIEW)
-		sciprintf("DYNVIEW");
+		printf("DYNVIEW");
 	else if (_type == GFXW_PIC_VIEW)
-		sciprintf("PICVIEW");
+		printf("PICVIEW");
 	else
 		error("GfxDynView::print: Invalid type %d", _type);
 
-	sciprintf(" SORT=%d z=%d seq=%d (%d/%d/%d)@(%d,%d)[p:%d,c:%d]; sig[%04x@%04X:%04X[%d]]", force_precedence, _z,
+	printf(" SORT=%d z=%d seq=%d (%d/%d/%d)@(%d,%d)[p:%d,c:%d]; sig[%04x@%04X:%04X[%d]]", force_precedence, _z,
 	          sequence, _view, _loop, _cel, _pos.x, _pos.y,
 	          (_color.mask & GFX_MASK_PRIORITY) ? _color.priority : -1,
 	          (_color.mask & GFX_MASK_CONTROL) ? _color.control : -1, signal, signalp.obj.segment, signalp.obj.offset, signalp.varindex);
@@ -815,8 +814,7 @@
 	if (_textHandle) {
 		GfxState *state = _visual ? _visual->_gfxState : NULL;
 		if (!state) {
-			GFXERROR("Attempt to free text without supplying mode to free it from!\n");
-			error("GfxText destructor failed. Breakpoint in %s, line %d", __FILE__, __LINE__);
+			error("Attempt to free text without supplying mode to free it from!\n");
 		} else {
 			gfxop_free_text(state, _textHandle);
 			_textHandle = NULL;
@@ -838,7 +836,7 @@
 
 void GfxText::print(int indentation) const {
 	printIntern(indentation);
-	sciprintf("TEXT:'%s'", _text.c_str());
+	printf("TEXT:'%s'", _text.c_str());
 }
 
 static int _gfxwop_text_equals(GfxWidget *widget, GfxWidget *other) {
@@ -964,11 +962,11 @@
 
 	indent(indentation);
 
-	sciprintf("--%s:\n", name);
+	printf("--%s:\n", name);
 
 	while (seeker) {
 		seeker->print(indentation + 1);
-		sciprintf("\n");
+		printf("\n");
 		seeker = seeker->_next;
 	}
 
@@ -976,14 +974,14 @@
 }
 
 void GfxContainer::print(int indentation) const {
-	sciprintf(" viszone=((%d,%d),(%dx%d))\n", zone.x, zone.y, zone.width, zone.height);
+	printf(" viszone=((%d,%d),(%dx%d))\n", zone.x, zone.y, zone.width, zone.height);
 
 	indent(indentation);
-	sciprintf("--dirty:\n");
+	printf("--dirty:\n");
 
 	for (DirtyRectList::const_iterator dirty = _dirtyRects.begin(); dirty != _dirtyRects.end(); ++dirty) {
 		indent(indentation + 1);
-		sciprintf("dirty(%d,%d, (%dx%d))\n", dirty->x, dirty->y, dirty->width, dirty->height);
+		printf("dirty(%d,%d, (%dx%d))\n", dirty->x, dirty->y, dirty->width, dirty->height);
 	}
 
 	_w_gfxwop_container_print_contents("contents", _contents, indentation);
@@ -1155,11 +1153,11 @@
 
 static int _parentize_widget(GfxContainer *container, GfxWidget *widget) {
 	if (widget->_parent) {
-		GFXERROR("_gfxwop_container_add(): Attempt to give second parent node to widget!\nWidget:");
+		printf("_parentize_widget(): Attempt to give second parent node to widget!\nWidget:");
 		widget->print(3);
-		sciprintf("\nContainer:");
+		printf("\nContainer:");
 		container->print(3);
-
+		error("Error in _parentize_widget()");
 		return 1;
 	}
 
@@ -1253,9 +1251,9 @@
 	printIntern(indentation);
 
 	if (_type == GFXW_LIST)
-		sciprintf("LIST");
+		printf("LIST");
 	else if (_type == GFXW_SORTED_LIST)
-		sciprintf("SORTED_LIST");
+		printf("SORTED_LIST");
 	else
 		error("GfxList::print: Invalid type %d", _type);
 
@@ -1272,7 +1270,7 @@
 	if (!GFXW_IS_LIST(widget)) {
 		warning("[GFX] _gfxwop_list_equals(): Method called on non-list");
 		widget->print(0);
-		sciprintf("\n");
+		printf("\n");
 		return 0;
 	}
 
@@ -1316,11 +1314,11 @@
 	GfxWidget **seekerp = &(container->_contents);
 
 	if (widget->_next) {
-		GFXERROR("_gfxwop_sorted_list_add(): Attempt to add widget to two lists!\nWidget:");
+		printf("_gfxwop_ordered_add(): Attempt to add widget to two lists!\nWidget:");
 		widget->print(3);
-		sciprintf("\nList:");
+		printf("\nList:");
 		container->print(3);
-		error("Breakpoint in %s, line %d", __FILE__, __LINE__);
+		error("Error in _gfxwop_ordered_add()");
 	}
 
 	if (_gfxw_container_id_equals(container, widget))
@@ -1388,7 +1386,7 @@
 		int err = gfxop_clear_box(_gfxState, *dirty);
 
 		if (err) {
-			GFXERROR("Error while clearing dirty rect (%d,%d,(%dx%d))\n", dirty->x,
+			error("Error while clearing dirty rect (%d,%d,(%dx%d))", dirty->x,
 			         dirty->y, dirty->width, dirty->height);
 			if (err == GFX_FATAL)
 				return err;
@@ -1405,15 +1403,15 @@
 
 void GfxVisual::print(int indentation) const {
 	printIntern(indentation);

@@ Diff output truncated at 100000 characters. @@

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list