aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2005-10-09 09:03:37 +0000
committerTravis Howell2005-10-09 09:03:37 +0000
commit6b897dd90b26baf4453cd116ed25bb122a3232c8 (patch)
tree457ced7d92db4414a43338c07cb04ac258863408
parentd67009d5e5c4460a3d8ec2c4d9d7f70ce4bc6be2 (diff)
downloadscummvm-rg350-6b897dd90b26baf4453cd116ed25bb122a3232c8.tar.gz
scummvm-rg350-6b897dd90b26baf4453cd116ed25bb122a3232c8.tar.bz2
scummvm-rg350-6b897dd90b26baf4453cd116ed25bb122a3232c8.zip
Add more stubs for FF.
Disable scale images in FF for now. svn-id: r18987
-rw-r--r--simon/debug.cpp10
-rw-r--r--simon/debug.h131
-rw-r--r--simon/items.cpp29
-rw-r--r--simon/res.cpp3
-rw-r--r--simon/simon.cpp25
-rw-r--r--simon/simon.h14
-rw-r--r--simon/vga.cpp120
7 files changed, 293 insertions, 39 deletions
diff --git a/simon/debug.cpp b/simon/debug.cpp
index 1cd466eddc..27e666f1fc 100644
--- a/simon/debug.cpp
+++ b/simon/debug.cpp
@@ -47,7 +47,7 @@ const byte *SimonEngine::dumpOpcode(const byte *p) {
st = s = simon1dos_opcode_name_table[opcode];
}
if (s == NULL) {
- error("INVALID OPCODE %d", opcode);
+ //error("INVALID OPCODE %d", opcode);
return NULL;
}
while (*st != '|')
@@ -186,10 +186,12 @@ void SimonEngine::dump_video_script(const byte *src, bool one_opcode_only) {
return;
}
- if (!(_game & GF_SIMON2)) {
- strn = str = simon1_video_opcode_name_table[opcode];
- } else {
+ if (_game == GAME_FEEBLEFILES) {
+ strn = str = feeblefiles_video_opcode_name_table[opcode];
+ } else if (_game & GF_SIMON2) {
strn = str = simon2_video_opcode_name_table[opcode];
+ } else {
+ strn = str = simon1_video_opcode_name_table[opcode];
}
while (*strn != '|')
diff --git a/simon/debug.h b/simon/debug.h
index cb06c75847..0aa5036101 100644
--- a/simon/debug.h
+++ b/simon/debug.h
@@ -985,11 +985,11 @@ static const char *const simon2talkie_opcode_name_table[256] = {
const char *const simon1_video_opcode_name_table[] = {
/* 0 */
"x|RET",
- "ddd|DUMMY_1",
+ "ddd|FADEOUT",
"d|CALL",
"ddddd|NEW_SPRITE",
/* 4 */
- "ddd|DUMMY_4",
+ "ddd|FADEIN",
"vd|SKIP_IF_NEQ",
"d|SKIP_IFN_SIB_WITH_A",
"d|SKIP_IF_SIB_WITH_A",
@@ -1057,22 +1057,22 @@ const char *const simon1_video_opcode_name_table[] = {
"|DUMMY_56",
"|DUMMY_57",
"|UNK_58",
- "|SKIP_IF_NO_SPEECH",
+ "|SKIP_IF_SPEECH_ENDED",
/* 60 */
"d|KILL_SPRITE",
"ddd|INIT_SPRITE",
- "|PALETTE_THING",
- "|PALETTE_THING_2",
+ "|FASTFADEOUT",
+ "|FASTFADEIN",
};
const char *const simon2_video_opcode_name_table[] = {
/* 0 */
"x|RET",
- "ddd|DUMMY_1",
+ "ddd|FADEOUT",
"d|CALL",
"ddddd|NEW_SPRITE",
/* 4 */
- "ddd|DUMMY_4",
+ "ddd|FADEIN",
"vd|SKIP_IF_NEQ",
"d|SKIP_IFN_SIB_WITH_A",
"d|SKIP_IF_SIB_WITH_A",
@@ -1144,10 +1144,10 @@ const char *const simon2_video_opcode_name_table[] = {
/* 60 */
"dd|KILL_SPRITE",
"ddd|INIT_SPRITE",
- "|PALETTE_THING",
- "|PALETTE_THING_2",
+ "|FASTFADEOUT",
+ "|FASTFADEIN",
/* 64 */
- "|SKIP_IF_NO_SPEECH",
+ "|SKIP_IF_SPEECH_ENDED",
"|PALETTE_THING_3",
"|SKIP_IF_NZ",
"|SKIP_IF_GE",
@@ -1158,8 +1158,115 @@ const char *const simon2_video_opcode_name_table[] = {
"|CHECK_MUSIC_QUEUE",
/* 72 */
"dd|PLAY_TRACK_2",
- "bb|SET_OP189_FLAG",
- "bb|CLEAR_OP189_FLAG",
+ "bb|SET_MARK",
+ "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",
+ "ddd|SETSCALEXOFFS",
+ "ddd|SETSCALEYOFFS",
+ "|PATHUNK1",
+ "|PATHUNK1",
+ "ddd|SETOVERLAPIMAGE",
+ "dd|SETRANDOM",
+ "d|PATHUNK3",
+ "ddd|PLAYSOUNDLOOP",
+ "|STOPSOUNDLOOP",
};
} // End of namespace Simon
diff --git a/simon/items.cpp b/simon/items.cpp
index f777cb679b..2fa2ea2dfe 100644
--- a/simon/items.cpp
+++ b/simon/items.cpp
@@ -757,9 +757,14 @@ int SimonEngine::runScript() {
break;
case 135:{ /* quit if user presses y */
- _system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
- o_quit_if_user_presses_y();
- _system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
+ if (_game == GAME_FEEBLEFILES) {
+ // Switch CD
+ debug(1, "Switch to CD number %d", readVariable(97));
+ } else {
+ _system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
+ o_quit_if_user_presses_y();
+ _system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
+ }
}
break;
@@ -1006,16 +1011,26 @@ int SimonEngine::runScript() {
break;
case 182:{ /* read vgares 328 */
- if (_game & GF_SIMON2)
+ if (_game == GAME_FEEBLEFILES) {
+ // Load Smacker filename
+ debug(1,"Load Smacker: %s", getStringPtrByID(getNextStringID()));
+ } else if (_game & GF_SIMON2) {
goto invalid_opcode;
- o_read_vgares_328();
+ } else {
+ o_read_vgares_328();
+ }
}
break;
case 183:{ /* read vgares 23 */
- if (_game & GF_SIMON2)
+ if (_game == GAME_FEEBLEFILES) {
+ // Play Smacker
+ debug(1, "Play Smacker");
+ } else if (_game & GF_SIMON2) {
goto invalid_opcode;
- o_read_vgares_23();
+ } else {
+ o_read_vgares_23();
+ }
}
break;
diff --git a/simon/res.cpp b/simon/res.cpp
index 3845f2fa2e..69827c1b5a 100644
--- a/simon/res.cpp
+++ b/simon/res.cpp
@@ -27,7 +27,6 @@
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 ",
@@ -262,7 +261,7 @@ void SimonEngine::readItemChildren(Common::File *in, Item *item, uint type) {
child->string_id = (uint16)in->readUint32BE();
} else {
- error("readItemChildren: invalid mode");
+ error("readItemChildren: invalid type %d", type);
}
}
diff --git a/simon/simon.cpp b/simon/simon.cpp
index 079c649a68..d13501c52a 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -264,12 +264,12 @@ static const GameSpecificSettings simon2dos_settings = {
};
static const GameSpecificSettings feeblefiles_settings = {
- "", // gme_filename
- "", // wav_filename
- "", // voc_filename
- "", // mp3_filename
- "", // vorbis_filename
- "", // flac_filename
+ "", // gme_filename
+ "VOICES.WAV", // wav_filename
+ "VOICES.VOC", // voc_filename
+ "VOICES.MP3", // mp3_filename
+ "VOICES.OGG", // vorbis_filename
+ "VOICES.FLA", // flac_filename
"", // voc_effects_filename
"", // mp3_effects_filename
"", // vorbis_effects_filename
@@ -362,7 +362,15 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
}
VGA_DELAY_BASE = 1;
- if (_game & GF_SIMON2) {
+ if (_game == GAME_FEEBLEFILES) {
+ NUM_VIDEO_OP_CODES = 85;
+#ifndef __PALM_OS__
+ VGA_MEM_SIZE = 2000000;
+#else
+ VGA_MEM_SIZE = gVars->memory[kMemSimon2Games];
+#endif
+ TABLES_MEM_SIZE = 100000;
+ } else if (_game & GF_SIMON2) {
TABLE_INDEX_BASE = 1580 / 4;
TEXT_INDEX_BASE = 1500 / 4;
NUM_VIDEO_OP_CODES = 75;
@@ -525,10 +533,13 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
_scriptUnk1 = 0;
_vgaVar6 = 0;
_scrollX = 0;
+ _scrollY = 0;
_scrollXMax = 0;
+ _scrollYMax = 0;
_scrollCount = 0;
_scrollFlag = 0;
_scrollHeight = 0;
+ _scrollWidth = 0;
_scrollImage = 0;
_vgaVar8 = 0;
diff --git a/simon/simon.h b/simon/simon.h
index 4e503028a4..66db7c77ae 100644
--- a/simon/simon.h
+++ b/simon/simon.h
@@ -211,7 +211,9 @@ protected:
bool _vgaVar9;
int16 _scriptUnk1;
bool _vgaVar6;
- int _scrollX, _scrollXMax, _scrollCount, _scrollFlag, _scrollHeight;
+ int _scrollX, _scrollXMax, _scrollHeight;
+ int _scrollY, _scrollYMax, _scrollWidth;
+ int _scrollCount, _scrollFlag;
const byte *_scrollImage;
byte _vgaVar8;
@@ -690,6 +692,16 @@ public:
void vc72_play_track_2();
void vc73_setMark();
void vc74_clearMark();
+ void vc75_setScale();
+ void vc76_setScaleXOffs();
+ void vc77_setScaleYOffs();
+ void vc78_pathUnk1();
+ void vc79_pathUnk2();
+ void vc80_setOverlayImage();
+ void vc81_setRandom();
+ void vc82_pathUnk3();
+ void vc83_playSoundLoop();
+ void vc84_stopSoundLoop();
protected:
void delete_vga_timer(VgaTimerEntry * vte);
diff --git a/simon/vga.cpp b/simon/vga.cpp
index 9bdad852f0..0ef08aebb1 100644
--- a/simon/vga.cpp
+++ b/simon/vga.cpp
@@ -108,6 +108,16 @@ static const VgaOpcodeProc vga_opcode_table[] = {
&SimonEngine::vc72_play_track_2,
&SimonEngine::vc73_setMark,
&SimonEngine::vc74_clearMark,
+ &SimonEngine::vc75_setScale,
+ &SimonEngine::vc76_setScaleXOffs,
+ &SimonEngine::vc77_setScaleYOffs,
+ &SimonEngine::vc78_pathUnk1,
+ &SimonEngine::vc79_pathUnk2,
+ &SimonEngine::vc80_setOverlayImage,
+ &SimonEngine::vc81_setRandom,
+ &SimonEngine::vc82_pathUnk3,
+ &SimonEngine::vc83_playSoundLoop,
+ &SimonEngine::vc84_stopSoundLoop,
};
// Script parser
@@ -186,7 +196,24 @@ void SimonEngine::vc_skip_next_instruction() {
4, 2, 2
};
- if (_game & GF_SIMON2) {
+ static const byte opcode_param_len_feeblefiles[] = {
+ 0, 6, 2, 12, 6, 4, 2, 2,
+ 4, 4, 9, 0, 1, 2, 2, 2,
+ 2, 0, 2, 0, 4, 2, 4, 2,
+ 7, 0, 10, 0, 8, 0, 2, 2,
+ 4, 0, 0, 4, 4, 2, 2, 4,
+ 4, 4, 4, 2, 2, 2, 2, 4,
+ 0, 2, 2, 2, 6, 6, 6, 6,
+ 2, 0, 6, 6, 4, 6, 0, 0,
+ 0, 0, 4, 4, 4, 4, 4, 0,
+ 4, 2, 2, 4, 6, 6, 0, 0,
+ 6, 4, 2, 6, 0
+ };
+
+ if (_game == GAME_FEEBLEFILES) {
+ uint opcode = vc_read_next_byte();
+ _vcPtr += opcode_param_len_feeblefiles[opcode];
+ } else if (_game & GF_SIMON2) {
uint opcode = vc_read_next_byte();
_vcPtr += opcode_param_len_simon2[opcode];
} else {
@@ -637,7 +664,7 @@ void SimonEngine::vc10_draw() {
height = p2[5];
flags = p2[4];
- debug(1, "Width %d Height %d Flags 0x%x\n", width, height, flags);
+ debug(1, "Width %d Height %d Flags 0x%x", width, height, flags);
if (height == 0 || width == 0)
return;
@@ -646,6 +673,10 @@ void SimonEngine::vc10_draw() {
dump_single_bitmap(_vgaCurFileId, state.image, state.depack_src, width * 16, height,
state.palette);
+ // TODO::Add support for image scaling
+ if (flags & 0x40)
+ return;
+
if (flags & 0x80 && !(state.flags & 0x10)) {
if (state.flags & 1) {
state.flags &= ~1;
@@ -669,7 +700,7 @@ void SimonEngine::vc10_draw() {
_scrollX = state.x;
- vc_write_var(0xfb, _scrollX);
+ vc_write_var(251, _scrollX);
dst = dx_lock_attached();
src = state.depack_src + _scrollX * 4;
@@ -1513,7 +1544,11 @@ void SimonEngine::vc51_clear_hitarea_bit_0x40() {
void SimonEngine::vc52_playSound() {
uint16 sound_id = vc_read_next_word();
- if (_game & GF_SIMON2) {
+ if (_game == GAME_FEEBLEFILES) {
+ uint16 pan = vc_read_next_word();
+ uint16 vol = vc_read_next_word();
+ debug(0, "STUB: vc52_playSound: snd %d pan %d vol %d", sound_id, pan, vol);
+ } else if (_game & GF_SIMON2) {
if (sound_id >= 0x8000) {
sound_id = -sound_id;
_sound->playAmbient(sound_id);
@@ -1528,8 +1563,11 @@ void SimonEngine::vc52_playSound() {
}
void SimonEngine::vc53_no_op() {
- /* unused */
- _vcPtr += 4;
+ // Start sound effect, panning it with the animation
+ int snd = vc_read_next_word();
+ int xoffs = vc_read_next_word();
+ int vol = vc_read_next_word();
+ debug(0, "STUB: vc53_no_op: snd %d xoffs %d vol %d", snd, xoffs, vol);
}
void SimonEngine::vc54_no_op() {
@@ -1887,4 +1925,74 @@ void SimonEngine::vc74_clearMark() {
_marks &= ~(1 << vc_read_next_byte());
}
+void SimonEngine::vc75_setScale() {
+ // Set scale
+ int baseY = vc_read_next_word();
+ int scale = vc_read_next_word();
+ debug(0, "STUB: vc75_setScale: baseY %d scale %d", baseY, scale);
+}
+
+void SimonEngine::vc76_setScaleXOffs() {
+ // Scale X related
+ int image = vc_read_next_word();
+ int xoffs = vc_read_next_word();
+ int var = vc_read_next_word();
+ debug(0, "STUB: vc76_setScaleXOffs: image %d xoffs %d flag %d", image, xoffs, var);
+}
+
+void SimonEngine::vc77_setScaleYOffs() {
+ // Scale Y related
+ int image = vc_read_next_word();
+ int yoffs = vc_read_next_word();
+ int var = vc_read_next_word();
+ debug(0, "STUB: vc77_setScaleYOffs: image %d yoffs %d flag %d", image, yoffs, var);
+}
+
+void SimonEngine::vc78_pathUnk1() {
+ // Pathfinder related
+ debug(0, "STUB: vc78_pathUnk1");
+}
+
+void SimonEngine::vc79_pathUnk2() {
+ // Pathfinder related
+ debug(0, "STUB: vc79_pathUnk2");
+}
+
+void SimonEngine::vc80_setOverlayImage() {
+ VgaSprite *vsp = find_cur_sprite();
+
+ vsp->image = vc_read_var_or_word();
+
+ vsp->x += vc_read_next_word();
+ vsp->y += vc_read_next_word();
+ vsp->flags = 0x10;
+
+ _vgaSpriteChanged++;
+}
+
+void SimonEngine::vc81_setRandom() {
+ uint var = vc_read_next_word();
+ uint value = vc_read_next_word();
+ writeVariable(var, _rnd.getRandomNumber(value - 1));
+}
+
+void SimonEngine::vc82_pathUnk3() {
+ // Set var to path position
+ int var = vc_read_next_word();
+ debug(0, "STUB: vc82_pathUnk3: var %d", var);
+}
+
+void SimonEngine::vc83_playSoundLoop() {
+ // Start looping sound effect
+ int snd = vc_read_next_word();
+ int vol = vc_read_next_word();
+ int pan = vc_read_next_word();
+ debug(0, "STUB: vc83_playSoundLoop: snd %d vol %d pan %d", snd, vol, pan);
+}
+
+void SimonEngine::vc84_stopSoundLoop() {
+ // Stop looping sound effect
+ debug(0, "STUB: vc84_stopSoundLoop");
+}
+
} // End of namespace Simon