aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/debug.cpp
diff options
context:
space:
mode:
authorTravis Howell2006-09-30 05:51:06 +0000
committerTravis Howell2006-09-30 05:51:06 +0000
commitf5c5a64d72dbe2d5017efcb8cca0aeb7326ddef8 (patch)
tree74171b4658914c3ef717b282812930a728d33169 /engines/agos/debug.cpp
parent54d3405225694231eec986089f59e0b067631ca9 (diff)
downloadscummvm-rg350-f5c5a64d72dbe2d5017efcb8cca0aeb7326ddef8.tar.gz
scummvm-rg350-f5c5a64d72dbe2d5017efcb8cca0aeb7326ddef8.tar.bz2
scummvm-rg350-f5c5a64d72dbe2d5017efcb8cca0aeb7326ddef8.zip
Add opcode table for Elvira 2 and cleanup
svn-id: r24025
Diffstat (limited to 'engines/agos/debug.cpp')
-rw-r--r--engines/agos/debug.cpp32
1 files changed, 20 insertions, 12 deletions
diff --git a/engines/agos/debug.cpp b/engines/agos/debug.cpp
index d8d8bc5f45..d422832532 100644
--- a/engines/agos/debug.cpp
+++ b/engines/agos/debug.cpp
@@ -95,24 +95,32 @@ const byte *AGOSEngine::dumpOpcode(const byte *p) {
}
case 'W':{
- int n = (int16)((p[0] << 8) | p[1]);
+ int n = (int16)READ_BE_UINT16(p);
p += 2;
- if (n >= 30000 && n < 30512)
- printf("[%d] ", n - 30000);
- else
- printf("%d ", n);
+ if (getGameType() == GType_PP) {
+ if (n >= 60000 && n < 62048)
+ printf("[%d] ", n - 60000);
+ else
+ printf("%d ", n);
+
+ } else {
+ if (n >= 30000 && n < 30512)
+ printf("[%d] ", n - 30000);
+ else
+ printf("%d ", n);
+ }
break;
}
case 'w':{
- int n = (int16)((p[0] << 8) | p[1]);
+ int n = (int16)READ_BE_UINT16(p);
p += 2;
printf("%d ", n);
break;
}
case 'I':{
- int n = (int16)((p[0] << 8) | p[1]);;
+ int n = (int16)READ_BE_UINT16(p);
p += 2;
if (n == -1)
printf("ITEM_M1 ");
@@ -135,7 +143,7 @@ const byte *AGOSEngine::dumpOpcode(const byte *p) {
break;
case 'T':{
- uint n = ((p[0] << 8) | p[1]);
+ uint n = READ_BE_UINT16(p);
p += 2;
if (n != 0xFFFF)
printf("\"%s\"(%d) ", getStringPtrByID(n), n);
@@ -188,11 +196,11 @@ void AGOSEngine::dump_video_script(const byte *src, bool one_opcode_only) {
const char *str, *strn;
do {
- if (getGameType() == GType_SIMON1 || getGameType() == GType_WW) {
+ if (getGameType() == GType_SIMON2 || getGameType() == GType_FF || getGameType() == GType_PP) {
+ opcode = *src++;
+ } else {
opcode = READ_BE_UINT16(src);
src += 2;
- } else {
- opcode = *src++;
}
if (opcode >= _numVideoOpcodes) {
@@ -338,7 +346,7 @@ void dump_bmp(const char *filename, int w, int h, const byte *bytes, const uint3
void AGOSEngine::dump_bitmap(const char *filename, const byte *offs, int w, int h, int flags, const byte *palette,
byte base) {
- if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2)
+ if (getGameType() != GType_FF && getGameType() != GType_PP)
w *= 16;
/* allocate */