[Scummvm-cvs-logs] SF.net SVN: scummvm: [24138] scummvm/trunk/engines/agos
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Fri Oct 6 10:30:13 CEST 2006
Revision: 24138
http://svn.sourceforge.net/scummvm/?rev=24138&view=rev
Author: kirben
Date: 2006-10-06 01:30:07 -0700 (Fri, 06 Oct 2006)
Log Message:
-----------
Alwats report invalid opcodes when debug output is enabled
Modified Paths:
--------------
scummvm/trunk/engines/agos/agos.h
scummvm/trunk/engines/agos/debug.cpp
scummvm/trunk/engines/agos/vga.cpp
Modified: scummvm/trunk/engines/agos/agos.h
===================================================================
--- scummvm/trunk/engines/agos/agos.h 2006-10-06 08:00:41 UTC (rev 24137)
+++ scummvm/trunk/engines/agos/agos.h 2006-10-06 08:30:07 UTC (rev 24138)
@@ -1195,7 +1195,7 @@
void dx_clear_surfaces(uint num_lines);
void dx_update_screen_and_palette();
- void dump_video_script(const byte *src, bool one_opcode_only);
+ void dumpVideoScript(const byte *src, bool one_opcode_only);
void dump_vga_file(const byte *vga);
void dump_vga_script(const byte *ptr, uint res, uint sprite_id);
void dump_vga_script_always(const byte *ptr, uint res, uint sprite_id);
Modified: scummvm/trunk/engines/agos/debug.cpp
===================================================================
--- scummvm/trunk/engines/agos/debug.cpp 2006-10-06 08:00:41 UTC (rev 24137)
+++ scummvm/trunk/engines/agos/debug.cpp 2006-10-06 08:30:07 UTC (rev 24138)
@@ -65,9 +65,11 @@
} 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::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 @@
if (opcode >= _numVideoOpcodes) {
error("Invalid opcode %x", opcode);
- return;
}
if (getGameType() == GType_FF || getGameType() == GType_PP) {
@@ -223,6 +224,10 @@
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_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");
}
Modified: scummvm/trunk/engines/agos/vga.cpp
===================================================================
--- scummvm/trunk/engines/agos/vga.cpp 2006-10-06 08:00:41 UTC (rev 24137)
+++ scummvm/trunk/engines/agos/vga.cpp 2006-10-06 08:30:07 UTC (rev 24138)
@@ -213,7 +213,7 @@
if (_continousVgaScript) {
if (_vcPtr != (const byte *)&_vc_get_out_of_code) {
printf("%.5d %.5X: %5d %4d ", _vgaTickCounter, (unsigned int)(_vcPtr - _curVgaFile1), _vgaCurSpriteId, _vgaCurZoneNum);
- dump_video_script(_vcPtr, true);
+ dumpVideoScript(_vcPtr, true);
}
}
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