[Scummvm-cvs-logs] CVS: scummvm/simon debug.cpp,1.42,1.43 res.cpp,1.36,1.37 simon.cpp,1.518,1.519 simon.h,1.148,1.149 vga.cpp,1.138,1.139
kirben
kirben at users.sourceforge.net
Tue Oct 11 17:36:45 CEST 2005
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/gob game.cpp,1.26,1.27 goblin.cpp,1.19,1.20 inter.cpp,1.23,1.24 mult.cpp,1.11,1.12 timer.cpp,1.5,1.6
- Next message: [Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.519,1.520
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5589/simon
Modified Files:
debug.cpp res.cpp simon.cpp simon.h vga.cpp
Log Message:
Fix regression, cuased by typo.
Add wrapper as suggested.
Index: debug.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/debug.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- debug.cpp 9 Oct 2005 12:12:24 -0000 1.42
+++ debug.cpp 12 Oct 2005 00:35:52 -0000 1.43
@@ -198,6 +198,7 @@
strn++;
fprintf(_dumpFile, "%.2d: %s ", opcode, strn + 1);
+ int end = (_game == GAME_FEEBLEFILES) ? 9999 : 999;
for (; *str != '|'; str++) {
switch (*str) {
case 'x':
@@ -207,42 +208,22 @@
fprintf(_dumpFile, "%d ", *src++);
break;
case 'd':
- if (_game == GAME_FEEBLEFILES) {
- fprintf(_dumpFile, "%d ", READ_LE_UINT16(src));
- } else {
- fprintf(_dumpFile, "%d ", READ_BE_UINT16(src));
- }
+ fprintf(_dumpFile, "%d ", readUint16Wrapper(src));
src += 2;
break;
case 'v':
- if (_game == GAME_FEEBLEFILES) {
- fprintf(_dumpFile, "[%d] ", READ_LE_UINT16(src));
- } else {
- fprintf(_dumpFile, "[%d] ", READ_BE_UINT16(src));
- }
+ fprintf(_dumpFile, "[%d] ", readUint16Wrapper(src));
src += 2;
break;
case 'i':
- if (_game == GAME_FEEBLEFILES) {
- fprintf(_dumpFile, "%d ", (int16)READ_LE_UINT16(src));
- } else {
- fprintf(_dumpFile, "%d ", (int16)READ_BE_UINT16(src));
- }
+ fprintf(_dumpFile, "%d ", (int16)readUint16Wrapper(src));
src += 2;
break;
case 'q':
- if (_game == GAME_FEEBLEFILES) {
- while (READ_LE_UINT16(src) != 9999) {
- fprintf(_dumpFile, "(%d,%d) ", READ_LE_UINT16(src),
- READ_LE_UINT16(src + 2));
- src += 4;
- }
- } else {
- while (READ_BE_UINT16(src) != 999) {
- fprintf(_dumpFile, "(%d,%d) ", READ_BE_UINT16(src),
- READ_BE_UINT16(src + 2));
- src += 4;
- }
+ while (readUint16Wrapper(src) != end) {
+ fprintf(_dumpFile, "(%d,%d) ", readUint16Wrapper(src),
+ readUint16Wrapper(src + 2));
+ src += 4;
}
src++;
break;
Index: res.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/res.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- res.cpp 9 Oct 2005 09:03:37 -0000 1.36
+++ res.cpp 12 Oct 2005 00:35:53 -0000 1.37
@@ -27,6 +27,7 @@
namespace Simon {
+// Script opcodes to load into memory
static const char *const opcode_arg_table_simon1win[256] = {
" ", "I ", "I ", "I ", "I ", "I ", "I ", "II ", "II ", "II ", "II ", "B ", "B ", "BN ", "BN ",
"BN ", "BN ", "BB ", "BB ", "BB ", "BB ", "II ", "II ", "N ", "I ", "I ", "I ", "IN ", "IB ",
@@ -112,6 +113,13 @@
" ", " ", "BT ", " ", "B ", " ", "BBBB ", " ", " ", "BBBB ", "B ", "B ", "B ", "B "
};
+uint16 SimonEngine::readUint16Wrapper(const void *src) {
+ if (_game == GAME_FEEBLEFILES)
+ return READ_LE_UINT16(src);
+ else
+ return READ_BE_UINT16(src);
+}
+
void SimonEngine::loadGamePcFile(const char *filename) {
Common::File in;
int num_inited_objects;
Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.518
retrieving revision 1.519
diff -u -d -r1.518 -r1.519
--- simon.cpp 9 Oct 2005 12:12:24 -0000 1.518
+++ simon.cpp 12 Oct 2005 00:35:53 -0000 1.519
@@ -75,7 +75,7 @@
{"simon2mac", "Simon the Sorcerer 2 Talkie (Amiga or Mac)", GAME_SIMON2WIN, 0},
{"simon1cd32", "Simon the Sorcerer 1 Talkie (Amiga CD32)", GAME_SIMON1CD32, "gameamiga"},
{"simon1demo", "Simon the Sorcerer 1 (DOS Demo)", GAME_SIMON1DEMO, "GDEMO"},
- {"feeble", "The Feeble Files", GAME_FEEBLEFILES, "GAME22"},
+// {"feeble", "The Feeble Files", GAME_FEEBLEFILES, "GAME22"},
{NULL, NULL, 0, NULL}
};
@@ -2825,17 +2825,10 @@
_windowNum = vsp->windowNum;
_vgaCurSpriteId = vsp->id;
- if (_game == GAME_FEEBLEFILES) {
- params[0] = READ_LE_UINT16(&vsp->image);
- params[1] = READ_LE_UINT16(&vsp->palette);
- params[2] = READ_LE_UINT16(&vsp->x);
- params[3] = READ_LE_UINT16(&vsp->y);
- } else {
- params[0] = READ_BE_UINT16(&vsp->image);
- params[1] = READ_BE_UINT16(&vsp->palette);
- params[2] = READ_BE_UINT16(&vsp->x);
- params[3] = READ_BE_UINT16(&vsp->y);
- }
+ params[0] = readUint16Wrapper(&vsp->image);
+ params[1] = readUint16Wrapper(&vsp->palette);
+ params[2] = readUint16Wrapper(&vsp->x);
+ params[3] = readUint16Wrapper(&vsp->y);
if (_game & GF_SIMON2) {
*(byte *)(¶ms[4]) = (byte)vsp->flags;
@@ -2913,19 +2906,11 @@
if (vsp->image)
fprintf(_dumpFile, "id:%5d image:%3d base-color:%3d x:%3d y:%3d flags:%x\n",
vsp->id, vsp->image, vsp->palette, vsp->x, vsp->y, vsp->flags);
- if (_game == GAME_FEEBLEFILES) {
- params[0] = READ_LE_UINT16(&vsp->image);
- params[1] = READ_LE_UINT16(&vsp->palette);
- params[2] = READ_LE_UINT16(&vsp->x);
- params[3] = READ_LE_UINT16(&vsp->y);
- params[4] = READ_LE_UINT16(&vsp->flags);
- } else {
- params[0] = READ_BE_UINT16(&vsp->image);
- params[1] = READ_BE_UINT16(&vsp->palette);
- params[2] = READ_BE_UINT16(&vsp->x);
- params[3] = READ_BE_UINT16(&vsp->y);
- params[4] = READ_BE_UINT16(&vsp->flags);
- }
+ params[0] = readUint16Wrapper(&vsp->image);
+ params[1] = readUint16Wrapper(&vsp->palette);
+ params[2] = readUint16Wrapper(&vsp->x);
+ params[3] = readUint16Wrapper(&vsp->y);
+ params[4] = readUint16Wrapper(&vsp->flags);
_vcPtr = (const byte *)params;
vc10_draw();
@@ -3128,14 +3113,15 @@
x += _scrollX * 8;
}
+ int end = (_game == GAME_FEEBLEFILES) ? 9999 : 999;
prev_i = 21 - _variableArray[12];
for (i = 20; i != 0; --i) {
p = (const uint16 *)_pathFindArray[20 - i];
if (!p)
continue;
- for (j = 0; READ_BE_UINT16(&p[0]) != 999; j++, p += 2) { // 0xE703 = byteswapped 999
- x_diff = abs((int)(READ_BE_UINT16(&p[0]) - x));
- y_diff = abs((int)(READ_BE_UINT16(&p[1]) - 12 - y));
+ for (j = 0; readUint16Wrapper(&p[0]) != end; j++, p += 2) { // 0xE703 = byteswapped 999
+ x_diff = abs((int)(readUint16Wrapper(&p[0]) - x));
+ y_diff = abs((int)(readUint16Wrapper(&p[1]) - 12 - y));
if (x_diff < y_diff) {
x_diff >>= 2;
Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -d -r1.148 -r1.149
--- simon.h 9 Oct 2005 12:12:24 -0000 1.148
+++ simon.h 12 Oct 2005 00:35:54 -0000 1.149
@@ -380,6 +380,8 @@
virtual ~SimonEngine();
protected:
+ uint16 readUint16Wrapper(const void *src);
+
int allocGamePcVars(Common::File *in);
void loginPlayerHelper(Item *item, int a, int b);
void loginPlayer();
Index: vga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/vga.cpp,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -d -r1.138 -r1.139
--- vga.cpp 9 Oct 2005 12:12:24 -0000 1.138
+++ vga.cpp 12 Oct 2005 00:35:54 -0000 1.139
@@ -158,11 +158,7 @@
uint SimonEngine::vc_read_next_word() {
uint a;
- if (_game == GAME_FEEBLEFILES) {
- a = READ_LE_UINT16(_vcPtr);
- } else {
- a = READ_BE_UINT16(_vcPtr);
- }
+ a = readUint16Wrapper(_vcPtr);
_vcPtr += 2;
return a;
}
@@ -300,7 +296,7 @@
if (_game == GAME_FEEBLEFILES) {
_vcPtr = _curVgaFile1 + READ_LE_UINT16(&((ImageHeader_Feeble *) b)->scriptOffs);
} else {
- _vcPtr = _curVgaFile1 + READ_BE_UINT16(&((ImageHeader_Feeble *) b)->scriptOffs);
+ _vcPtr = _curVgaFile1 + READ_BE_UINT16(&((ImageHeader_Simon *) b)->scriptOffs);
}
//dump_vga_script(_vcPtr, res, num);
@@ -703,7 +699,6 @@
if (_dumpImages)
dump_single_bitmap(_vgaCurFileId, state.image, state.depack_src, width * 16, height,
state.palette);
-
// TODO::Add support for image scaling
if (_game == GAME_FEEBLEFILES)
return;
@@ -1158,13 +1153,9 @@
uint a = vc_read_next_word();
_pathFindArray[a - 1] = (const uint16 *)_vcPtr;
- if (_game == GAME_FEEBLEFILES) {
- while (READ_LE_UINT16(_vcPtr) != 9999)
- _vcPtr += 4;
- } else {
- while (READ_BE_UINT16(_vcPtr) != 999)
- _vcPtr += 4;
- }
+ int end = (_game == GAME_FEEBLEFILES) ? 9999 : 999;
+ while (readUint16Wrapper(_vcPtr) != end)
+ _vcPtr += 4;
_vcPtr += 2;
}
@@ -1545,15 +1536,9 @@
vp = &_variableArray[20];
do {
- if (_game == GAME_FEEBLEFILES) {
- y2 = READ_LE_UINT16(p);
- p += step;
- y1 = READ_LE_UINT16(p) - y2;
- } else {
- y2 = READ_BE_UINT16(p);
- p += step;
- y1 = READ_BE_UINT16(p) - y2;
- }
+ y2 = readUint16Wrapper(p);
+ p += step;
+ y1 = readUint16Wrapper(p) - y2;
vp[0] = y1 >> 1;
vp[1] = y1 - (y1 >> 1);
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/gob game.cpp,1.26,1.27 goblin.cpp,1.19,1.20 inter.cpp,1.23,1.24 mult.cpp,1.11,1.12 timer.cpp,1.5,1.6
- Next message: [Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.519,1.520
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list