aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/debug.cpp
diff options
context:
space:
mode:
authorTravis Howell2006-10-06 08:30:07 +0000
committerTravis Howell2006-10-06 08:30:07 +0000
commitd16c635a12ee3fc7936c00a6204815e057997f52 (patch)
treef3466c1ac36857cad2e0179da5c5a27f1489bdea /engines/agos/debug.cpp
parent86378039412c7f59fcda3cf2191584449f417bee (diff)
downloadscummvm-rg350-d16c635a12ee3fc7936c00a6204815e057997f52.tar.gz
scummvm-rg350-d16c635a12ee3fc7936c00a6204815e057997f52.tar.bz2
scummvm-rg350-d16c635a12ee3fc7936c00a6204815e057997f52.zip
Alwats report invalid opcodes when debug output is enabled
svn-id: r24138
Diffstat (limited to 'engines/agos/debug.cpp')
-rw-r--r--engines/agos/debug.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/engines/agos/debug.cpp b/engines/agos/debug.cpp
index 01c7612b65..205457ae98 100644
--- a/engines/agos/debug.cpp
+++ b/engines/agos/debug.cpp
@@ -65,9 +65,11 @@ const byte *AGOSEngine::dumpOpcode(const byte *p) {
} else {
st = s = elvira1_opcode_name_table[opcode];
}
+
if (s == NULL) {
- error("INVALID OPCODE %d", opcode);
+ error("dumpOpcode: INVALID OPCODE %d", opcode);
}
+
while (*st != '|')
st++;
printf("%s ", st + 1);
@@ -194,7 +196,7 @@ void AGOSEngine::dumpSubroutines() {
}
}
-void AGOSEngine::dump_video_script(const byte *src, bool one_opcode_only) {
+void AGOSEngine::dumpVideoScript(const byte *src, bool one_opcode_only) {
uint opcode;
const char *str, *strn;
@@ -208,7 +210,6 @@ void AGOSEngine::dump_video_script(const byte *src, bool one_opcode_only) {
if (opcode >= _numVideoOpcodes) {
error("Invalid opcode %x", opcode);
- return;
}
if (getGameType() == GType_FF || getGameType() == GType_PP) {
@@ -223,6 +224,10 @@ void AGOSEngine::dump_video_script(const byte *src, bool one_opcode_only) {
strn = str = elvira1_video_opcode_name_table[opcode];
}
+ if (strn == NULL) {
+ error("dumpVideoScript: INVALID OPCODE %d", opcode);
+ }
+
while (*strn != '|')
strn++;
printf("%.2d: %s ", opcode, strn + 1);
@@ -475,7 +480,7 @@ void AGOSEngine::dump_vga_bitmaps(const byte *vga, byte *vga1, int res) {
void AGOSEngine::dump_vga_script_always(const byte *ptr, uint res, uint sprite_id) {
printf("; address=%x, vgafile=%d vgasprite=%d\n",
(unsigned int)(ptr - _vgaBufferPointers[res].vgaFile1), res, sprite_id);
- dump_video_script(ptr, false);
+ dumpVideoScript(ptr, false);
printf("; end\n");
}