2002-04-14 18:13:08 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
2006-01-18 17:39:49 +00:00
|
|
|
* Copyright (C) 2001-2006 The ScummVM project
|
2002-04-14 18:13:08 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-04-14 18:13:08 +00:00
|
|
|
*
|
|
|
|
* $Header$
|
2002-04-12 21:26:59 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2002-08-18 16:21:34 +00:00
|
|
|
#ifndef SIMON_H
|
|
|
|
#define SIMON_H
|
|
|
|
|
2002-08-18 17:48:18 +00:00
|
|
|
#include <stdio.h>
|
2003-09-18 02:07:18 +00:00
|
|
|
#include "base/engine.h"
|
2005-11-12 06:01:24 +00:00
|
|
|
#include "base/gameDetector.h"
|
|
|
|
#include "base/plugins.h"
|
2002-12-01 15:36:36 +00:00
|
|
|
#include "common/util.h"
|
2002-08-18 16:21:34 +00:00
|
|
|
#include "simon/midi.h"
|
2002-11-29 22:13:20 +00:00
|
|
|
#include "simon/sound.h"
|
2005-11-19 11:37:41 +00:00
|
|
|
#include "simon/vga.h"
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2003-11-10 01:04:12 +00:00
|
|
|
class GameDetector;
|
|
|
|
|
2003-10-03 19:42:27 +00:00
|
|
|
namespace Simon {
|
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
/* Various other settings */
|
|
|
|
//#define DUMP_FILE_NR 8
|
|
|
|
//#define DUMP_BITMAPS_FILE_NR 8
|
|
|
|
|
2005-05-10 22:56:25 +00:00
|
|
|
uint fileReadItemID(Common::File *in);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2003-03-06 19:16:24 +00:00
|
|
|
#define CHECK_BOUNDS(x, y) assert((uint)(x) < ARRAYSIZE(y))
|
2002-06-29 16:11:13 +00:00
|
|
|
#define NUM_PALETTE_FADEOUT 32
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2002-08-18 16:21:34 +00:00
|
|
|
struct Child;
|
|
|
|
struct Child2;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2002-08-18 16:21:34 +00:00
|
|
|
struct Item;
|
|
|
|
struct FillOrCopyStruct;
|
|
|
|
struct Subroutine;
|
|
|
|
struct SubroutineLine;
|
|
|
|
struct TimeEvent;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2004-03-14 17:50:40 +00:00
|
|
|
struct TextLocation {
|
|
|
|
int16 x, y, width;
|
|
|
|
TextLocation() { memset(this, 0, sizeof(*this)); }
|
2002-04-12 21:26:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct HitArea {
|
|
|
|
uint16 x, y;
|
|
|
|
uint16 width, height;
|
|
|
|
uint16 flags;
|
|
|
|
uint16 id;
|
|
|
|
FillOrCopyStruct *fcs;
|
|
|
|
Item *item_ptr;
|
|
|
|
uint16 unk3;
|
|
|
|
uint16 layer;
|
2003-05-20 14:34:07 +00:00
|
|
|
HitArea() { memset(this, 0, sizeof(*this)); }
|
2002-04-12 21:26:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct VgaPointersEntry {
|
|
|
|
byte *vgaFile1;
|
|
|
|
byte *vgaFile2;
|
2005-11-14 12:01:31 +00:00
|
|
|
byte *sfxFile;
|
2003-05-20 14:34:07 +00:00
|
|
|
VgaPointersEntry() { memset(this, 0, sizeof(*this)); }
|
2002-04-12 21:26:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct VgaSprite {
|
|
|
|
uint16 id;
|
|
|
|
uint16 image;
|
2005-10-05 11:37:26 +00:00
|
|
|
uint16 palette;
|
2002-07-07 19:06:48 +00:00
|
|
|
uint16 x, y; /* actually signed numbers */
|
2005-05-06 12:23:19 +00:00
|
|
|
uint16 flags;
|
2002-11-28 00:22:24 +00:00
|
|
|
uint16 priority;
|
2005-10-05 11:37:26 +00:00
|
|
|
uint16 windowNum, fileId;
|
2003-05-20 14:34:07 +00:00
|
|
|
VgaSprite() { memset(this, 0, sizeof(*this)); }
|
2002-04-12 21:26:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct VgaSleepStruct {
|
|
|
|
uint16 ident;
|
2004-12-18 01:33:21 +00:00
|
|
|
const byte *code_ptr;
|
2002-04-12 21:26:59 +00:00
|
|
|
uint16 sprite_id;
|
|
|
|
uint16 cur_vga_file;
|
2003-05-20 14:34:07 +00:00
|
|
|
VgaSleepStruct() { memset(this, 0, sizeof(*this)); }
|
2002-04-12 21:26:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct VgaTimerEntry {
|
|
|
|
uint16 delay;
|
2004-12-18 01:33:21 +00:00
|
|
|
const byte *script_pointer;
|
2002-04-12 21:26:59 +00:00
|
|
|
uint16 sprite_id;
|
|
|
|
uint16 cur_vga_file;
|
2003-05-20 14:34:07 +00:00
|
|
|
VgaTimerEntry() { memset(this, 0, sizeof(*this)); }
|
2002-04-12 21:26:59 +00:00
|
|
|
};
|
|
|
|
|
2005-11-12 06:01:24 +00:00
|
|
|
enum SimonTypes {
|
|
|
|
GType_SIMON1,
|
|
|
|
GType_SIMON2,
|
|
|
|
GType_FF
|
|
|
|
};
|
|
|
|
|
|
|
|
struct GameFileDescription {
|
|
|
|
const char *fileName;
|
|
|
|
uint16 fileType;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct GameDescription {
|
|
|
|
const char *name;
|
|
|
|
SimonTypes gameType;
|
|
|
|
GameIds gameId;
|
|
|
|
const char *title;
|
|
|
|
int filesCount;
|
|
|
|
GameFileDescription *filesDescriptions;
|
|
|
|
uint32 features;
|
|
|
|
Common::Language language;
|
|
|
|
Common::Platform platform;
|
|
|
|
|
|
|
|
GameSettings toGameSettings() const {
|
|
|
|
GameSettings dummy = { name, title, features };
|
|
|
|
return dummy;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
DetectedGameList GAME_ProbeGame(const FSList &fslist, int **matches = NULL);
|
|
|
|
|
2002-08-18 16:21:34 +00:00
|
|
|
struct GameSpecificSettings;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-01-27 16:28:39 +00:00
|
|
|
class Debugger;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2003-06-01 09:41:56 +00:00
|
|
|
class SimonEngine : public Engine {
|
2004-01-27 16:28:39 +00:00
|
|
|
friend class Debugger;
|
|
|
|
|
2003-03-07 15:38:11 +00:00
|
|
|
void errorString(const char *buf_input, char *buf_output);
|
2005-11-05 18:47:03 +00:00
|
|
|
|
|
|
|
typedef void (SimonEngine::*VgaOpcodeProc) ();
|
|
|
|
void setupVgaOpcodes();
|
|
|
|
const VgaOpcodeProc *_vga_opcode_table;
|
2005-11-12 06:01:24 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
GameDescription *_gameDescription;
|
|
|
|
|
|
|
|
bool initGame(void);
|
|
|
|
|
|
|
|
int getGameId() const { return _gameDescription->gameId; }
|
|
|
|
int getGameType() const { return _gameDescription->gameType; }
|
|
|
|
uint32 getFeatures() const { return _gameDescription->features; }
|
|
|
|
Common::Language getLanguage() const { return _gameDescription->language; }
|
|
|
|
Common::Platform getPlatform() const { return _gameDescription->platform; }
|
|
|
|
|
2003-06-15 11:52:42 +00:00
|
|
|
protected:
|
2003-01-04 19:11:45 +00:00
|
|
|
void playSting(uint a);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
const byte *_vcPtr; /* video code ptr */
|
2004-12-18 01:33:21 +00:00
|
|
|
uint16 _vc_get_out_of_code;
|
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
uint32 *_gameOffsetsPtr;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2003-12-01 00:45:16 +00:00
|
|
|
uint VGA_DELAY_BASE;
|
|
|
|
uint TABLE_INDEX_BASE;
|
|
|
|
uint TEXT_INDEX_BASE;
|
|
|
|
uint NUM_VIDEO_OP_CODES;
|
|
|
|
uint VGA_MEM_SIZE;
|
|
|
|
uint TABLES_MEM_SIZE;
|
|
|
|
uint MUSIC_INDEX_BASE;
|
|
|
|
uint SOUND_INDEX_BASE;
|
2002-04-12 21:26:59 +00:00
|
|
|
const GameSpecificSettings *gss;
|
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
byte _keyPressed;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2002-10-30 23:52:19 +00:00
|
|
|
typedef enum {
|
|
|
|
FORMAT_NONE,
|
|
|
|
FORMAT_MP3,
|
|
|
|
FORMAT_WAV,
|
|
|
|
FORMAT_VOC
|
|
|
|
} SoundFormat;
|
|
|
|
|
2005-05-10 22:56:25 +00:00
|
|
|
Common::File *_gameFile;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
byte *_strippedTxtMem;
|
|
|
|
uint _textSize;
|
|
|
|
uint _stringTabNum, _stringTabPos, _stringtab_numalloc;
|
|
|
|
byte **_stringTabPtr;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
Item **_itemArrayPtr;
|
|
|
|
uint _itemArraySize;
|
|
|
|
uint _itemArrayInited;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
byte *_itemHeapPtr;
|
|
|
|
uint _itemHeapCurPos;
|
|
|
|
uint _itemHeapSize;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
byte *_iconFilePtr;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
byte *_tblList;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
const byte *_codePtr;
|
2002-07-07 19:06:48 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
byte **_localStringtable;
|
|
|
|
uint _stringIdLocalMin, _stringIdLocalMax;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
byte *_tablesHeapPtr, *_tablesHeapPtrOrg, *_tablesheapPtrNew;
|
|
|
|
uint _tablesHeapSize, _tablesHeapCurPos, _tablesHeapCurPosOrg;
|
|
|
|
uint _tablesHeapCurPosNew;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
Subroutine *_subroutineList, *_subroutineListOrg;
|
2003-12-23 08:59:30 +00:00
|
|
|
uint _subroutine;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
uint _dxSurfacePitch;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
uint _recursionDepth;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
uint32 _lastVgaTick;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-10-05 11:37:26 +00:00
|
|
|
uint16 _marks;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
bool _scriptVar2;
|
|
|
|
bool _runScriptReturn1;
|
|
|
|
bool _skipVgaWait;
|
|
|
|
bool _noParentNotify;
|
2005-11-10 00:53:00 +00:00
|
|
|
bool _beardLoaded;
|
2002-04-12 21:26:59 +00:00
|
|
|
bool _hitarea_unk_3;
|
2005-05-06 11:37:33 +00:00
|
|
|
bool _mortalFlag;
|
2005-11-09 23:36:55 +00:00
|
|
|
byte _updateScreen;
|
2005-05-06 11:37:33 +00:00
|
|
|
bool _usePaletteDelay;
|
|
|
|
bool _syncFlag2;
|
|
|
|
bool _inCallBack;
|
|
|
|
bool _cepeFlag;
|
|
|
|
byte _copyPartialMode;
|
2003-12-18 09:36:17 +00:00
|
|
|
uint _speed;
|
2005-05-06 11:37:33 +00:00
|
|
|
bool _fastMode;
|
|
|
|
bool _dxUse3Or4ForLock;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2002-12-06 14:40:40 +00:00
|
|
|
uint16 _debugMode;
|
2003-01-29 10:08:56 +00:00
|
|
|
uint16 _language;
|
2003-12-10 00:54:53 +00:00
|
|
|
bool _pause;
|
2005-05-06 11:37:33 +00:00
|
|
|
bool _startMainScript;
|
|
|
|
bool _continousMainScript;
|
|
|
|
bool _startVgaScript;
|
|
|
|
bool _continousVgaScript;
|
|
|
|
bool _drawImagesDebug;
|
|
|
|
bool _dumpImages;
|
2003-10-30 01:05:08 +00:00
|
|
|
bool _speech;
|
2003-03-07 12:29:33 +00:00
|
|
|
bool _subtitles;
|
2003-12-18 10:47:12 +00:00
|
|
|
bool _fade;
|
2005-05-06 11:37:33 +00:00
|
|
|
byte _mouseCursor;
|
|
|
|
bool _vgaVar9;
|
|
|
|
int16 _scriptUnk1;
|
|
|
|
bool _vgaVar6;
|
2005-10-09 09:03:37 +00:00
|
|
|
int _scrollX, _scrollXMax, _scrollHeight;
|
|
|
|
int _scrollY, _scrollYMax, _scrollWidth;
|
|
|
|
int _scrollCount, _scrollFlag;
|
2005-10-05 11:37:26 +00:00
|
|
|
const byte *_scrollImage;
|
2005-05-06 11:37:33 +00:00
|
|
|
byte _vgaVar8;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-11-18 22:34:41 +00:00
|
|
|
int16 _scriptVerb, _scriptNoun1, _scriptNoun2;
|
|
|
|
int16 _scriptAdj1, _scriptAdj2;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-10-19 11:32:25 +00:00
|
|
|
uint16 _curWindow;
|
|
|
|
FillOrCopyStruct *_textWindow;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
Item *_subjectItem, *_objectItem;
|
|
|
|
Item *_item1;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
Item *_hitAreaObjectItem;
|
|
|
|
HitArea *_lastHitArea;
|
|
|
|
HitArea *_lastHitArea2Ptr;
|
|
|
|
HitArea *_lastHitArea3;
|
|
|
|
byte _leftButtonDown;
|
|
|
|
Item *_hitAreaSubjectItem;
|
|
|
|
HitArea *_hitAreaPtr5, *_hitAreaPtr7;
|
|
|
|
uint _needHitAreaRecalc;
|
|
|
|
uint _verbHitArea;
|
|
|
|
uint16 _hitAreaUnk4;
|
2005-12-08 06:12:04 +00:00
|
|
|
uint _mouseHideCount;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-10-05 11:37:26 +00:00
|
|
|
uint16 _windowNum;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-10-19 11:32:25 +00:00
|
|
|
uint _printCharCurPos, _printCharMaxPos;
|
2005-05-06 11:37:33 +00:00
|
|
|
uint _numLettersToPrint;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
uint _lastTime;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
TimeEvent *_firstTimeStruct, *_pendingDeleteTimeEvent;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
uint _base_time;
|
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
uint _mouseX, _mouseY;
|
|
|
|
uint _mouseXOld, _mouseYOld;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
Item *_dummyItem1;
|
|
|
|
Item *_dummyItem2;
|
|
|
|
Item *_dummyItem3;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
volatile uint16 _lockWord;
|
|
|
|
uint16 _scrollUpHitArea;
|
|
|
|
uint16 _scrollDownHitArea;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
uint16 _videoVar7;
|
|
|
|
volatile uint16 _paletteColorCount;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-10-07 07:36:09 +00:00
|
|
|
uint _screenWidth, _screenHeight;
|
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
byte _videoVar4;
|
|
|
|
bool _videoVar5;
|
2005-11-15 04:07:05 +00:00
|
|
|
bool _fastFadeOutFlag;
|
2005-05-06 11:37:33 +00:00
|
|
|
bool _unkPalFlag;
|
|
|
|
bool _exitCutscene;
|
|
|
|
bool _skipSpeech;
|
2005-11-10 05:33:31 +00:00
|
|
|
byte _paletteFlag;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
uint _soundFileId;
|
|
|
|
int16 _lastMusicPlayed;
|
|
|
|
int16 _nextMusicToPlay;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
bool _showPreposition;
|
|
|
|
bool _showMessageFlag;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
uint _videoNumPalColors;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
uint _vgaSpriteChanged;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
byte *_vgaBufFreeStart, *_vgaBufEnd, *_vgaBufStart;
|
|
|
|
byte *_vgaFileBufOrg, *_vgaFileBufOrg2;
|
2002-07-07 19:06:48 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
byte *_curVgaFile1;
|
|
|
|
byte *_curVgaFile2;
|
2005-11-14 12:01:31 +00:00
|
|
|
byte *_curSfxFile;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
uint16 _timer1, _timer5, _timer4;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-10-05 11:37:26 +00:00
|
|
|
uint16 _frameRate;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
uint16 _vgaCurFile2;
|
|
|
|
uint16 _vgaWaitFor, _vgaCurFileId;
|
|
|
|
uint16 _vgaCurSpriteId;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-11-15 08:12:32 +00:00
|
|
|
int16 _baseY;
|
|
|
|
float _scale;
|
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
VgaTimerEntry *_nextVgaTimerToProcess;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
Item *_vcItemArray[20];
|
|
|
|
Item *_itemArray6[20];
|
2002-07-07 19:06:48 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
uint16 _stringIdArray2[20];
|
|
|
|
uint16 _stringIdArray3[20];
|
|
|
|
uint16 _speechIdArray4[20];
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-10-08 09:59:36 +00:00
|
|
|
uint16 _bitArray[48];
|
2002-04-12 21:26:59 +00:00
|
|
|
int16 _variableArray[256];
|
|
|
|
|
2005-10-19 11:32:25 +00:00
|
|
|
FillOrCopyStruct *_windowArray[8];
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
byte _fcsData1[8];
|
|
|
|
bool _fcsData2[8];
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
TextLocation _textLocation1, _textLocation2, _textLocation3, _textLocation4;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
int _freeStringSlot;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
byte _stringReturnBuffer[2][180];
|
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
HitArea _hitAreas[90];
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-10-09 12:12:24 +00:00
|
|
|
VgaPointersEntry _vgaBufferPointers[450];
|
2005-05-06 11:37:33 +00:00
|
|
|
VgaSprite _vgaSprites[180];
|
|
|
|
VgaSleepStruct _vgaSleepStructs[30];
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-11-14 10:31:19 +00:00
|
|
|
const uint16 *_pathFindArray[100];
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-11-18 14:16:28 +00:00
|
|
|
uint8 _pathValues[400];
|
2005-11-18 14:15:03 +00:00
|
|
|
uint8 _PVCount;
|
|
|
|
uint8 _GPVCount;
|
|
|
|
|
2005-11-18 14:16:28 +00:00
|
|
|
uint8 _pathValues1[400];
|
2005-11-18 14:15:03 +00:00
|
|
|
uint8 _PVCount1;
|
|
|
|
uint8 _GPVCount1;
|
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
uint8 _paletteBackup[1024];
|
2002-04-12 21:26:59 +00:00
|
|
|
uint8 _palette[1024];
|
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
byte _videoBuf1[3000];
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
VgaTimerEntry _vgaTimerList[95];
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2002-08-18 16:21:34 +00:00
|
|
|
FillOrCopyStruct *_fcs_list;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
byte _lettersToPrintBuf[80];
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
MidiPlayer midi;
|
2005-12-29 21:21:16 +00:00
|
|
|
bool _native_mt32;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
int _numScreenUpdates;
|
|
|
|
int _vgaTickCounter;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2004-01-03 01:28:00 +00:00
|
|
|
Sound *_sound;
|
2002-04-14 18:13:08 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
bool _effectsPaused;
|
|
|
|
bool _ambientPaused;
|
|
|
|
bool _musicPaused;
|
2002-11-17 17:15:29 +00:00
|
|
|
|
2004-01-27 16:28:39 +00:00
|
|
|
Debugger *_debugger;
|
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
FILE *_dumpFile;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
int _saveLoadRowCurPos;
|
|
|
|
int _numSaveGameRows;
|
|
|
|
bool _saveDialogFlag;
|
|
|
|
bool _saveOrLoad;
|
|
|
|
bool _saveLoadFlag;
|
2002-04-16 12:07:19 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
byte _saveLoadType, _saveLoadSlot;
|
2003-12-11 02:09:18 +00:00
|
|
|
char _saveLoadName[32];
|
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
int _sdlMouseX, _sdlMouseY;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2002-08-18 16:21:34 +00:00
|
|
|
byte *_sdl_buf_3;
|
|
|
|
byte *_sdl_buf;
|
|
|
|
byte *_sdl_buf_attached;
|
|
|
|
|
2003-10-04 11:50:21 +00:00
|
|
|
Common::RandomSource _rnd;
|
2003-05-21 15:47:51 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
const byte *_vc10BasePtrOld;
|
2003-08-02 07:00:58 +00:00
|
|
|
byte _hebrew_char_widths[32];
|
2003-05-21 15:47:51 +00:00
|
|
|
|
2003-06-15 11:52:42 +00:00
|
|
|
public:
|
2003-06-01 09:41:56 +00:00
|
|
|
SimonEngine(GameDetector *detector, OSystem *syst);
|
|
|
|
virtual ~SimonEngine();
|
2002-08-18 16:21:34 +00:00
|
|
|
|
2003-06-15 11:52:42 +00:00
|
|
|
protected:
|
2005-11-10 01:18:09 +00:00
|
|
|
uint16 to16Wrapper(uint value);
|
2005-10-12 00:35:54 +00:00
|
|
|
uint16 readUint16Wrapper(const void *src);
|
|
|
|
|
2005-05-10 22:56:25 +00:00
|
|
|
int allocGamePcVars(Common::File *in);
|
2002-04-12 21:26:59 +00:00
|
|
|
void loginPlayerHelper(Item *item, int a, int b);
|
|
|
|
void loginPlayer();
|
|
|
|
void allocateStringTable(int num);
|
|
|
|
void setupStringTable(byte *mem, int num);
|
|
|
|
void setupLocalStringTable(byte *mem, int num);
|
2005-05-10 22:56:25 +00:00
|
|
|
void readGamePcText(Common::File *in);
|
|
|
|
void readItemChildren(Common::File *in, Item *item, uint tmp);
|
|
|
|
void readItemFromGamePc(Common::File *in, Item *item);
|
2003-01-03 12:33:53 +00:00
|
|
|
void loadGamePcFile(const char *filename);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-08-11 18:08:55 +00:00
|
|
|
void palette_fadeout(uint32 *pal_values, uint num);
|
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
byte *allocateItem(uint size);
|
|
|
|
byte *allocateTable(uint size);
|
2002-04-13 21:06:48 +00:00
|
|
|
void alignTableMem();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
Child *findChildOfType(Item *i, uint child);
|
|
|
|
Child *allocateChildBlock(Item *i, uint type, uint size);
|
|
|
|
|
|
|
|
void allocItemHeap();
|
|
|
|
void allocTablesHeap();
|
|
|
|
|
|
|
|
Subroutine *createSubroutine(uint a);
|
2005-05-10 22:56:25 +00:00
|
|
|
void readSubroutine(Common::File *in, Subroutine *sub);
|
2002-04-12 21:26:59 +00:00
|
|
|
SubroutineLine *createSubroutineLine(Subroutine *sub, int a);
|
2005-05-10 22:56:25 +00:00
|
|
|
void readSubroutineLine(Common::File *in, SubroutineLine *new_table, Subroutine *sub);
|
|
|
|
byte *readSingleOpcode(Common::File *in, byte *ptr);
|
|
|
|
void readSubroutineBlock(Common::File *in);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
Subroutine *getSubroutineByID(uint subroutine_id);
|
|
|
|
|
|
|
|
/* used in debugger */
|
|
|
|
void dumpSubroutines();
|
|
|
|
void dumpSubroutine(Subroutine *sub);
|
|
|
|
void dumpSubroutineLine(SubroutineLine *sl, Subroutine *sub);
|
2004-12-18 02:08:32 +00:00
|
|
|
const byte *dumpOpcode(const byte *p);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
int startSubroutine(Subroutine *sub);
|
|
|
|
int startSubroutineEx(Subroutine *sub);
|
|
|
|
|
|
|
|
bool checkIfToRunSubroutineLine(SubroutineLine *sl, Subroutine *sub);
|
|
|
|
|
|
|
|
int runScript();
|
|
|
|
|
|
|
|
Item *getNextItemPtr();
|
|
|
|
uint getNextItemID();
|
2003-03-07 13:39:59 +00:00
|
|
|
uint getItem1ID() {return 1;}
|
|
|
|
Item *getItem1Ptr();
|
2002-04-12 21:26:59 +00:00
|
|
|
Item *getItemPtrB();
|
|
|
|
|
|
|
|
byte getByte();
|
|
|
|
int getNextWord();
|
|
|
|
|
|
|
|
uint getNextVarContents();
|
|
|
|
uint getVarOrWord();
|
|
|
|
uint getVarOrByte();
|
|
|
|
uint readVariable(uint variable);
|
|
|
|
void writeNextVarContents(uint16 contents);
|
|
|
|
void writeVariable(uint variable, uint16 contents);
|
|
|
|
|
|
|
|
void setItemParent(Item *item, Item *parent);
|
|
|
|
|
|
|
|
uint itemPtrToID(Item *id);
|
|
|
|
|
|
|
|
Item *derefItem(uint item);
|
2005-10-03 14:08:07 +00:00
|
|
|
void setItemState(Item *item, int value);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
void showMessageFormat(const char *s, ...);
|
|
|
|
const byte *getStringPtrByID(uint string_id);
|
|
|
|
const byte *getLocalStringByID(uint string_id);
|
|
|
|
uint getNextStringID();
|
|
|
|
|
|
|
|
void addTimeEvent(uint timeout, uint subroutine_id);
|
|
|
|
void delTimeEvent(TimeEvent *te);
|
|
|
|
|
2005-11-10 00:53:00 +00:00
|
|
|
bool isRoom(Item *item);
|
|
|
|
bool isObject(Item *item);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
void itemChildrenChanged(Item *item);
|
|
|
|
void unlinkItem(Item *item);
|
|
|
|
void linkItem(Item *item, Item *parent);
|
|
|
|
|
2005-10-19 10:54:22 +00:00
|
|
|
bool o_chance(uint a);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2003-05-24 12:26:28 +00:00
|
|
|
void o_kill_sprite_simon1(uint a);
|
|
|
|
void o_kill_sprite_simon2(uint a, uint b);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
void o_vga_reset();
|
2005-10-19 11:32:25 +00:00
|
|
|
void changeWindow(uint a);
|
2002-04-12 21:26:59 +00:00
|
|
|
void o_unk_103();
|
2005-10-19 11:32:25 +00:00
|
|
|
void closeWindow(uint a);
|
2002-04-12 21:26:59 +00:00
|
|
|
void clear_hitarea_bit_0x40(uint hitarea);
|
|
|
|
void set_hitarea_bit_0x40(uint hitarea);
|
|
|
|
void set_hitarea_x_y(uint hitarea, int x, int y);
|
|
|
|
bool is_hitarea_0x40_clear(uint hitarea);
|
|
|
|
void delete_hitarea(uint hitarea);
|
2002-11-20 14:45:00 +00:00
|
|
|
void addNewHitArea(int id, int x, int y, int width, int height, int flags, int unk3, Item *item_ptr);
|
2002-04-12 21:26:59 +00:00
|
|
|
HitArea *findEmptyHitArea();
|
|
|
|
void hitarea_proc_1();
|
2002-07-07 19:06:48 +00:00
|
|
|
void handle_verb_hitarea(HitArea * ha);
|
|
|
|
void hitarea_leave(HitArea * ha);
|
2002-04-12 21:26:59 +00:00
|
|
|
void leaveHitAreaById(uint hitarea_id);
|
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
void o_waitForSync(uint a);
|
|
|
|
void skipSpeech();
|
|
|
|
void o_sync(uint a);
|
|
|
|
void o_playMusic();
|
|
|
|
void o_saveGame();
|
|
|
|
void o_loadGame();
|
2005-10-19 11:32:25 +00:00
|
|
|
void o_confirmQuit();
|
2005-10-19 10:54:22 +00:00
|
|
|
void o_restoreIconArray(uint a);
|
2005-12-13 00:20:11 +00:00
|
|
|
void o_freezeBottom();
|
2002-04-12 21:26:59 +00:00
|
|
|
void killAllTimers();
|
2002-07-07 19:06:48 +00:00
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
uint getOffsetOfChild2Param(Child2 *child, uint prop);
|
|
|
|
void o_unk_160(uint a);
|
2005-12-13 00:20:11 +00:00
|
|
|
void o_playSFX(uint a);
|
2005-10-19 11:32:25 +00:00
|
|
|
void o_lockZone();
|
|
|
|
void o_unlockZone();
|
2002-07-07 19:06:48 +00:00
|
|
|
void o_pathfind(int x, int y, uint var_1, uint var_2);
|
2005-11-18 22:34:41 +00:00
|
|
|
void o_mouseOn();
|
|
|
|
void o_mouseOff();
|
2005-11-10 00:53:00 +00:00
|
|
|
void o_loadBeard();
|
|
|
|
void o_unloadBeard();
|
2005-12-13 00:20:11 +00:00
|
|
|
void o_unloadZone(uint a);
|
|
|
|
void o_unfreezeBottom();
|
|
|
|
void o_fadeToBlack();
|
2002-12-04 22:40:16 +00:00
|
|
|
|
2004-03-14 17:50:40 +00:00
|
|
|
TextLocation *getTextLocation(uint a);
|
2005-12-13 00:20:11 +00:00
|
|
|
void o_printStr();
|
2002-04-12 21:26:59 +00:00
|
|
|
void o_setup_cond_c();
|
|
|
|
void setup_cond_c_helper();
|
|
|
|
|
2003-05-30 07:46:45 +00:00
|
|
|
void o_inventory_descriptions();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-12-08 06:12:04 +00:00
|
|
|
void mouseOff();
|
|
|
|
void mouseOn();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-10-19 10:54:22 +00:00
|
|
|
void drawIconArray(uint i, Item *item_ptr, int unk1, int unk2);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
void loadTextIntoMem(uint string_id);
|
|
|
|
void loadTablesIntoMem(uint subr_id);
|
|
|
|
|
|
|
|
uint loadTextFile(const char *filename, byte *dst);
|
2005-05-10 22:56:25 +00:00
|
|
|
Common::File *openTablesFile(const char *filename);
|
|
|
|
void closeTablesFile(Common::File *in);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
uint loadTextFile_simon1(const char *filename, byte *dst);
|
2005-05-10 22:56:25 +00:00
|
|
|
Common::File *openTablesFile_simon1(const char *filename);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
uint loadTextFile_gme(const char *filename, byte *dst);
|
2005-05-10 22:56:25 +00:00
|
|
|
Common::File *openTablesFile_gme(const char *filename);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
void invokeTimeEvent(TimeEvent *te);
|
|
|
|
bool kickoffTimeEvents();
|
|
|
|
|
|
|
|
void defocusHitarea();
|
2005-12-13 00:20:11 +00:00
|
|
|
void endCutscene();
|
2002-04-12 21:26:59 +00:00
|
|
|
void runSubroutine101();
|
2003-05-10 05:20:56 +00:00
|
|
|
void handle_uparrow_hitarea(FillOrCopyStruct *fcs);
|
|
|
|
void handle_downarrow_hitarea(FillOrCopyStruct *fcs);
|
2002-04-12 21:26:59 +00:00
|
|
|
void hitareaChangedHelper();
|
|
|
|
void focusVerb(uint hitarea_id);
|
|
|
|
HitArea *findHitAreaByID(uint hitarea_id);
|
|
|
|
|
|
|
|
void showActionString(uint x, const byte *string);
|
2003-10-21 06:35:19 +00:00
|
|
|
void video_putchar(FillOrCopyStruct *fcs, byte c, byte b = 0);
|
2002-04-12 21:26:59 +00:00
|
|
|
void video_fill_or_copy_from_3_to_2(FillOrCopyStruct *fcs);
|
2002-07-07 19:06:48 +00:00
|
|
|
void video_toggle_colors(HitArea * ha, byte a, byte b, byte c, byte d);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
void read_vga_from_datfile_1(uint vga_id);
|
|
|
|
|
|
|
|
uint get_fcs_ptr_3_index(FillOrCopyStruct *fcs);
|
|
|
|
|
|
|
|
void setup_hitarea_from_pos(uint x, uint y, uint mode);
|
2002-07-07 19:06:48 +00:00
|
|
|
void new_current_hitarea(HitArea * ha);
|
2002-04-12 21:26:59 +00:00
|
|
|
bool hitarea_proc_2(uint a);
|
|
|
|
bool hitarea_proc_3(Item *item);
|
2003-01-12 15:17:58 +00:00
|
|
|
void f10_key();
|
2002-04-12 21:26:59 +00:00
|
|
|
void hitarea_stuff();
|
|
|
|
|
|
|
|
void handle_mouse_moved();
|
|
|
|
void pollMouseXY();
|
2005-12-13 00:20:11 +00:00
|
|
|
void drawMousePointer();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-10-19 10:54:22 +00:00
|
|
|
void removeIconArray(uint fcs_index);
|
2002-04-12 21:26:59 +00:00
|
|
|
void draw_icon_c(FillOrCopyStruct *fcs, uint icon, uint x, uint y);
|
|
|
|
bool has_item_childflag_0x10(Item *item);
|
|
|
|
uint item_get_icon_number(Item *item);
|
2002-07-07 19:06:48 +00:00
|
|
|
uint setup_icon_hit_area(FillOrCopyStruct *fcs, uint x, uint y, uint icon_number, Item *item_ptr);
|
2005-11-12 08:20:47 +00:00
|
|
|
void addArrows(FillOrCopyStruct *fcs, uint fcs_index);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
void loadIconFile();
|
|
|
|
void processSpecialKeys();
|
|
|
|
void hitarea_stuff_helper();
|
|
|
|
|
|
|
|
void startUp_helper_2();
|
|
|
|
void showmessage_helper_3(uint a, uint b);
|
|
|
|
void showmessage_print_char(byte chr);
|
|
|
|
|
|
|
|
void handle_verb_clicked(uint verb);
|
|
|
|
|
|
|
|
void o_set_video_mode(uint mode, uint vga_res);
|
|
|
|
void set_video_mode_internal(uint mode, uint vga_res_id);
|
2002-07-07 19:06:48 +00:00
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
void o_loadZone(uint vga_res);
|
|
|
|
void loadZone(uint vga_res);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-10-05 11:37:26 +00:00
|
|
|
void loadSprite(uint windowNum, uint vga_res, uint vga_sprite_id, uint x, uint y, uint palette);
|
2005-10-19 11:32:25 +00:00
|
|
|
void o_defineWindow(uint a, uint b, uint c, uint d, uint e, uint f, uint g, uint h);
|
2005-12-13 00:20:11 +00:00
|
|
|
void playSpeech(uint speech_id, uint vga_sprite_id);
|
|
|
|
void printText(uint vga_sprite_id, uint color, const char *string_ptr, int16 x, int16 y, int16 width);
|
2005-10-19 11:32:25 +00:00
|
|
|
FillOrCopyStruct *openWindow(uint x, uint y, uint w, uint h, uint flags, uint fill_color, uint text_color);
|
2002-07-07 19:06:48 +00:00
|
|
|
|
2003-12-16 05:04:39 +00:00
|
|
|
void render_string_amiga(uint vga_sprite_id, uint color, uint width, uint height, const char *txt);
|
2003-12-01 05:47:57 +00:00
|
|
|
void render_string(uint vga_sprite_id, uint color, uint width, uint height, const char *txt);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-11-12 08:20:47 +00:00
|
|
|
void setArrowHitAreas(FillOrCopyStruct *fcs, uint fcs_index);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
byte *setup_vga_destination(uint32 size);
|
|
|
|
void vga_buf_unk_proc3(byte *end);
|
|
|
|
void vga_buf_unk_proc1(byte *end);
|
2002-07-07 19:06:48 +00:00
|
|
|
void vga_buf_unk_proc2(uint a, byte *end);
|
2002-04-12 21:26:59 +00:00
|
|
|
void delete_memptr_range(byte *end);
|
|
|
|
|
|
|
|
void setup_vga_file_buf_pointers();
|
|
|
|
|
|
|
|
void run_vga_script();
|
|
|
|
|
2003-06-15 11:52:42 +00:00
|
|
|
public:
|
2002-06-29 16:11:13 +00:00
|
|
|
// Simon1/Simon2 video script opcodes
|
2005-10-05 12:16:49 +00:00
|
|
|
void vc1_fadeOut();
|
2005-05-06 13:22:48 +00:00
|
|
|
void vc2_call();
|
|
|
|
void vc3_loadSprite();
|
2005-10-05 12:16:49 +00:00
|
|
|
void vc4_fadeIn();
|
2005-05-06 13:22:48 +00:00
|
|
|
void vc5_skip_if_neq();
|
|
|
|
void vc6_skip_ifn_sib_with_a();
|
|
|
|
void vc7_skip_if_sib_with_a();
|
|
|
|
void vc8_skip_if_parent_is();
|
|
|
|
void vc9_skip_if_unk3_is();
|
|
|
|
void vc10_draw();
|
|
|
|
void vc11_clearPathFinder();
|
|
|
|
void vc12_delay();
|
|
|
|
void vc13_addToSpriteX();
|
|
|
|
void vc14_addToSpriteY();
|
|
|
|
void vc15_wakeup_id();
|
|
|
|
void vc16_sleep_on_id();
|
|
|
|
void vc17_setPathfinderItem();
|
|
|
|
void vc18_jump();
|
|
|
|
void vc19_chain_to_script();
|
2005-10-05 12:16:49 +00:00
|
|
|
void vc20_setRepeat();
|
|
|
|
void vc21_endRepeat();
|
2005-05-06 13:22:48 +00:00
|
|
|
void vc22_setSpritePalette();
|
|
|
|
void vc23_setSpritePriority();
|
|
|
|
void vc24_setSpriteXY();
|
|
|
|
void vc25_halt_sprite();
|
2005-10-05 12:16:49 +00:00
|
|
|
void vc26_setSubWindow();
|
2005-05-06 13:22:48 +00:00
|
|
|
void vc27_resetSprite();
|
|
|
|
void vc28_dummy_op();
|
|
|
|
void vc29_stopAllSounds();
|
2005-10-05 11:37:26 +00:00
|
|
|
void vc30_setFrameRate();
|
|
|
|
void vc31_setWindow();
|
2005-05-06 13:22:48 +00:00
|
|
|
void vc32_copyVar();
|
2005-10-05 12:16:49 +00:00
|
|
|
void vc33_setMouseOn();
|
|
|
|
void vc34_setMouseOff();
|
|
|
|
void vc35_clearWindow();
|
|
|
|
void vc36_setWindowImage();
|
2005-05-06 13:22:48 +00:00
|
|
|
void vc37_addToSpriteY();
|
|
|
|
void vc38_skipIfVarZero();
|
|
|
|
void vc39_setVar();
|
|
|
|
void vc40();
|
|
|
|
void vc41();
|
|
|
|
void vc42_delayIfNotEQ();
|
|
|
|
void vc43_skipIfBitClear();
|
|
|
|
void vc44_skipIfBitSet();
|
|
|
|
void vc45_setSpriteX();
|
|
|
|
void vc46_setSpriteY();
|
|
|
|
void vc47_addToVar();
|
|
|
|
void vc48_setPathFinder();
|
|
|
|
void vc49_setBit();
|
|
|
|
void vc50_clearBit();
|
|
|
|
void vc51_clear_hitarea_bit_0x40();
|
|
|
|
void vc52_playSound();
|
|
|
|
void vc53_no_op();
|
|
|
|
void vc54_no_op();
|
|
|
|
void vc55_offset_hit_area();
|
|
|
|
void vc56_delay();
|
|
|
|
void vc57_no_op();
|
|
|
|
void vc58();
|
|
|
|
void vc59();
|
|
|
|
void vc60_killSprite();
|
2005-11-15 04:07:05 +00:00
|
|
|
void vc61_setMaskImage();
|
2005-10-05 11:37:26 +00:00
|
|
|
void vc62_fastFadeOut();
|
|
|
|
void vc63_fastFadeIn();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2002-06-29 16:11:13 +00:00
|
|
|
// Simon2 specific Video Script Opcodes
|
2005-10-05 11:37:26 +00:00
|
|
|
void vc64_skipIfSpeechEnded();
|
|
|
|
void vc65_slowFadeIn();
|
2005-05-06 13:22:48 +00:00
|
|
|
void vc66_skipIfNotEqual();
|
|
|
|
void vc67_skipIfGE();
|
|
|
|
void vc68_skipIfLE();
|
|
|
|
void vc69_playTrack();
|
|
|
|
void vc70_queueMusic();
|
|
|
|
void vc71_checkMusicQueue();
|
|
|
|
void vc72_play_track_2();
|
2005-10-05 11:37:26 +00:00
|
|
|
void vc73_setMark();
|
|
|
|
void vc74_clearMark();
|
2005-11-19 11:37:41 +00:00
|
|
|
|
|
|
|
// Feeble specific Video Script Opcodes
|
2005-10-09 09:03:37 +00:00
|
|
|
void vc75_setScale();
|
|
|
|
void vc76_setScaleXOffs();
|
|
|
|
void vc77_setScaleYOffs();
|
2005-11-14 10:31:19 +00:00
|
|
|
void vc78_computeXY();
|
2005-11-18 12:40:03 +00:00
|
|
|
void vc79_computePosNum();
|
2005-10-09 09:03:37 +00:00
|
|
|
void vc80_setOverlayImage();
|
|
|
|
void vc81_setRandom();
|
2005-11-18 14:15:03 +00:00
|
|
|
void vc82_getPathValue();
|
2005-10-09 09:03:37 +00:00
|
|
|
void vc83_playSoundLoop();
|
|
|
|
void vc84_stopSoundLoop();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2003-06-15 11:52:42 +00:00
|
|
|
protected:
|
2005-11-19 11:37:41 +00:00
|
|
|
void drawImages(VC10_state *state);
|
|
|
|
void drawImages_Feeble(VC10_state *state);
|
|
|
|
|
2002-07-07 19:06:48 +00:00
|
|
|
void delete_vga_timer(VgaTimerEntry * vte);
|
2005-12-13 00:20:11 +00:00
|
|
|
void vcResumeSprite(const byte *code_ptr, uint16 cur_file, uint16 cur_sprite);
|
|
|
|
int vcReadVarOrWord();
|
|
|
|
uint vcReadNextWord();
|
|
|
|
uint vcReadNextByte();
|
|
|
|
uint vcReadVar(uint var);
|
|
|
|
void vcWriteVar(uint var, int16 value);
|
|
|
|
void vcSkipNextInstruction();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-11-18 13:47:47 +00:00
|
|
|
int getScale(int y, int x);
|
|
|
|
|
2003-03-07 03:26:30 +00:00
|
|
|
bool itemIsSiblingOf(uint16 val);
|
|
|
|
bool itemIsParentOf(uint16 a, uint16 b);
|
2002-04-12 21:26:59 +00:00
|
|
|
bool vc_maybe_skip_proc_1(uint16 a, int16 b);
|
|
|
|
|
2004-12-18 01:33:21 +00:00
|
|
|
void add_vga_timer(uint num, const byte *code_ptr, uint cur_sprite, uint cur_file);
|
2005-12-13 00:20:11 +00:00
|
|
|
VgaSprite *findCurSprite();
|
|
|
|
|
|
|
|
bool vcGetBit(uint bit);
|
|
|
|
void vcSetBitTo(uint bit, bool value);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
void expire_vga_timers();
|
|
|
|
|
2005-05-06 13:22:48 +00:00
|
|
|
bool isSpriteLoaded(uint16 id, uint16 fileId);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2002-08-04 13:25:06 +00:00
|
|
|
void fcs_setTextColor(FillOrCopyStruct *fcs, uint value);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
void video_copy_if_flag_0x8_c(FillOrCopyStruct *fcs);
|
|
|
|
void delete_hitarea_by_index(uint index);
|
|
|
|
|
2005-11-12 08:20:47 +00:00
|
|
|
void removeArrows(FillOrCopyStruct *fcs, uint fcs_index);
|
2002-04-12 21:26:59 +00:00
|
|
|
void fcs_putchar(uint a);
|
|
|
|
|
|
|
|
void copy_img_from_3_to_2(FillOrCopyStruct *fcs);
|
|
|
|
void video_erase(FillOrCopyStruct *fcs);
|
|
|
|
|
|
|
|
void dx_copy_rgn_from_3_to_2(uint b, uint r, uint y, uint x);
|
|
|
|
|
|
|
|
byte *dx_lock_2();
|
|
|
|
void dx_unlock_2();
|
|
|
|
|
|
|
|
byte *dx_lock_attached();
|
|
|
|
void dx_unlock_attached();
|
|
|
|
|
2005-11-14 12:01:31 +00:00
|
|
|
byte *read_vga_from_datfile_2(uint id, uint type);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
void resfile_read(void *dst, uint32 offs, uint32 size);
|
|
|
|
|
2004-11-24 00:14:21 +00:00
|
|
|
int init(GameDetector &detector);
|
2004-11-23 00:03:25 +00:00
|
|
|
int go();
|
2002-04-12 21:26:59 +00:00
|
|
|
void openGameFile();
|
|
|
|
|
|
|
|
void timer_callback();
|
|
|
|
void timer_proc1();
|
|
|
|
|
|
|
|
void timer_vga_sprites();
|
|
|
|
void timer_vga_sprites_2();
|
|
|
|
|
|
|
|
void dx_clear_surfaces(uint num_lines);
|
|
|
|
void dx_update_screen_and_palette();
|
|
|
|
|
2004-12-18 01:33:21 +00:00
|
|
|
void dump_video_script(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);
|
|
|
|
void dump_vga_bitmaps(const byte *vga, byte *vga1, int res);
|
|
|
|
void dump_single_bitmap(int file, int image, const byte *offs, int w, int h, byte base);
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
void dx_clear_attached_from_top(uint lines);
|
|
|
|
void dx_copy_from_attached_to_2(uint x, uint y, uint w, uint h);
|
|
|
|
void dx_copy_from_attached_to_3(uint lines);
|
2002-04-16 12:07:19 +00:00
|
|
|
void dx_copy_from_2_to_attached(uint x, uint y, uint w, uint h);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
void print_char_helper_1(const byte *src, uint len);
|
|
|
|
void print_char_helper_5(FillOrCopyStruct *fcs);
|
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
void quickLoadOrSave();
|
2002-04-12 21:26:59 +00:00
|
|
|
void shutdown();
|
|
|
|
|
2005-11-08 11:34:56 +00:00
|
|
|
byte *vc10_uncompressFlip(const byte *src, uint w, uint h);
|
|
|
|
byte *vc10_flip(const byte *src, uint w, uint h);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
Item *getNextItemPtrStrange();
|
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
bool saveGame(uint slot, char *caption);
|
|
|
|
bool loadGame(uint slot);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
void showmessage_helper_2();
|
|
|
|
void print_char_helper_6(uint i);
|
|
|
|
|
2002-08-04 13:25:06 +00:00
|
|
|
void video_putchar_newline(FillOrCopyStruct *fcs);
|
|
|
|
void video_putchar_drawchar(FillOrCopyStruct *fcs, uint x, uint y, byte chr);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2003-05-21 05:12:04 +00:00
|
|
|
void loadMusic(uint music);
|
2002-04-12 21:26:59 +00:00
|
|
|
void checkTimerCallback();
|
|
|
|
void delay(uint delay);
|
2003-12-10 00:54:53 +00:00
|
|
|
void pause();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2002-12-03 05:34:55 +00:00
|
|
|
void o_83_helper();
|
2005-10-05 11:37:26 +00:00
|
|
|
void o_waitForMark(uint i);
|
2002-04-12 21:26:59 +00:00
|
|
|
void timer_vga_sprites_helper();
|
|
|
|
|
2004-12-18 01:33:21 +00:00
|
|
|
void decodeStripA(byte *dst, const byte *src, int height);
|
2002-04-12 21:26:59 +00:00
|
|
|
void scroll_timeout();
|
|
|
|
void hitarea_stuff_helper_2();
|
2005-11-13 07:04:56 +00:00
|
|
|
void fastFadeIn();
|
|
|
|
void slowFadeIn();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2003-05-24 12:26:28 +00:00
|
|
|
void vc_kill_sprite(uint file, uint sprite);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
void set_dummy_cursor();
|
2002-04-15 18:07:56 +00:00
|
|
|
|
2005-01-22 02:01:22 +00:00
|
|
|
void set_volume(int volume);
|
2002-04-16 12:07:19 +00:00
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
void saveOrLoadDialog(bool load);
|
2002-04-16 12:07:19 +00:00
|
|
|
void o_unk_132_helper_3();
|
|
|
|
int o_unk_132_helper(bool *b, char *buf);
|
2005-12-13 00:20:11 +00:00
|
|
|
void o_clearCharacter(FillOrCopyStruct *fcs, int x, byte b = 0);
|
|
|
|
void saveGameDialog(char *buf);
|
|
|
|
void o_fileError(FillOrCopyStruct *fcs, bool save_error);
|
2002-04-16 12:07:19 +00:00
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
int countSaveGames();
|
|
|
|
int displaySaveGameList(int curpos, bool load, char *dst);
|
2002-04-16 12:07:19 +00:00
|
|
|
|
|
|
|
void show_it(void *buf);
|
|
|
|
|
|
|
|
char *gen_savename(int slot);
|
2002-04-12 21:26:59 +00:00
|
|
|
};
|
|
|
|
|
2003-10-03 19:42:27 +00:00
|
|
|
} // End of namespace Simon
|
|
|
|
|
2002-08-18 16:21:34 +00:00
|
|
|
#endif
|