aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO1
-rw-r--r--saga/cvar.cpp18
-rw-r--r--saga/sdebug.cpp9
-rw-r--r--saga/sthread.cpp16
4 files changed, 20 insertions, 24 deletions
diff --git a/TODO b/TODO
index 1690ebe1b0..d0bf14b8ce 100644
--- a/TODO
+++ b/TODO
@@ -297,7 +297,6 @@ SAGA
* Remove use of yslib
* Transition console to use ScummVM one
* Remove any traces of the additional level of abstraction reinherit used
-* Change printf calls to warning/debug calls
* Remove homerolled high level data structures like stacks that should
be provided by ScummVM if they aren't already.
* OO'ify (blah_mod.h contains public stuff, blah.h private stuff) [almost done]
diff --git a/saga/cvar.cpp b/saga/cvar.cpp
index 8856a018b3..d4793209f2 100644
--- a/saga/cvar.cpp
+++ b/saga/cvar.cpp
@@ -226,7 +226,7 @@ int CVAR_SetValue(CVAR_P cvar, char *value) {
*(cvar->t.i.var_p) = (cv_int_t) int_param;
#ifdef CVAR_TRACE
- printf("Set cvar to value %ld.\n", int_param);
+ debug(2, "Set cvar to value %ld.\n", int_param);
#endif
break;
@@ -274,7 +274,7 @@ int CVAR_SetValue(CVAR_P cvar, char *value) {
*(cvar->t.ui.var_p) = (cv_uint16_t) uint16_param;
#ifdef CVAR_TRACE
- printf("Set cvar to value %lu.\n", uint16_param);
+ debug(2, "Set cvar to value %lu.\n", uint16_param);
#endif
break;
case CVAR_FLOAT:
@@ -291,7 +291,7 @@ int CVAR_SetValue(CVAR_P cvar, char *value) {
cvar->t.s.var_str[cvar->t.s.ubound] = 0;
}
#ifdef CVAR_TRACE
- printf("Set cvar to value \"%s\".\n", cvar->t.s.var_str);
+ debug(2, "Set cvar to value \"%s\".\n", cvar->t.s.var_str);
#endif
break;
default:
@@ -311,7 +311,7 @@ CVAR_P CVAR_Find(const char *var_str) {
hash = CVAR_HashString(var_str);
#ifdef CVAR_TRACE
- printf("Performing lookup on hash bucket %d.\n", hash);
+ debug(2, "Performing lookup on hash bucket %d.\n", hash);
#endif
walk_ptr = CVHashTbl[hash];
while (walk_ptr != NULL) {
@@ -350,7 +350,7 @@ int CVAR_RegisterFunc(cv_func_t func, const char *func_name,
hash = CVAR_HashString(func_name);
#ifdef CVAR_TRACE
- printf("Added FUNC cvar to hash bucket %d.\n", hash);
+ debug(2, "Added FUNC cvar to hash bucket %d.\n", hash);
#endif
return CVAR_Add(hash, &new_cvar);
@@ -373,7 +373,7 @@ int CVAR_Register_I(cv_int_t * var_p, const char *var_name,
hash = CVAR_HashString(var_name);
#ifdef CVAR_TRACE
- printf("Added INT cvar to hash bucket %d.\n", hash);
+ debug(2, "Added INT cvar to hash bucket %d.\n", hash);
#endif
return CVAR_Add(hash, &new_cvar);
@@ -395,7 +395,7 @@ int CVAR_Register_UI(cv_uint16_t * var_p, const char *var_name,
hash = CVAR_HashString(var_name);
#ifdef CVAR_TRACE
- printf("Added UNSIGNED INT ccvar to hash bucket %d.\n", hash);
+ debug(2, "Added UNSIGNED INT ccvar to hash bucket %d.\n", hash);
#endif
return CVAR_Add(hash, &new_cvar);
@@ -417,7 +417,7 @@ int CVAR_Register_F(cv_float_t * var_p, const char *var_name,
hash = CVAR_HashString(var_name);
#ifdef CVAR_TRACE
- printf("Added FLOAT cvar to hash bucket %d.\n", hash);
+ debug(2, "Added FLOAT cvar to hash bucket %d.\n", hash);
#endif
return CVAR_Add(hash, &new_cvar);
@@ -438,7 +438,7 @@ int CVAR_Register_S(cv_char_t * var_str, const char *var_name, const char *secti
hash = CVAR_HashString(var_name);
#ifdef CVAR_TRACE
- printf("Added UNSIGNED INT var to hash bucket %d.\n", hash);
+ debug(2, "Added UNSIGNED INT var to hash bucket %d.\n", hash);
#endif
return CVAR_Add(hash, &new_cvar);
diff --git a/saga/sdebug.cpp b/saga/sdebug.cpp
index 866a9da9f7..2064533758 100644
--- a/saga/sdebug.cpp
+++ b/saga/sdebug.cpp
@@ -104,10 +104,10 @@ int Script::SDebugPrintInstr(SCRIPT_THREAD *thread) {
SD_ADDTXT(tmp_buf);
/*
if(( param >= 0 ) && ( param < diag_list->n_dialogue )) {
- printf(" ; \"%.*s\"", SCRIPT_STRINGLIMIT, diag_list->str[param] );
+ debug(2, " ; \"%.*s\"", SCRIPT_STRINGLIMIT, diag_list->str[param] );
}
else {
- printf(" ; Invalid dialogue string.\n" );
+ debug(2, " ; Invalid dialogue string.\n" );
}
*/
}
@@ -245,7 +245,7 @@ int Script::SDebugPrintInstr(SCRIPT_THREAD *thread) {
/*
for( i = 0 ; i < script_list->n_scripts ; i++ ) {
if( op_offset == script_list->scripts[i].offset ) {
- printf("; Entrypoint \"%s\".", script_list->scriptl_p + script_list->scripts[i].name_offset );
+ debug(2, "; Entrypoint \"%s\".", script_list->scriptl_p + script_list->scripts[i].name_offset );
break;
}
}
@@ -348,10 +348,9 @@ int Script::SDebugPrintInstr(SCRIPT_THREAD *thread) {
sprintf(tmp_buf, "%04X", n_switch2);
SD_ADDTXT(tmp_buf);
for (i = 0; i < n_switch2; i++) {
- //printf("\n");
switch_num = readS.readUint16LE();
switch_jmp = readS.readUint16LE();
- //printf( TAB "WEIGHT %04X, %04X", switch_num, switch_jmp);
+ //debug(2, "WEIGHT %04X, %04X", switch_num, switch_jmp);
}
}
break;
diff --git a/saga/sthread.cpp b/saga/sthread.cpp
index 864b86d351..161f51362d 100644
--- a/saga/sthread.cpp
+++ b/saga/sthread.cpp
@@ -556,25 +556,25 @@ int Script::SThreadRun(SCRIPT_THREAD *thread, int instr_limit) {
break;
case 0x28: // inc_v increment, don't push
unhandled = 1;
- printf("??? ");
+ //debug(2, "??? ");
scriptS.readByte();
scriptS.readUint16LE();
break;
case 0x29: // dec_v decrement, don't push
unhandled = 1;
- printf("??? ");
+ //debug(2, "??? ");
scriptS.readByte();
scriptS.readUint16LE();
break;
case 0x2A: // postinc
unhandled = 1;
- printf("??? ");
+ //debug(2, "??? ");
scriptS.readByte();
scriptS.readUint16LE();
break;
case 0x2B: // postdec
unhandled = 1;
- printf("??? ");
+ //debug(2, "??? ");
scriptS.readByte();
scriptS.readUint16LE();
break;
@@ -793,15 +793,13 @@ int Script::SThreadRun(SCRIPT_THREAD *thread, int instr_limit) {
// (DLGO): Add a dialogue option to interface
case 0x56:
{
- printf("DLGO | ");
+ SDataWord_T param3 = 0;
param1 = scriptS.readByte();
param2 = scriptS.readByte();
- printf("%02X %02X ", param1, param2);
-
if (param2 > 0) {
- SDataWord_T param3 = scriptS.readUint16LE();
- printf("%04X", param3);
+ param3 = scriptS.readUint16LE();
}
+ debug(2, "DLGO | %02X %02X %04X", param1, param2, param3);
}
break;
case 0x57: // animate