2002-04-14 18:13:08 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
2006-05-05 00:42:37 +00:00
|
|
|
* Copyright (C) 2001 Ludvig Strigeus
|
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
|
|
|
*
|
2006-02-11 12:46:41 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2002-04-12 21:26:59 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2006-09-29 08:14:27 +00:00
|
|
|
#ifndef AGOS_AGOS_H
|
|
|
|
#define AGOS_AGOS_H
|
2002-08-18 16:21:34 +00:00
|
|
|
|
2006-09-23 00:42:35 +00:00
|
|
|
#include "engines/engine.h"
|
2006-03-16 03:15:05 +00:00
|
|
|
|
|
|
|
#include "common/rect.h"
|
2002-12-01 15:36:36 +00:00
|
|
|
#include "common/util.h"
|
2006-03-16 03:15:05 +00:00
|
|
|
|
2006-09-29 08:14:27 +00:00
|
|
|
#include "agos/animation.h"
|
|
|
|
#include "agos/midi.h"
|
|
|
|
#include "agos/sound.h"
|
|
|
|
#include "agos/vga.h"
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
namespace AGOS {
|
2003-10-03 19:42:27 +00:00
|
|
|
|
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-04-12 21:26:59 +00:00
|
|
|
|
2002-08-18 16:21:34 +00:00
|
|
|
struct Child;
|
2006-04-06 14:01:52 +00:00
|
|
|
struct SubObject;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2002-08-18 16:21:34 +00:00
|
|
|
struct Item;
|
2006-04-05 02:45:28 +00:00
|
|
|
struct WindowBlock;
|
2002-08-18 16:21:34 +00:00
|
|
|
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;
|
2006-04-09 04:53:31 +00:00
|
|
|
uint16 data;
|
2006-04-05 02:45:28 +00:00
|
|
|
WindowBlock *window;
|
2002-04-12 21:26:59 +00:00
|
|
|
Item *item_ptr;
|
2006-03-16 07:08:05 +00:00
|
|
|
uint16 verb;
|
|
|
|
uint16 priority;
|
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;
|
2006-04-20 00:42:54 +00:00
|
|
|
byte *vgaFile1End;
|
2002-04-12 21:26:59 +00:00
|
|
|
byte *vgaFile2;
|
2006-04-20 00:42:54 +00:00
|
|
|
byte *vgaFile2End;
|
2005-11-14 12:01:31 +00:00
|
|
|
byte *sfxFile;
|
2006-04-20 00:42:54 +00:00
|
|
|
byte *sfxFileEnd;
|
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;
|
2006-04-10 23:44:17 +00:00
|
|
|
uint16 windowNum, zoneNum;
|
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 {
|
2006-04-20 08:58:30 +00:00
|
|
|
int16 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;
|
2006-04-21 00:18:23 +00:00
|
|
|
int32 param;
|
2003-05-20 14:34:07 +00:00
|
|
|
VgaTimerEntry() { memset(this, 0, sizeof(*this)); }
|
2002-04-12 21:26:59 +00:00
|
|
|
};
|
|
|
|
|
2006-03-28 13:33:18 +00:00
|
|
|
enum SIMONGameType {
|
2006-09-28 23:22:07 +00:00
|
|
|
GType_ELVIRA = 0,
|
|
|
|
GType_ELVIRA2 = 1,
|
|
|
|
GType_WW = 2,
|
|
|
|
GType_SIMON1 = 3,
|
|
|
|
GType_SIMON2 = 4,
|
|
|
|
GType_FF = 6,
|
|
|
|
GType_PP = 7
|
2005-11-12 06:01:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct GameFileDescription {
|
|
|
|
const char *fileName;
|
|
|
|
uint16 fileType;
|
2006-03-28 13:33:18 +00:00
|
|
|
const char *md5;
|
2005-11-12 06:01:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct GameDescription {
|
|
|
|
const char *name;
|
2006-03-28 13:33:18 +00:00
|
|
|
SIMONGameType gameType;
|
2005-11-12 06:01:24 +00:00
|
|
|
GameIds gameId;
|
2006-03-09 13:29:45 +00:00
|
|
|
const char *extra;
|
2005-11-12 06:01:24 +00:00
|
|
|
int filesCount;
|
|
|
|
GameFileDescription *filesDescriptions;
|
|
|
|
uint32 features;
|
|
|
|
Common::Language language;
|
|
|
|
Common::Platform platform;
|
|
|
|
};
|
|
|
|
|
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
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
class AGOSEngine : public Engine {
|
2004-01-27 16:28:39 +00:00
|
|
|
friend class Debugger;
|
2006-04-17 13:48:44 +00:00
|
|
|
friend class MoviePlayer;
|
2004-01-27 16:28:39 +00:00
|
|
|
|
2006-09-16 19:31:23 +00:00
|
|
|
GUI::Debugger *getDebugger();
|
2005-11-05 18:47:03 +00:00
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
typedef void (AGOSEngine::*OpcodeProc) ();
|
2006-10-01 07:22:01 +00:00
|
|
|
|
|
|
|
void setupAGOSOpcodes(OpcodeProc *op);
|
|
|
|
|
|
|
|
void setupElvira1Opcodes(OpcodeProc *op);
|
|
|
|
void setupElvira2Opcodes(OpcodeProc *op);
|
|
|
|
void setupWaxworksOpcodes(OpcodeProc *op);
|
|
|
|
void setupSimon1Opcodes(OpcodeProc *op);
|
|
|
|
void setupSimon2Opcodes(OpcodeProc *op);
|
|
|
|
void setupFeebleOpcodes(OpcodeProc *op);
|
|
|
|
void setupPuzzleOpcodes(OpcodeProc *op);
|
|
|
|
|
2006-04-06 17:56:41 +00:00
|
|
|
void setupOpcodes();
|
|
|
|
const OpcodeProc *_opcode_table;
|
|
|
|
int _numOpcodes;
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
typedef void (AGOSEngine::*VgaOpcodeProc) ();
|
2006-10-02 14:32:28 +00:00
|
|
|
|
2005-11-05 18:47:03 +00:00
|
|
|
void setupVgaOpcodes();
|
|
|
|
const VgaOpcodeProc *_vga_opcode_table;
|
2006-10-02 14:32:28 +00:00
|
|
|
uint _numVideoOpcodes;
|
|
|
|
|
|
|
|
void setupCommonVideoOpcodes(VgaOpcodeProc *op);
|
|
|
|
|
|
|
|
void setupElvira1VideoOpcodes(VgaOpcodeProc *op);
|
|
|
|
void setupSimon2VideoOpcodes(VgaOpcodeProc *op);
|
|
|
|
void setupFeebleVideoOpcodes(VgaOpcodeProc *op);
|
2005-11-12 06:01:24 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
GameDescription *_gameDescription;
|
|
|
|
|
|
|
|
bool initGame(void);
|
2006-09-28 23:22:07 +00:00
|
|
|
void setupGame();
|
2005-11-12 06:01:24 +00:00
|
|
|
|
|
|
|
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; }
|
2006-04-22 02:14:42 +00:00
|
|
|
const char *getFileName(int type) const {
|
|
|
|
for (int i = 0; i < _gameDescription->filesCount; i++) {
|
|
|
|
if (_gameDescription->filesDescriptions[i].fileType == type)
|
|
|
|
return _gameDescription->filesDescriptions[i].fileName;
|
|
|
|
}
|
2006-04-22 23:59:56 +00:00
|
|
|
error("getFileName: Invalid type %d", type);
|
2006-04-22 02:14:42 +00:00
|
|
|
}
|
2005-11-12 06:01:24 +00:00
|
|
|
|
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
|
|
|
|
2006-05-04 02:23:52 +00:00
|
|
|
uint _vgaBaseDelay;
|
|
|
|
uint _tableIndexBase;
|
|
|
|
uint _textIndexBase;
|
|
|
|
uint _vgaMemSize;
|
|
|
|
uint _tableMemSize;
|
|
|
|
uint _musicIndexBase;
|
|
|
|
uint _soundIndexBase;
|
2006-09-28 23:22:07 +00:00
|
|
|
uint _numVars;
|
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;
|
2006-04-24 06:02:47 +00:00
|
|
|
byte *_textMem;
|
2005-05-06 11:37:33 +00:00
|
|
|
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
|
|
|
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
|
|
|
|
2006-09-20 06:39:27 +00:00
|
|
|
byte *_roomsList;
|
|
|
|
|
2006-09-19 11:59:13 +00:00
|
|
|
byte *_xtblList;
|
|
|
|
byte *_xtablesHeapPtrOrg;
|
|
|
|
uint _xtablesHeapCurPosOrg;
|
|
|
|
Subroutine *_xsubroutineListOrg;
|
|
|
|
|
|
|
|
byte *_tblList;
|
2005-05-06 11:37:33 +00:00
|
|
|
byte *_tablesHeapPtr, *_tablesHeapPtrOrg, *_tablesheapPtrNew;
|
|
|
|
uint _tablesHeapSize, _tablesHeapCurPos, _tablesHeapCurPosOrg;
|
|
|
|
uint _tablesHeapCurPosNew;
|
2006-09-19 11:59:13 +00:00
|
|
|
Subroutine *_subroutineListOrg;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-09-19 11:59:13 +00:00
|
|
|
Subroutine *_subroutineList;
|
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;
|
2006-04-07 09:37:44 +00:00
|
|
|
bool _runScriptCondition[40];
|
|
|
|
int _runScriptReturn[40];
|
2005-05-06 11:37:33 +00:00
|
|
|
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;
|
2006-05-02 18:15:00 +00:00
|
|
|
bool _updateScreen;
|
2005-05-06 11:37:33 +00:00
|
|
|
bool _usePaletteDelay;
|
|
|
|
bool _syncFlag2;
|
|
|
|
bool _inCallBack;
|
|
|
|
bool _cepeFlag;
|
|
|
|
byte _copyPartialMode;
|
|
|
|
bool _fastMode;
|
2006-04-15 22:37:48 +00:00
|
|
|
bool _useBackGround;
|
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;
|
2005-05-06 11:37:33 +00:00
|
|
|
bool _vgaVar9;
|
2006-04-21 07:42:40 +00:00
|
|
|
int16 _chanceModifier;
|
2006-03-16 07:08:05 +00:00
|
|
|
bool _restoreWindow6;
|
2006-04-07 09:04:36 +00:00
|
|
|
int _scrollX, _scrollXMax, _scrollWidth;
|
|
|
|
int _scrollY, _scrollYMax, _scrollHeight;
|
2005-10-09 09:03:37 +00:00
|
|
|
int _scrollCount, _scrollFlag;
|
2005-10-05 11:37:26 +00:00
|
|
|
const byte *_scrollImage;
|
2006-04-08 07:13:07 +00:00
|
|
|
byte _boxStarHeight;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-04 01:38:53 +00:00
|
|
|
uint16 _hyperLink, _newLines;
|
2006-02-13 10:29:25 +00:00
|
|
|
uint16 _oracleMaxScrollY, _noOracleScroll;
|
2006-04-07 01:46:43 +00:00
|
|
|
uint16 _interactY;
|
|
|
|
|
2006-10-02 01:09:50 +00:00
|
|
|
uint16 _droppingBlockAnim;
|
|
|
|
uint16 _droppingBlockLength;
|
|
|
|
uint16 _droppingBlockCount;
|
|
|
|
uint16 _droppingBlockLand;
|
|
|
|
uint16 _droppingBlockType;
|
|
|
|
uint16 _droppingBlockX;
|
|
|
|
uint16 _droppingBlockY;
|
|
|
|
uint16 _droppingBlockZ;
|
|
|
|
|
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;
|
2006-04-05 02:45:28 +00:00
|
|
|
WindowBlock *_textWindow;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
Item *_subjectItem, *_objectItem;
|
2006-04-19 11:54:38 +00:00
|
|
|
Item *_currentPlayer;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
Item *_hitAreaObjectItem;
|
|
|
|
HitArea *_lastHitArea;
|
2006-04-06 08:43:20 +00:00
|
|
|
HitArea *_lastNameOn;
|
2005-05-06 11:37:33 +00:00
|
|
|
HitArea *_lastHitArea3;
|
|
|
|
Item *_hitAreaSubjectItem;
|
2006-04-06 10:47:37 +00:00
|
|
|
HitArea *_currentVerbBox, *_lastVerbOn;
|
2005-05-06 11:37:33 +00:00
|
|
|
uint _needHitAreaRecalc;
|
|
|
|
uint _verbHitArea;
|
2006-03-16 10:30:59 +00:00
|
|
|
uint16 _defaultVerb;
|
2006-04-04 01:38:53 +00:00
|
|
|
uint _currentBoxNumber;
|
2006-04-04 23:29:24 +00:00
|
|
|
uint _iOverflow;
|
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
|
|
|
|
2006-04-08 07:13:07 +00:00
|
|
|
uint _printCharCurPos, _printCharMaxPos, _printCharPixelCount;
|
2005-05-06 11:37:33 +00:00
|
|
|
uint _numLettersToPrint;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-15 06:47:26 +00:00
|
|
|
uint _numTextBoxes;
|
2006-04-15 06:42:40 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
uint _lastTime;
|
2006-09-29 11:07:38 +00:00
|
|
|
uint32 _clockStopped, _gameStoppedClock, _gameTime;
|
2006-04-09 06:06:10 +00:00
|
|
|
time_t _timeStore;
|
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
|
|
|
|
2006-03-22 23:38:16 +00:00
|
|
|
int _mouseX, _mouseY;
|
|
|
|
int _mouseXOld, _mouseYOld;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-09-30 06:47:41 +00:00
|
|
|
byte *_mouseData;
|
2006-04-13 23:34:58 +00:00
|
|
|
byte _animatePointer;
|
2006-09-30 06:47:41 +00:00
|
|
|
byte _maxCursorWidth, _maxCursorHeight;
|
|
|
|
byte _mouseAnim, _mouseAnimMax, _mouseCursor;
|
|
|
|
byte _currentMouseAnim, _currentMouseCursor;
|
|
|
|
byte _oldMouseAnimMax, _oldMouseCursor;
|
2006-04-13 23:34:58 +00:00
|
|
|
uint _mouseHideCount;
|
2006-04-30 06:10:14 +00:00
|
|
|
bool _mouseToggle;
|
2006-04-13 23:34:58 +00:00
|
|
|
|
2006-04-08 07:13:07 +00:00
|
|
|
byte _leftButtonDown;
|
|
|
|
byte _rightButtonDown;
|
|
|
|
bool _noRightClick;
|
|
|
|
|
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
|
|
|
|
2006-05-05 05:53:36 +00:00
|
|
|
bool _fastFadeOutFlag;
|
|
|
|
bool _unkPalFlag;
|
|
|
|
byte _paletteFlag;
|
|
|
|
uint _fastFadeCount;
|
|
|
|
volatile uint16 _fastFadeInFlag;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-03-22 23:38:16 +00:00
|
|
|
int _screenWidth, _screenHeight;
|
2005-10-07 07:36:09 +00:00
|
|
|
|
2006-04-20 00:54:30 +00:00
|
|
|
uint16 _noOverWrite;
|
2006-04-10 23:44:17 +00:00
|
|
|
bool _rejectBlock;
|
2006-04-20 00:54:30 +00:00
|
|
|
|
2006-09-30 13:02:31 +00:00
|
|
|
bool _exitCutscene, _picture8600;
|
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 _vgaSpriteChanged;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-05-13 08:24:47 +00:00
|
|
|
byte *_vgaMemPtr, *_vgaMemEnd, *_vgaMemBase;
|
|
|
|
byte *_vgaFrozenBase, *_vgaRealBase;
|
|
|
|
byte *_zoneBuffers;
|
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
|
|
|
|
2006-03-23 04:49:03 +00:00
|
|
|
uint16 _syncCount, _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
|
|
|
|
2006-04-10 23:44:17 +00:00
|
|
|
uint16 _zoneNumber;
|
2006-06-01 12:06:53 +00:00
|
|
|
uint16 _vgaWaitFor, _lastVgaWaitFor;
|
2006-10-02 01:09:50 +00:00
|
|
|
uint16 _overlayAnimationZone;
|
2006-06-01 12:06:53 +00:00
|
|
|
uint16 _vgaCurSpriteId, _vgaCurZoneNum;
|
2006-03-16 03:15:05 +00:00
|
|
|
uint16 _vgaCurSpritePriority;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-11-15 08:12:32 +00:00
|
|
|
int16 _baseY;
|
|
|
|
float _scale;
|
2006-03-16 03:15:05 +00:00
|
|
|
Common::Rect _feebleRect;
|
|
|
|
int _scaleX, _scaleY, _scaleWidth, _scaleHeight;
|
2005-11-15 08:12:32 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
VgaTimerEntry *_nextVgaTimerToProcess;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-15 06:35:40 +00:00
|
|
|
Item *_objectArray[20];
|
|
|
|
Item *_itemStore[20];
|
2002-07-07 19:06:48 +00:00
|
|
|
|
2006-09-29 00:50:22 +00:00
|
|
|
uint16 _shortText[40];
|
|
|
|
uint16 _shortTextX[40];
|
|
|
|
uint16 _shortTextY[40];
|
|
|
|
uint16 _longText[40];
|
|
|
|
uint16 _longSound[40];
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-09-28 23:22:07 +00:00
|
|
|
uint16 _bitArray[128];
|
2006-04-21 06:37:28 +00:00
|
|
|
uint16 _bitArrayTwo[16];
|
|
|
|
uint16 _bitArrayThree[16];
|
2006-09-28 23:22:07 +00:00
|
|
|
int16 *_variableArray;
|
|
|
|
int16 *_variableArray2;
|
2006-04-15 22:14:39 +00:00
|
|
|
int16 *_variableArrayPtr;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-10-02 10:54:06 +00:00
|
|
|
WindowBlock *_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];
|
|
|
|
|
2006-04-15 06:35:40 +00:00
|
|
|
HitArea _hitAreas[250];
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-10-09 12:12:24 +00:00
|
|
|
VgaPointersEntry _vgaBufferPointers[450];
|
2006-10-02 10:43:07 +00:00
|
|
|
VgaSprite _vgaSprites[200];
|
2006-04-15 06:35:40 +00:00
|
|
|
VgaSleepStruct _vgaSleepStructs[60];
|
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];
|
2006-05-03 06:07:26 +00:00
|
|
|
uint16 _PVCount;
|
|
|
|
uint16 _GPVCount;
|
2005-11-18 14:15:03 +00:00
|
|
|
|
2005-11-18 14:16:28 +00:00
|
|
|
uint8 _pathValues1[400];
|
2006-05-03 06:07:26 +00:00
|
|
|
uint16 _PVCount1;
|
|
|
|
uint16 _GPVCount1;
|
2005-11-18 14:15:03 +00:00
|
|
|
|
2006-05-05 05:53:36 +00:00
|
|
|
uint8 _currentPalette[1024];
|
|
|
|
uint8 _displayPalette[1024];
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
byte _videoBuf1[3000];
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-10-02 10:43:07 +00:00
|
|
|
VgaTimerEntry _vgaTimerList[205];
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-06 10:47:37 +00:00
|
|
|
WindowBlock *_windowList;
|
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 _vgaTickCounter;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-17 12:05:45 +00:00
|
|
|
MoviePlayer *_moviePlay;
|
|
|
|
|
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
|
|
|
int _saveLoadRowCurPos;
|
|
|
|
int _numSaveGameRows;
|
|
|
|
bool _saveDialogFlag;
|
|
|
|
bool _saveOrLoad;
|
2006-06-02 08:06:50 +00:00
|
|
|
bool _saveLoadEdit;
|
2002-04-16 12:07:19 +00:00
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
byte _saveLoadType, _saveLoadSlot;
|
2006-04-15 06:35:40 +00:00
|
|
|
char _saveLoadName[108];
|
2003-12-11 02:09:18 +00:00
|
|
|
|
2006-09-30 07:00:42 +00:00
|
|
|
bool _oopsValid;
|
|
|
|
|
2005-05-06 11:37:33 +00:00
|
|
|
int _sdlMouseX, _sdlMouseY;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2006-04-15 22:37:48 +00:00
|
|
|
byte *_backGroundBuf;
|
|
|
|
byte *_frontBuf;
|
|
|
|
byte *_backBuf;
|
2006-04-24 02:11:04 +00:00
|
|
|
byte *_scaleBuf;
|
2002-08-18 16:21:34 +00:00
|
|
|
|
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;
|
2006-04-15 06:35:40 +00:00
|
|
|
byte _hebrewCharWidths[32];
|
2003-05-21 15:47:51 +00:00
|
|
|
|
2003-06-15 11:52:42 +00:00
|
|
|
public:
|
2006-09-29 09:44:30 +00:00
|
|
|
AGOSEngine(OSystem *syst);
|
|
|
|
virtual ~AGOSEngine();
|
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);
|
2006-04-07 14:27:28 +00:00
|
|
|
uint32 readUint32Wrapper(const void *src);
|
2005-10-12 00:35:54 +00:00
|
|
|
|
2005-05-10 22:56:25 +00:00
|
|
|
int allocGamePcVars(Common::File *in);
|
2006-04-06 14:01:52 +00:00
|
|
|
void setUserFlag(Item *item, int a, int b);
|
|
|
|
void createPlayer();
|
2002-04-12 21:26:59 +00:00
|
|
|
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);
|
2006-04-22 02:14:42 +00:00
|
|
|
void loadGamePcFile();
|
2006-04-14 04:22:49 +00:00
|
|
|
void decompressData(const char *srcName, byte *dst, uint32 offset, uint32 srcSize, uint32 dstSize);
|
2006-03-22 06:21:17 +00:00
|
|
|
void loadOffsets(const char *filename, int number, uint32 &file, uint32 &offset, uint32 &compressedSize, uint32 &size);
|
2006-04-23 15:42:02 +00:00
|
|
|
void loadSound(uint sound, int pan, int vol, uint type);
|
2006-04-14 05:13:59 +00:00
|
|
|
void loadVoice(uint speechId);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-05-05 05:59:03 +00:00
|
|
|
void paletteFadeOut(byte *palPtr, uint num, uint size);
|
2005-08-11 18:08:55 +00:00
|
|
|
|
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;}
|
2006-04-19 11:54:38 +00:00
|
|
|
Item *me();
|
|
|
|
Item *actor();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
byte getByte();
|
|
|
|
int getNextWord();
|
|
|
|
|
|
|
|
uint getNextVarContents();
|
2006-09-28 23:22:07 +00:00
|
|
|
uint getVarWrapper();
|
2002-04-12 21:26:59 +00:00
|
|
|
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, ...);
|
2006-04-06 14:01:52 +00:00
|
|
|
const byte *getStringPtrByID(uint stringId);
|
|
|
|
const byte *getLocalStringByID(uint stringId);
|
2002-04-12 21:26:59 +00:00
|
|
|
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);
|
|
|
|
|
2006-04-21 00:18:23 +00:00
|
|
|
void stopAnimateSimon1(uint a);
|
|
|
|
void stopAnimateSimon2(uint a, uint b);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-14 09:57:43 +00:00
|
|
|
void enableBox(uint hitarea);
|
|
|
|
void disableBox(uint hitarea);
|
2006-03-16 07:08:05 +00:00
|
|
|
void moveBox(uint hitarea, int x, int y);
|
2006-05-03 01:11:50 +00:00
|
|
|
bool isBoxDead(uint hitarea);
|
2006-04-14 09:57:43 +00:00
|
|
|
void undefineBox(uint hitarea);
|
2006-04-08 12:06:52 +00:00
|
|
|
void defineBox(int id, int x, int y, int width, int height, int flags, int verb, Item *item_ptr);
|
2002-04-12 21:26:59 +00:00
|
|
|
HitArea *findEmptyHitArea();
|
2006-04-21 00:18:23 +00:00
|
|
|
|
2006-03-16 10:30:59 +00:00
|
|
|
void resetVerbs();
|
|
|
|
void setVerb(HitArea * ha);
|
2006-04-13 23:34:58 +00:00
|
|
|
void hitarea_leave(HitArea * ha, bool state = false);
|
2002-04-12 21:26:59 +00:00
|
|
|
void leaveHitAreaById(uint hitarea_id);
|
|
|
|
|
By now, it should be obvious that I'm trying to get rid of the o_ functions.
This is in preparation for the next stage of the cleanup.
By now, I have merged most of the o_ opcode functions into the corresponding
o1_ opcode function. There are a few pure o_ opcode functions left, but it
makes sense to keep them separate functions since they are part of groups of
other functions. Now, to get rid of the remaining o_ functions I have:
Dropped the "o_" prefix from the following functions: o_kill_sprite_simon1(),
o_kill_sprite_simon2(), o_waitForSync(), o_freezeBottom(), o_setTextColor(),
o_fadeToBlack(), o_waitForMark(), o_unk_132_helper_3(), o_unk_132_helper(),
o_clearCharacter(), o_fileError().
Renamed o_sync() to sendSync().
Renamed o_mouseOn() to scriptMouseOn(), and moved it to items.cpp
Renamed o_mouseOff() to scriptMouseOff(), and moved it to items.cpp
svn-id: r21760
2006-04-10 09:18:07 +00:00
|
|
|
void sendSync(uint a);
|
2006-05-03 01:11:50 +00:00
|
|
|
void waitForSync(uint a);
|
2002-07-07 19:06:48 +00:00
|
|
|
|
2006-04-06 14:01:52 +00:00
|
|
|
uint getOffsetOfChild2Param(SubObject *child, uint prop);
|
By now, it should be obvious that I'm trying to get rid of the o_ functions.
This is in preparation for the next stage of the cleanup.
By now, I have merged most of the o_ opcode functions into the corresponding
o1_ opcode function. There are a few pure o_ opcode functions left, but it
makes sense to keep them separate functions since they are part of groups of
other functions. Now, to get rid of the remaining o_ functions I have:
Dropped the "o_" prefix from the following functions: o_kill_sprite_simon1(),
o_kill_sprite_simon2(), o_waitForSync(), o_freezeBottom(), o_setTextColor(),
o_fadeToBlack(), o_waitForMark(), o_unk_132_helper_3(), o_unk_132_helper(),
o_clearCharacter(), o_fileError().
Renamed o_sync() to sendSync().
Renamed o_mouseOn() to scriptMouseOn(), and moved it to items.cpp
Renamed o_mouseOff() to scriptMouseOff(), and moved it to items.cpp
svn-id: r21760
2006-04-10 09:18:07 +00:00
|
|
|
void setTextColor(uint color);
|
|
|
|
void scriptMouseOn();
|
|
|
|
void scriptMouseOff();
|
2006-05-03 01:11:50 +00:00
|
|
|
void freezeBottom();
|
By now, it should be obvious that I'm trying to get rid of the o_ functions.
This is in preparation for the next stage of the cleanup.
By now, I have merged most of the o_ opcode functions into the corresponding
o1_ opcode function. There are a few pure o_ opcode functions left, but it
makes sense to keep them separate functions since they are part of groups of
other functions. Now, to get rid of the remaining o_ functions I have:
Dropped the "o_" prefix from the following functions: o_kill_sprite_simon1(),
o_kill_sprite_simon2(), o_waitForSync(), o_freezeBottom(), o_setTextColor(),
o_fadeToBlack(), o_waitForMark(), o_unk_132_helper_3(), o_unk_132_helper(),
o_clearCharacter(), o_fileError().
Renamed o_sync() to sendSync().
Renamed o_mouseOn() to scriptMouseOn(), and moved it to items.cpp
Renamed o_mouseOff() to scriptMouseOff(), and moved it to items.cpp
svn-id: r21760
2006-04-10 09:18:07 +00:00
|
|
|
void unfreezeBottom();
|
2002-12-04 22:40:16 +00:00
|
|
|
|
2004-03-14 17:50:40 +00:00
|
|
|
TextLocation *getTextLocation(uint a);
|
2002-04-12 21:26:59 +00:00
|
|
|
void setup_cond_c_helper();
|
|
|
|
|
2006-04-04 07:34:48 +00:00
|
|
|
void checkLinkBox();
|
2006-02-13 10:29:25 +00:00
|
|
|
void hyperLinkOn(uint16 x);
|
|
|
|
void hyperLinkOff();
|
2006-04-04 01:38:53 +00:00
|
|
|
void linksUp();
|
|
|
|
void linksDown();
|
|
|
|
void oracleTextUp();
|
|
|
|
void oracleTextDown();
|
2006-04-13 14:26:46 +00:00
|
|
|
void listSaveGames(int n);
|
|
|
|
void saveUserGame(int slot);
|
|
|
|
void windowBackSpace(WindowBlock *window);
|
2006-04-04 01:38:53 +00:00
|
|
|
|
2006-04-03 14:40:07 +00:00
|
|
|
void oracleLogo();
|
2006-04-04 07:34:48 +00:00
|
|
|
void scrollOracle();
|
2006-04-04 01:38:53 +00:00
|
|
|
void scrollOracleUp();
|
|
|
|
void scrollOracleDown();
|
2006-04-03 14:40:07 +00:00
|
|
|
void swapCharacterLogo();
|
|
|
|
|
2005-12-08 06:12:04 +00:00
|
|
|
void mouseOff();
|
|
|
|
void mouseOn();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-09-30 11:55:50 +00:00
|
|
|
bool block0Supported(int i, int y);
|
|
|
|
bool block1Supported(int i, int y);
|
2006-10-02 01:09:50 +00:00
|
|
|
void checkTiles();
|
|
|
|
void moveBlocks();
|
2006-10-02 05:39:27 +00:00
|
|
|
void dropBlock(int id, int priority, int num);
|
2006-10-02 01:09:50 +00:00
|
|
|
void droppingBlock();
|
2006-10-02 05:39:27 +00:00
|
|
|
void stopBlock(int id, int num);
|
2006-09-30 11:55:50 +00:00
|
|
|
void remove0Block(int i);
|
|
|
|
void remove1Block(int i);
|
|
|
|
void pairCheck();
|
|
|
|
void gravityCheck();
|
|
|
|
bool hasBlockLanded(int16 yofs, int16 block, int16 priority, int16 type, int16 x, int16 y, int16 z);
|
|
|
|
|
2006-09-19 11:59:13 +00:00
|
|
|
bool loadTablesIntoMem(uint subr_id);
|
2006-09-28 23:22:07 +00:00
|
|
|
bool loadTablesOldIntoMem(uint subr_id);
|
|
|
|
bool loadTablesNewIntoMem(uint subr_id);
|
2006-09-19 11:59:13 +00:00
|
|
|
bool loadXTablesIntoMem(uint subr_id);
|
2006-09-28 23:22:07 +00:00
|
|
|
void loadTextIntoMem(uint stringId);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-09-20 06:39:27 +00:00
|
|
|
bool loadRoomItems(uint item);
|
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
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();
|
2006-05-03 01:11:50 +00:00
|
|
|
void killAllTimers();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
void endCutscene();
|
2002-04-12 21:26:59 +00:00
|
|
|
void runSubroutine101();
|
2006-04-08 12:06:52 +00:00
|
|
|
|
2006-04-05 02:45:28 +00:00
|
|
|
void checkUp(WindowBlock *window);
|
|
|
|
void checkDown(WindowBlock *window);
|
|
|
|
void inventoryUp(WindowBlock *window);
|
|
|
|
void inventoryDown(WindowBlock *window);
|
2006-04-08 12:06:52 +00:00
|
|
|
|
2006-05-03 01:11:50 +00:00
|
|
|
WindowBlock *openWindow(uint x, uint y, uint w, uint h, uint flags, uint fill_color, uint text_color);
|
2006-04-08 07:13:07 +00:00
|
|
|
uint getWindowNum(WindowBlock *window);
|
2006-05-03 01:11:50 +00:00
|
|
|
void clearWindow(WindowBlock *window);
|
|
|
|
void changeWindow(uint a);
|
|
|
|
void closeWindow(uint a);
|
|
|
|
void windowPutChar(WindowBlock *window, byte c, byte b = 0);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-05-03 01:11:50 +00:00
|
|
|
HitArea *findBox(uint hitarea_id);
|
2006-04-15 07:56:55 +00:00
|
|
|
void boxController(uint x, uint y, uint mode);
|
2006-05-03 01:11:50 +00:00
|
|
|
void handleVerbClicked(uint verb);
|
2006-04-21 00:18:23 +00:00
|
|
|
void clearName();
|
2006-04-06 08:21:44 +00:00
|
|
|
void displayName(HitArea * ha);
|
2006-05-03 01:11:50 +00:00
|
|
|
void resetNameWindow();
|
2006-04-06 10:47:37 +00:00
|
|
|
void displayBoxStars();
|
2002-04-12 21:26:59 +00:00
|
|
|
void hitarea_stuff();
|
2006-05-03 01:11:50 +00:00
|
|
|
void invertBox_FF(HitArea *ha, bool state);
|
|
|
|
void invertBox(HitArea * ha, byte a, byte b, byte c, byte d);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-06 10:47:37 +00:00
|
|
|
void handleMouseMoved();
|
2002-04-12 21:26:59 +00:00
|
|
|
void pollMouseXY();
|
2006-09-30 06:47:41 +00:00
|
|
|
void initMouse();
|
|
|
|
void loadMouseImage();
|
2005-12-13 00:20:11 +00:00
|
|
|
void drawMousePointer();
|
2006-04-30 06:10:14 +00:00
|
|
|
void drawMousePointer_FF();
|
2006-05-02 18:04:22 +00:00
|
|
|
void drawMousePart(int image, byte x, byte y);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-08 12:06:52 +00:00
|
|
|
void defineArrowBoxes(WindowBlock *window);
|
|
|
|
void removeArrows(WindowBlock *window, uint num);
|
|
|
|
|
2006-04-05 02:45:28 +00:00
|
|
|
void draw_icon_c(WindowBlock *window, uint icon, uint x, uint y);
|
2002-04-12 21:26:59 +00:00
|
|
|
bool has_item_childflag_0x10(Item *item);
|
2006-04-06 00:54:26 +00:00
|
|
|
uint itemGetIconNumber(Item *item);
|
|
|
|
uint setupIconHitArea(WindowBlock *window, uint num, uint x, uint y, Item *item_ptr);
|
2006-04-08 12:06:52 +00:00
|
|
|
void drawIconArray(uint i, Item *item_ptr, int line, int classMask);
|
|
|
|
void drawIconArray_FF(uint i, Item *item_ptr, int line, int classMask);
|
|
|
|
void drawIconArray_Simon(uint i, Item *item_ptr, int line, int classMask);
|
|
|
|
void removeIconArray(uint num);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-03 14:40:07 +00:00
|
|
|
void loadIconData();
|
2002-04-12 21:26:59 +00:00
|
|
|
void loadIconFile();
|
2006-04-21 00:18:23 +00:00
|
|
|
|
2006-10-02 07:06:20 +00:00
|
|
|
bool checkArrows();
|
2002-04-12 21:26:59 +00:00
|
|
|
void processSpecialKeys();
|
|
|
|
void hitarea_stuff_helper();
|
|
|
|
|
2006-04-06 10:47:37 +00:00
|
|
|
void permitInput();
|
2006-04-13 14:26:46 +00:00
|
|
|
|
|
|
|
uint getFeebleFontSize(byte chr);
|
2002-04-12 21:26:59 +00:00
|
|
|
void showmessage_helper_3(uint a, uint b);
|
|
|
|
void showmessage_print_char(byte chr);
|
|
|
|
|
2006-04-24 04:34:57 +00:00
|
|
|
void set_video_mode_internal(uint16 mode, uint16 vga_res_id);
|
2002-07-07 19:06:48 +00:00
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
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-12-13 00:20:11 +00:00
|
|
|
void playSpeech(uint speech_id, uint vga_sprite_id);
|
2006-05-03 01:11:50 +00:00
|
|
|
void skipSpeech();
|
2002-07-07 19:06:48 +00:00
|
|
|
|
2006-04-07 03:03:20 +00:00
|
|
|
bool printNameOf(Item *item, uint x, uint y);
|
2006-05-03 01:11:50 +00:00
|
|
|
bool printTextOf(uint a, uint x, uint y);
|
|
|
|
void printVerbOf(uint hitarea_id);
|
|
|
|
void showActionString(const byte *string);
|
|
|
|
|
2006-04-07 03:03:20 +00:00
|
|
|
void printScreenText(uint vga_sprite_id, uint color, const char *string_ptr, int16 x, int16 y, int16 width);
|
2006-05-03 01:11:50 +00:00
|
|
|
void sendInteractText(uint16 num, const char *fmt, ...);
|
|
|
|
void printInteractText(uint16 num, const char *string);
|
2006-04-07 03:03:20 +00:00
|
|
|
|
2006-04-07 01:46:43 +00:00
|
|
|
void renderStringAmiga(uint vga_sprite_id, uint color, uint width, uint height, const char *txt);
|
|
|
|
void renderString(uint vga_sprite_id, uint color, uint width, uint height, const char *txt);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-10 23:44:17 +00:00
|
|
|
byte *allocBlock(uint32 size);
|
|
|
|
void checkNoOverWrite(byte *end);
|
|
|
|
void checkRunningAnims(byte *end);
|
|
|
|
void checkAnims(uint a, byte *end);
|
|
|
|
void checkZonePtrs(byte *end);
|
2006-05-03 01:11:50 +00:00
|
|
|
void setZoneBuffers();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-21 00:18:23 +00:00
|
|
|
void runVgaScript();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2003-06-15 11:52:42 +00:00
|
|
|
public:
|
2006-04-17 12:05:45 +00:00
|
|
|
bool getBitFlag(uint bit);
|
|
|
|
void setBitFlag(uint bit, bool value);
|
|
|
|
|
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();
|
2006-04-14 09:57:43 +00:00
|
|
|
void vc15_sync();
|
|
|
|
void vc16_waitSync();
|
2005-05-06 13:22:48 +00:00
|
|
|
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();
|
2006-04-14 09:57:43 +00:00
|
|
|
void vc51_enableBox();
|
2005-05-06 13:22:48 +00:00
|
|
|
void vc52_playSound();
|
2006-04-14 09:57:43 +00:00
|
|
|
void vc53_panSFX();
|
2005-05-06 13:22:48 +00:00
|
|
|
void vc54_no_op();
|
2006-04-14 09:57:43 +00:00
|
|
|
void vc55_moveBox();
|
2005-05-06 13:22:48 +00:00
|
|
|
void vc56_delay();
|
2006-09-19 11:59:13 +00:00
|
|
|
void vc57_blackPalette();
|
2005-05-06 13:22:48 +00:00
|
|
|
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
|
|
|
|
2006-04-07 09:37:44 +00:00
|
|
|
void setScriptCondition(bool cond);
|
|
|
|
bool getScriptCondition();
|
|
|
|
void setScriptReturn(int ret);
|
|
|
|
int getScriptReturn();
|
|
|
|
|
2006-04-06 17:56:41 +00:00
|
|
|
// Opcodes, Simon 1 and later
|
2006-04-10 09:49:03 +00:00
|
|
|
void o_at();
|
|
|
|
void o_notAt();
|
|
|
|
void o_carried();
|
|
|
|
void o_notCarried();
|
|
|
|
void o_isAt();
|
|
|
|
void o_zero();
|
|
|
|
void o_notZero();
|
|
|
|
void o_eq();
|
|
|
|
void o_notEq();
|
|
|
|
void o_gt();
|
|
|
|
void o_lt();
|
|
|
|
void o_eqf();
|
|
|
|
void o_notEqf();
|
|
|
|
void o_ltf();
|
|
|
|
void o_gtf();
|
|
|
|
void o_chance();
|
|
|
|
void o_isRoom();
|
|
|
|
void o_isObject();
|
|
|
|
void o_state();
|
|
|
|
void o_oflag();
|
|
|
|
void o_destroy();
|
|
|
|
void o_place();
|
|
|
|
void o_copyff();
|
|
|
|
void o_clear();
|
|
|
|
void o_let();
|
|
|
|
void o_add();
|
|
|
|
void o_sub();
|
|
|
|
void o_addf();
|
|
|
|
void o_subf();
|
|
|
|
void o_mul();
|
|
|
|
void o_div();
|
|
|
|
void o_mulf();
|
|
|
|
void o_divf();
|
|
|
|
void o_mod();
|
|
|
|
void o_modf();
|
|
|
|
void o_random();
|
|
|
|
void o_goto();
|
|
|
|
void o_oset();
|
|
|
|
void o_oclear();
|
|
|
|
void o_putBy();
|
|
|
|
void o_inc();
|
|
|
|
void o_dec();
|
|
|
|
void o_setState();
|
|
|
|
void o_print();
|
|
|
|
void o_message();
|
|
|
|
void o_msg();
|
|
|
|
void o_addTextBox();
|
|
|
|
void o_setShortText();
|
|
|
|
void o_setLongText();
|
|
|
|
void o_end();
|
|
|
|
void o_done();
|
|
|
|
void o_process();
|
|
|
|
void o_when();
|
|
|
|
void o_if1();
|
|
|
|
void o_if2();
|
|
|
|
void o_isCalled();
|
|
|
|
void o_is();
|
|
|
|
void o_debug();
|
|
|
|
void o_comment();
|
|
|
|
void o_haltAnimation();
|
|
|
|
void o_restartAnimation();
|
|
|
|
void o_getParent();
|
|
|
|
void o_getNext();
|
|
|
|
void o_getChildren();
|
|
|
|
void o_picture();
|
|
|
|
void o_loadZone();
|
|
|
|
void o_killAnimate();
|
|
|
|
void o_defWindow();
|
|
|
|
void o_window();
|
|
|
|
void o_cls();
|
|
|
|
void o_closeWindow();
|
|
|
|
void o_addBox();
|
|
|
|
void o_delBox();
|
|
|
|
void o_enableBox();
|
|
|
|
void o_disableBox();
|
|
|
|
void o_moveBox();
|
|
|
|
void o_doIcons();
|
|
|
|
void o_isClass();
|
|
|
|
void o_setClass();
|
|
|
|
void o_unsetClass();
|
|
|
|
void o_waitSync();
|
|
|
|
void o_sync();
|
|
|
|
void o_defObj();
|
|
|
|
void o_here();
|
|
|
|
void o_doClassIcons();
|
|
|
|
void o_waitEndTune();
|
|
|
|
void o_ifEndTune();
|
|
|
|
void o_setAdjNoun();
|
|
|
|
void o_saveUserGame();
|
|
|
|
void o_loadUserGame();
|
|
|
|
void o_stopTune();
|
|
|
|
void o_pauseGame();
|
|
|
|
void o_copysf();
|
|
|
|
void o_restoreIcons();
|
|
|
|
void o_freezeZones();
|
|
|
|
void o_placeNoIcons();
|
|
|
|
void o_clearTimers();
|
|
|
|
void o_setDollar();
|
|
|
|
void o_isBox();
|
|
|
|
void o_doTable();
|
|
|
|
void o_storeItem();
|
|
|
|
void o_getItem();
|
|
|
|
void o_bSet();
|
|
|
|
void o_bClear();
|
|
|
|
void o_bZero();
|
|
|
|
void o_bNotZero();
|
|
|
|
void o_getOValue();
|
|
|
|
void o_setOValue();
|
|
|
|
void o_ink();
|
|
|
|
void o_screenTextBox();
|
|
|
|
void o_screenTextMsg();
|
|
|
|
void o_playEffect();
|
|
|
|
void o_getDollar2();
|
|
|
|
void o_isAdjNoun();
|
|
|
|
void o_b2Set();
|
|
|
|
void o_b2Clear();
|
|
|
|
void o_b2Zero();
|
|
|
|
void o_b2NotZero();
|
|
|
|
void o_lockZones();
|
|
|
|
void o_unlockZones();
|
|
|
|
void o_getPathPosn();
|
|
|
|
void o_scnTxtLongText();
|
|
|
|
void o_mouseOn();
|
|
|
|
void o_unloadZone();
|
|
|
|
void o_unfreezeZones();
|
2006-04-10 10:07:56 +00:00
|
|
|
|
2006-09-19 11:59:13 +00:00
|
|
|
uint16 getDoorState(Item *item, uint16 d);
|
|
|
|
uint16 getExitOf(Item *item, uint16 d);
|
|
|
|
|
2006-09-30 02:15:02 +00:00
|
|
|
// Opcodes, Elvira 1 only
|
2006-10-01 08:36:31 +00:00
|
|
|
void oe1_present();
|
|
|
|
void oe1_notPresent();
|
|
|
|
void oe1_worn();
|
|
|
|
void oe1_notWorn();
|
|
|
|
void oe1_notCarried();
|
2006-09-30 02:15:02 +00:00
|
|
|
void oe1_setFF();
|
|
|
|
void oe1_zoneDisk();
|
2006-10-01 08:36:31 +00:00
|
|
|
void oe1_isNotAt();
|
|
|
|
void oe1_sibling();
|
|
|
|
void oe1_notSibling();
|
2006-09-30 02:15:02 +00:00
|
|
|
void oe1_opcode176();
|
|
|
|
void oe1_opcode178();
|
|
|
|
|
2006-09-19 11:59:13 +00:00
|
|
|
// Opcodes, Waxworks only
|
2006-10-01 10:04:23 +00:00
|
|
|
void oww_goto();
|
2006-09-19 11:59:13 +00:00
|
|
|
void oww_whereTo();
|
|
|
|
void oww_menu();
|
|
|
|
void oww_textMenu();
|
|
|
|
void oww_ifDoorOpen();
|
|
|
|
|
2006-04-10 10:07:56 +00:00
|
|
|
// Opcodes, Simon 1 only
|
|
|
|
void o1_printLongText();
|
|
|
|
void o1_rescan();
|
|
|
|
void o1_animate();
|
|
|
|
void o1_stopAnimate();
|
2006-04-10 10:18:55 +00:00
|
|
|
void o1_playTune();
|
2006-04-17 22:47:12 +00:00
|
|
|
void o1_screenTextPObj();
|
2006-04-10 10:07:56 +00:00
|
|
|
void o1_mouseOff();
|
|
|
|
void o1_loadBeard();
|
|
|
|
void o1_unloadBeard();
|
|
|
|
void o1_loadStrings();
|
|
|
|
void o1_specialFade();
|
2006-04-06 17:56:41 +00:00
|
|
|
|
|
|
|
// Opcodes, Simon 2 and later
|
2006-04-07 09:37:44 +00:00
|
|
|
void o2_printLongText();
|
|
|
|
void o2_rescan();
|
|
|
|
void o2_animate();
|
|
|
|
void o2_stopAnimate();
|
2006-04-10 10:18:55 +00:00
|
|
|
void o2_playTune();
|
2006-04-17 22:47:12 +00:00
|
|
|
void o2_screenTextPObj();
|
2006-04-07 09:37:44 +00:00
|
|
|
void o2_mouseOff();
|
|
|
|
void o2_isShortText();
|
|
|
|
void o2_clearMarks();
|
|
|
|
void o2_waitMark();
|
2006-04-06 17:56:41 +00:00
|
|
|
|
2006-04-10 10:07:56 +00:00
|
|
|
// Opcodes, Feeble Files only
|
2006-04-21 07:42:40 +00:00
|
|
|
void o3_chance();
|
2006-04-07 09:37:44 +00:00
|
|
|
void o3_jumpOut();
|
2006-04-08 12:06:52 +00:00
|
|
|
void o3_addTextBox();
|
2006-04-07 09:37:44 +00:00
|
|
|
void o3_printLongText();
|
2006-04-17 22:35:33 +00:00
|
|
|
void o3_addBox();
|
2006-04-07 09:37:44 +00:00
|
|
|
void o3_oracleTextDown();
|
|
|
|
void o3_oracleTextUp();
|
|
|
|
void o3_ifTime();
|
|
|
|
void o3_setTime();
|
2006-04-13 14:26:46 +00:00
|
|
|
void o3_saveUserGame();
|
2006-04-07 09:37:44 +00:00
|
|
|
void o3_loadUserGame();
|
|
|
|
void o3_listSaveGames();
|
|
|
|
void o3_checkCD();
|
|
|
|
void o3_screenTextBox();
|
2006-04-26 19:49:13 +00:00
|
|
|
void o3_isAdjNoun();
|
2006-04-07 09:37:44 +00:00
|
|
|
void o3_hyperLinkOn();
|
|
|
|
void o3_hyperLinkOff();
|
|
|
|
void o3_checkPaths();
|
2006-04-17 22:47:12 +00:00
|
|
|
void o3_screenTextPObj();
|
2006-04-07 09:37:44 +00:00
|
|
|
void o3_mouseOff();
|
2006-04-17 13:19:36 +00:00
|
|
|
void o3_loadVideo();
|
|
|
|
void o3_playVideo();
|
2006-04-07 09:37:44 +00:00
|
|
|
void o3_centreScroll();
|
|
|
|
void o3_resetPVCount();
|
|
|
|
void o3_setPathValues();
|
|
|
|
void o3_stopClock();
|
|
|
|
void o3_restartClock();
|
|
|
|
void o3_setColour();
|
|
|
|
void o3_b3Set();
|
|
|
|
void o3_b3Clear();
|
|
|
|
void o3_b3Zero();
|
|
|
|
void o3_b3NotZero();
|
2006-04-06 17:56:41 +00:00
|
|
|
|
2006-09-28 23:22:07 +00:00
|
|
|
// Opcodes, Puzzle Pack only
|
2006-10-02 04:46:50 +00:00
|
|
|
void o4_iconifyWindow();
|
2006-09-29 11:07:38 +00:00
|
|
|
void o4_restoreOopsPosition();
|
2006-09-29 05:31:33 +00:00
|
|
|
void o4_checkTiles();
|
2006-09-29 11:07:38 +00:00
|
|
|
void o4_loadMouseImage();
|
2006-09-30 12:39:34 +00:00
|
|
|
void o4_message();
|
2006-09-29 11:07:38 +00:00
|
|
|
void o4_setShortText();
|
|
|
|
void o4_animate();
|
2006-09-28 23:22:07 +00:00
|
|
|
void o4_loadHiScores();
|
|
|
|
void o4_checkHiScores();
|
2006-09-30 11:36:50 +00:00
|
|
|
void o4_sync();
|
2006-10-02 07:06:20 +00:00
|
|
|
void o4_saveUserGame();
|
2006-09-29 05:31:33 +00:00
|
|
|
void o4_loadUserGame();
|
|
|
|
void o4_saveOopsPosition();
|
2006-09-29 06:24:12 +00:00
|
|
|
void o4_resetGameTime();
|
2006-09-29 05:31:33 +00:00
|
|
|
void o4_resetPVCount();
|
|
|
|
void o4_setPathValues();
|
2006-09-29 11:07:38 +00:00
|
|
|
void o4_restartClock();
|
2006-09-28 23:22:07 +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);
|
2006-02-16 22:35:43 +00:00
|
|
|
bool drawImages_clip(VC10_state *state);
|
2006-03-16 03:15:05 +00:00
|
|
|
void scaleClip(int16 h, int16 w, int16 y, int16 x, int16 scrollY);
|
2006-04-07 14:27:28 +00:00
|
|
|
void horizontalScroll(VC10_state *state);
|
|
|
|
void verticalScroll(VC10_state *state);
|
|
|
|
|
2005-12-13 00:20:11 +00:00
|
|
|
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
|
|
|
|
2006-04-24 06:46:31 +00:00
|
|
|
int getScale(int16 y, int16 x);
|
2006-04-18 00:15:25 +00:00
|
|
|
void checkScrollX(int16 x, int16 xpos);
|
|
|
|
void checkScrollY(int16 y, int16 ypos);
|
2006-04-09 04:53:31 +00:00
|
|
|
void centreScroll();
|
2005-11-18 13:47:47 +00:00
|
|
|
|
2006-10-02 01:09:50 +00:00
|
|
|
void startOverlayAnims();
|
|
|
|
void startAnOverlayAnim();
|
2006-10-02 05:39:27 +00:00
|
|
|
void startBlock(uint windowNum, uint vga_res, uint vga_sprite_id, uint x, uint y, uint priority);
|
|
|
|
void checkIfClickedOnBlock();
|
2006-10-02 01:09:50 +00:00
|
|
|
|
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);
|
|
|
|
|
2006-09-30 07:15:19 +00:00
|
|
|
bool isVgaQueueEmpty();
|
2006-04-21 00:18:23 +00:00
|
|
|
void addVgaEvent(uint16 num, const byte *code_ptr, uint16 cur_sprite, uint16 curZoneNum, int32 param = 0);
|
|
|
|
void deleteVgaEvent(VgaTimerEntry * vte);
|
|
|
|
void processVgaEvents();
|
|
|
|
void animateEvent(const byte *code_ptr, uint16 curZoneNum, uint16 cur_sprite);
|
|
|
|
void panEvent(uint16 curZoneNum, uint16 cur_sprite, int32 param);
|
|
|
|
void scrollEvent();
|
2005-12-13 00:20:11 +00:00
|
|
|
|
2006-04-21 00:18:23 +00:00
|
|
|
VgaSprite *findCurSprite();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-10 23:44:17 +00:00
|
|
|
bool isSpriteLoaded(uint16 id, uint16 zoneNum);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-09 06:06:10 +00:00
|
|
|
void resetWindow(WindowBlock *window);
|
2002-04-12 21:26:59 +00:00
|
|
|
void delete_hitarea_by_index(uint index);
|
|
|
|
|
2006-04-06 10:47:37 +00:00
|
|
|
void windowPutChar(uint a);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-05 02:45:28 +00:00
|
|
|
void restoreWindow(WindowBlock *window);
|
|
|
|
void colorWindow(WindowBlock *window);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-08 07:13:07 +00:00
|
|
|
void restoreBlock(uint h, uint w, uint y, uint x);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-03-16 04:10:34 +00:00
|
|
|
byte *getFrontBuf();
|
2006-03-22 13:54:26 +00:00
|
|
|
byte *getBackBuf();
|
2006-04-15 22:37:48 +00:00
|
|
|
byte *getBackGround();
|
2006-03-16 04:10:34 +00:00
|
|
|
byte *getScaleBuf();
|
2006-03-16 03:15:05 +00:00
|
|
|
|
2006-04-21 22:10:50 +00:00
|
|
|
byte *loadVGAFile(uint id, uint type, uint32 &dstSize);
|
2006-04-21 00:18:23 +00:00
|
|
|
void loadSimonVGAFile(uint vga_id);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-15 20:36:41 +00:00
|
|
|
int init();
|
2004-11-23 00:03:25 +00:00
|
|
|
int go();
|
2006-04-21 00:18:23 +00:00
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
void openGameFile();
|
2006-04-21 00:18:23 +00:00
|
|
|
void readGameFile(void *dst, uint32 offs, uint32 size);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
void timer_callback();
|
|
|
|
void timer_proc1();
|
|
|
|
|
2006-04-21 00:18:23 +00:00
|
|
|
void animateSprites();
|
2006-04-21 00:26:18 +00:00
|
|
|
void animateSpritesDebug();
|
2006-04-21 03:09:21 +00:00
|
|
|
void animateSpritesByY();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
|
|
|
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);
|
2006-03-27 12:49:17 +00:00
|
|
|
void dump_bitmap(const char *filename, const byte *offs, int w, int h, int flags, const byte *palette, byte base);
|
2002-06-29 16:11:13 +00:00
|
|
|
|
2006-04-15 22:37:48 +00:00
|
|
|
void clearBackFromTop(uint lines);
|
|
|
|
void fillFrontFromBack(uint x, uint y, uint w, uint h);
|
|
|
|
void fillBackGroundFromBack(uint lines);
|
|
|
|
void fillBackFromFront(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);
|
2006-04-05 02:45:28 +00:00
|
|
|
void print_char_helper_5(WindowBlock *window);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
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
|
|
|
|
2006-04-08 07:13:07 +00:00
|
|
|
void openTextWindow();
|
|
|
|
void tidyIconArray(uint i);
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-05 02:45:28 +00:00
|
|
|
void video_putchar_newline(WindowBlock *window);
|
|
|
|
void video_putchar_drawchar(WindowBlock *window, 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
|
|
|
|
By now, it should be obvious that I'm trying to get rid of the o_ functions.
This is in preparation for the next stage of the cleanup.
By now, I have merged most of the o_ opcode functions into the corresponding
o1_ opcode function. There are a few pure o_ opcode functions left, but it
makes sense to keep them separate functions since they are part of groups of
other functions. Now, to get rid of the remaining o_ functions I have:
Dropped the "o_" prefix from the following functions: o_kill_sprite_simon1(),
o_kill_sprite_simon2(), o_waitForSync(), o_freezeBottom(), o_setTextColor(),
o_fadeToBlack(), o_waitForMark(), o_unk_132_helper_3(), o_unk_132_helper(),
o_clearCharacter(), o_fileError().
Renamed o_sync() to sendSync().
Renamed o_mouseOn() to scriptMouseOn(), and moved it to items.cpp
Renamed o_mouseOff() to scriptMouseOff(), and moved it to items.cpp
svn-id: r21760
2006-04-10 09:18:07 +00:00
|
|
|
void waitForMark(uint i);
|
2006-04-21 00:18:23 +00:00
|
|
|
void scrollScreen();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-04-08 00:12:16 +00:00
|
|
|
void decodeColumn(byte *dst, const byte *src, int height);
|
|
|
|
void decodeRow(byte *dst, const byte *src, int width);
|
2002-04-12 21:26:59 +00:00
|
|
|
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
|
|
|
|
2006-06-02 08:06:50 +00:00
|
|
|
void userGame(bool load);
|
|
|
|
void disableFileBoxes();
|
|
|
|
int userGameGetKey(bool *b, char *buf);
|
|
|
|
void userGameBackSpace(WindowBlock *window, int x, byte b = 0);
|
|
|
|
void listSaveGames(char *buf);
|
By now, it should be obvious that I'm trying to get rid of the o_ functions.
This is in preparation for the next stage of the cleanup.
By now, I have merged most of the o_ opcode functions into the corresponding
o1_ opcode function. There are a few pure o_ opcode functions left, but it
makes sense to keep them separate functions since they are part of groups of
other functions. Now, to get rid of the remaining o_ functions I have:
Dropped the "o_" prefix from the following functions: o_kill_sprite_simon1(),
o_kill_sprite_simon2(), o_waitForSync(), o_freezeBottom(), o_setTextColor(),
o_fadeToBlack(), o_waitForMark(), o_unk_132_helper_3(), o_unk_132_helper(),
o_clearCharacter(), o_fileError().
Renamed o_sync() to sendSync().
Renamed o_mouseOn() to scriptMouseOn(), and moved it to items.cpp
Renamed o_mouseOff() to scriptMouseOff(), and moved it to items.cpp
svn-id: r21760
2006-04-10 09:18:07 +00:00
|
|
|
void fileError(WindowBlock *window, 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
|
|
|
|
2006-05-03 01:11:50 +00:00
|
|
|
char *genSaveName(int slot);
|
2002-04-12 21:26:59 +00:00
|
|
|
};
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
} // End of namespace AGOS
|
2003-10-03 19:42:27 +00:00
|
|
|
|
2002-08-18 16:21:34 +00:00
|
|
|
#endif
|