Permalink
Browse files

Backport game detection changes for Simon engine, as suggested.

svn-id: r20177
  • Loading branch information...
Travis Howell
Travis Howell committed Jan 26, 2006
1 parent 19289e0 commit eee5b6056e0cbab9b3e47261b38f683f03f99705
Showing with 568 additions and 1,179 deletions.
  1. +0 −10 README
  2. +6 −6 simon/charset.cpp
  3. +1 −1 simon/cursor.cpp
  4. +11 −14 simon/debug.cpp
  5. +0 −109 simon/debug.h
  6. +4 −4 simon/debugger.cpp
  7. +0 −54 simon/game.cpp
  8. +5 −5 simon/icons.cpp
  9. +58 −24 simon/intern.h
  10. +37 −179 simon/items.cpp
  11. +1 −0 simon/module.mk
  12. +4 −33 simon/res.cpp
  13. +6 −31 simon/saveload.cpp
  14. +269 −418 simon/simon.cpp
  15. +42 −12 simon/simon.h
  16. +11 −10 simon/sound.cpp
  17. +4 −2 simon/sound.h
  18. +49 −21 simon/verb.cpp
  19. +60 −215 simon/vga.cpp
  20. +0 −31 simon/vga.h
10 README
@@ -220,16 +220,6 @@ any answer. Chances are that it will work.
3.2) Simon the Sorcerer 1 and 2 notes:
---- ---------------------------------
The current game targets are:
simon1acorn - Use for Simon the Sorcerer 1 (Acorn CD)
simon1dos - Use for Simon the Sorcerer 1 (DOS Floppy)
simon2dos - Use for Simon the Sorcerer 2 (DOS Floppy)
simon1talkie - Use for Simon the Sorcerer 1 (DOS/Windows CD)
simon2talkie - Use for Simon the Sorcerer 2 (Amiga/DOS/Mac/Windows CD)
Also make sure that the platform setting is correct, since it is used
to tell the difference between the various ports of the games.
If you have the dual version of Simon the Sorcerer 1 or 2 on CD,
then you will find the Windows version in the main directory of CD
and the DOS version in the DOS directory of the CD.
@@ -176,7 +176,7 @@ void SimonEngine::render_string(uint vga_sprite_id, uint color, uint width, uint
dst += READ_BE_UINT32(p);
memset(dst, 0, count);
if (_language == 20)
if (_language == Common::HB_ISR)
dst += width - 1; // For Hebrew, start at the right edge, not the left.
dst_org = dst;
@@ -185,13 +185,13 @@ void SimonEngine::render_string(uint vga_sprite_id, uint color, uint width, uint
dst_org += width * 10;
dst = dst_org;
} else if ((chr -= ' ') == 0) {
dst += (_language == 20 ? -6 : 6); // Hebrew moves to the left, all others to the right
dst += (_language == Common::HB_ISR ? -6 : 6); // Hebrew moves to the left, all others to the right
} else {
byte *img_hdr = src + 48 + chr * 4;
uint img_height = img_hdr[2];
uint img_width = img_hdr[3], i;
byte *img = src + READ_LE_UINT16(img_hdr);
if (_language == 20)
if (_language == Common::HB_ISR)
dst -= img_width - 1; // For Hebrew, move from right edge to left edge of image.
byte *cur_dst = dst;
@@ -211,7 +211,7 @@ void SimonEngine::render_string(uint vga_sprite_id, uint color, uint width, uint
cur_dst += width;
} while (--img_height);
if (_language != 20) // Hebrew character movement is done higher up
if (_language != Common::HB_ISR) // Hebrew character movement is done higher up
dst += img_width - 1;
}
}
@@ -302,7 +302,7 @@ void SimonEngine::video_putchar(FillOrCopyStruct *fcs, byte c, byte b) {
} else if (c == 0xD || c == 0xA) {
video_putchar_newline(fcs);
} else if ((c == 1 && _language != 20) || (c == 8)) {
if (_language == 20) { //Hebrew
if (_language == Common::HB_ISR) { //Hebrew
if (b >= 64 && b < 91)
width = _hebrew_char_widths [b - 64];
@@ -334,7 +334,7 @@ void SimonEngine::video_putchar(FillOrCopyStruct *fcs, byte c, byte b) {
fcs->textRow--;
}
if (_language == 20) { //Hebrew
if (_language == Common::HB_ISR) { //Hebrew
if (c >= 64 && c < 91)
width = _hebrew_char_widths [c - 64];
fcs->textColumnOffset -= width;
@@ -223,7 +223,7 @@ static const byte _simon2_cursors[10][256] = {
};
void SimonEngine::draw_mouse_pointer() {
if (_game & GF_SIMON2)
if (getGameType() == GType_SIMON2)
_system->setMouseCursor(_simon2_cursors[_mouseCursor], 16, 16, 7, 7);
else
_system->setMouseCursor(_simon1_cursor, 16, 16, 0, 0);
@@ -37,11 +37,11 @@ const byte *SimonEngine::dumpOpcode(const byte *p) {
opcode = *p++;
if (opcode == 255)
return NULL;
if (_game & GF_SIMON2 && _game & GF_TALKIE) {
if (getGameType() == GType_SIMON2 && getFeatures() & GF_TALKIE) {
st = s = simon2talkie_opcode_name_table[opcode];
} else if (_game & GF_TALKIE) {
} else if (getFeatures() & GF_TALKIE) {
st = s = simon1talkie_opcode_name_table[opcode];
} else if (_game & GF_SIMON2) {
} else if (getGameType() == GType_SIMON2) {
st = s = simon2dos_opcode_name_table[opcode];
} else {
st = s = simon1dos_opcode_name_table[opcode];
@@ -174,7 +174,7 @@ void SimonEngine::dump_video_script(const byte *src, bool one_opcode_only) {
const char *str, *strn;
do {
if (!(_game & GF_SIMON2)) {
if (getGameType() == GType_SIMON1) {
opcode = READ_BE_UINT16(src);
src += 2;
} else {
@@ -186,9 +186,7 @@ void SimonEngine::dump_video_script(const byte *src, bool one_opcode_only) {
return;
}
if (_game == GAME_FEEBLEFILES) {
strn = str = feeblefiles_video_opcode_name_table[opcode];
} else if (_game & GF_SIMON2) {
if (getGameType() == GType_SIMON2) {
strn = str = simon2_video_opcode_name_table[opcode];
} else {
strn = str = simon1_video_opcode_name_table[opcode];
@@ -198,7 +196,6 @@ void SimonEngine::dump_video_script(const byte *src, bool one_opcode_only) {
strn++;
fprintf(_dumpFile, "%.2d: %s ", opcode, strn + 1);
int end = (_game == GAME_FEEBLEFILES) ? 9999 : 999;
for (; *str != '|'; str++) {
switch (*str) {
case 'x':
@@ -208,21 +205,21 @@ void SimonEngine::dump_video_script(const byte *src, bool one_opcode_only) {
fprintf(_dumpFile, "%d ", *src++);
break;
case 'd':
fprintf(_dumpFile, "%d ", readUint16Wrapper(src));
fprintf(_dumpFile, "%d ", READ_BE_UINT16(src));
src += 2;
break;
case 'v':
fprintf(_dumpFile, "[%d] ", readUint16Wrapper(src));
fprintf(_dumpFile, "[%d] ", READ_BE_UINT16(src));
src += 2;
break;
case 'i':
fprintf(_dumpFile, "%d ", (int16)readUint16Wrapper(src));
fprintf(_dumpFile, "%d ", (int16)READ_BE_UINT16(src));
src += 2;
break;
case 'q':
while (readUint16Wrapper(src) != end) {
fprintf(_dumpFile, "(%d,%d) ", readUint16Wrapper(src),
readUint16Wrapper(src + 2));
while (READ_BE_UINT16(src) != 999) {
fprintf(_dumpFile, "(%d,%d) ", READ_BE_UINT16(src),
READ_BE_UINT16(src + 2));
src += 4;
}
src++;
@@ -1162,115 +1162,6 @@ const char *const simon2_video_opcode_name_table[] = {
"bb|CLEAR_MARK",
};
const char *const feeblefiles_video_opcode_name_table[] = {
/* 0 */
"x|RET",
"ddd|FADEOUT",
"d|CALL",
"ddddd|NEW_SPRITE",
/* 4 */
"ddd|FADEIN",
"vd|SKIP_IF_NEQ",
"d|SKIP_IFN_SIB_WITH_A",
"d|SKIP_IF_SIB_WITH_A",
/* 8 */
"dd|SKIP_IF_PARENT_IS",
"dd|SKIP_IF_UNK3_IS",
"ddddb|DRAW",
"|CLEAR_PATHFIND_ARRAY",
/* 12 */
"b|DELAY",
"d|SET_SPRITE_OFFSET_X",
"d|SET_SPRITE_OFFSET_Y",
"d|IDENT_WAKEUP",
/* 16 */
"d|IDENT_SLEEP",
"dq|SET_PATHFIND_ITEM",
"i|JUMP_REL",
"|CHAIN_TO",
/* 20 */
"dd|SET_CODE_WORD",
"i|JUMP_IF_CODE_WORD",
"dd|SET_SPRITE_PALETTE",
"d|SET_SPRITE_PRIORITY",
/* 24 */
"diid|SET_SPRITE_XY",
"x|HALT_SPRITE",
"ddddd|SET_WINDOW",
"|RESET",
/* 28 */
"dddd|DUMMY_28",
"|STOP_ALL_SOUNDS",
"d|SET_BASE_DELAY",
"d|SET_PALETTE_MODE",
/* 32 */
"vv|COPY_VAR",
"|FORCE_UNLOCK",
"|FORCE_LOCK",
"dd|VC35",
/* 36 */
"dd|SAVELOAD_THING",
"v|SET_SPRITE_OFFSET_Y",
"v|SKIP_IF_VAR_ZERO",
"vd|SET_VAR",
/* 40 */
"vd|ADD_VAR",
"vd|SUB_VAR",
"vd|DELAY_IF_NOT_EQ",
"d|SKIP_IF_BIT_CLEAR",
/* 44 */
"d|SKIP_IF_BIT_SET",
"v|SET_SPRITE_X",
"v|SET_SPRITE_Y",
"vv|ADD_VAR_F",
/* 48 */
"|VC_48",
"d|SET_BIT",
"d|CLEAR_BIT",
"d|CLEAR_HITAREA_BIT_0x40",
/* 52 */
"ddd|PLAY_SOUND",
"ddd|PLAY_SOUND_WITH_ANIM",
"ddd|DUMMY_54",
"ddd|OFFSET_HIT_AREA",
/* 56 */
"i|SLEEP_EX",
"|DUMMY_57",
"|UNK_58",
"ddd|KILL_MULTI_SPRITE",
/* 60 */
"dd|KILL_SPRITE",
"ddd|INIT_SPRITE",
"|FASTFADEOUT",
"|FASTFADEIN",
/* 64 */
"|SKIP_IF_SPEECH_ENDED",
"|PALETTE_THING_3",
"|SKIP_IF_NZ",
"|SKIP_IF_GE",
/* 68 */
"|SKIP_IF_LE",
"dd|PLAY_TRACK",
"dd|QUEUE_MUSIC",
"|CHECK_MUSIC_QUEUE",
/* 72 */
"dd|PLAY_TRACK_2",
"bb|SET_MARK",
"bb|CLEAR_MARK",
"dd|SETSCALE",
/* 76 */
"ddd|SETSCALEXOFFS",
"ddd|SETSCALEYOFFS",
"|PATHUNK1",
"|PATHUNK1",
/* 80 */
"ddd|SETOVERLAYIMAGE",
"dd|SETRANDOM",
"d|PATHUNK3",
"ddd|PLAYSOUNDLOOP",
"|STOPSOUNDLOOP",
};
} // End of namespace Simon
#endif
@@ -106,10 +106,10 @@ bool Debugger::Cmd_DebugLevel(int argc, const char **argv) {
bool Debugger::Cmd_PlayMusic(int argc, const char **argv) {
if (argc > 1) {
uint music = atoi(argv[1]);
uint range = (_vm->_game & GF_SIMON2) ? 93 : 34;
uint range = (_vm->getGameType() == GType_SIMON2) ? 93 : 34;
if (music <= range) {
_vm->loadMusic (music);
if (_vm->_game & GF_SIMON2)
if (_vm->getGameType() == GType_SIMON2)
_vm->midi.startTrack (0);
} else
DebugPrintf("Music out of range (0 - %d)\n", range);
@@ -122,7 +122,7 @@ bool Debugger::Cmd_PlayMusic(int argc, const char **argv) {
bool Debugger::Cmd_PlaySound(int argc, const char **argv) {
if (argc > 1) {
uint sound = atoi(argv[1]);
uint range = (_vm->_game & GF_SIMON2) ? 222 : 127;
uint range = (_vm->getGameType() == GType_SIMON2) ? 222 : 127;
if (sound <= range)
_vm->_sound->playEffects(sound);
else
@@ -136,7 +136,7 @@ bool Debugger::Cmd_PlaySound(int argc, const char **argv) {
bool Debugger::Cmd_PlayVoice(int argc, const char **argv) {
if (argc > 1) {
uint voice = atoi(argv[1]);
uint range = (_vm->_game & GF_SIMON2) ? 3632 : 1996;
uint range = (_vm->getGameType() == GType_SIMON2) ? 3632 : 1996;
if (voice <= range)
_vm->_sound->playVoice(voice);
else
@@ -285,15 +285,6 @@ static GameMD5 gameMD5[] = {
{ GID_SIMON2WIN_PL, "7b9afcf82a94722707e0d025c0192be8", "simon2.gme", false },
{ GID_SIMON2WIN_PL, "e229f84d46fa83f99b4a7115679f3fb6", "stripped.txt", false},
{ GID_SIMON2WIN_PL, "2082f8d02075e590300478853a91ffd9", "tbllist", false},
{ GID_FEEBLEFILES_2CD, "629762ea9ca9ee9ff85f4774d219f5c7", "game22", false },
{ GID_FEEBLEFILES_2CD, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false},
{ GID_FEEBLEFILES_4CD, "a8746407a5b20a7da0da0a14c380af1c", "game22", false },
{ GID_FEEBLEFILES_4CD, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false},
{ GID_FEEBLEFILES_DE, "bcd76ac080003eee3649df18db25b60e", "game22", false },
{ GID_FEEBLEFILES_DE, "0bbfee8e69739111eb36b0d138da8ddf", "tbllist", false},
};
// Simon the Sorcerer 1
@@ -351,12 +342,6 @@ static GameFileDescription SIMON2_GameFiles[] = {
{"tbllist", GAME_TBLFILE},
};
// The Feeble Files
static GameFileDescription FEEBLEFILES_GameFiles[] = {
{"game22", GAME_BASEFILE},
{"tbllist", GAME_TBLFILE},
};
static GameDescription gameDescriptions[] = {
// Simon the Sorcerer 1 - English Acorn CD Demo
{
@@ -905,45 +890,6 @@ static GameDescription gameDescriptions[] = {
Common::PL_POL,
Common::kPlatformWindows,
},
// The Feeble Files - English 2CD
{
"feeble",
GType_FF,
GID_FEEBLEFILES_2CD,
"The Feeble Files (English 2CD)",
ARRAYSIZE(FEEBLEFILES_GameFiles),
FEEBLEFILES_GameFiles,
GF_OLD_BUNDLE | GF_TALKIE,
Common::EN_USA,
Common::kPlatformWindows,
},
// The Feeble Files - English 4CD
{
"feeble",
GType_FF,
GID_FEEBLEFILES_4CD,
"The Feeble Files (English 4CD)",
ARRAYSIZE(FEEBLEFILES_GameFiles),
FEEBLEFILES_GameFiles,
GF_OLD_BUNDLE | GF_TALKIE,
Common::EN_USA,
Common::kPlatformWindows,
},
// The Feeble Files - German 4CD
{
"feeble",
GType_FF,
GID_FEEBLEFILES_DE,
"The Feeble Files (German 4CD)",
ARRAYSIZE(FEEBLEFILES_GameFiles),
FEEBLEFILES_GameFiles,
GF_OLD_BUNDLE | GF_TALKIE,
Common::DE_DEU,
Common::kPlatformWindows,
},
};
bool SimonEngine::initGame(void) {
Oops, something went wrong.

0 comments on commit eee5b60

Please sign in to comment.