2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
2006-05-23 23:43:52 +00:00
|
|
|
*
|
2007-05-30 21:56:52 +00:00
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2006-05-23 23:43:52 +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
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2006-05-24 14:25:42 +00:00
|
|
|
#ifndef AGI_H
|
|
|
|
#define AGI_H
|
2006-05-23 23:43:52 +00:00
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
|
|
|
#include "common/endian.h"
|
|
|
|
#include "common/util.h"
|
|
|
|
#include "common/file.h"
|
2007-11-22 10:32:36 +00:00
|
|
|
#include "common/stack.h"
|
2010-01-03 20:15:44 +00:00
|
|
|
#include "common/system.h"
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2006-09-23 00:42:35 +00:00
|
|
|
#include "engines/engine.h"
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2010-01-03 20:15:44 +00:00
|
|
|
#include "gui/debugger.h"
|
|
|
|
|
2010-06-18 22:06:56 +00:00
|
|
|
// AGI resources
|
|
|
|
#include "agi/console.h"
|
|
|
|
#include "agi/view.h"
|
|
|
|
#include "agi/picture.h"
|
|
|
|
#include "agi/logic.h"
|
|
|
|
#include "agi/sound.h"
|
|
|
|
|
|
|
|
|
2010-03-18 15:07:11 +00:00
|
|
|
namespace Common { class RandomSource; }
|
|
|
|
|
2009-11-24 22:10:14 +00:00
|
|
|
/**
|
|
|
|
* This is the namespace of the AGI engine.
|
|
|
|
*
|
|
|
|
* Status of this engine: ???
|
|
|
|
*
|
2010-10-15 12:48:19 +00:00
|
|
|
* Games using this engine:
|
|
|
|
* - Early Sierra adventure games
|
|
|
|
* - many fan made games
|
|
|
|
* - Mickey's Space Adventure (Pre-AGI)
|
|
|
|
* - Winnie the Pooh in the Hundred Acre Wood (Pre-AGI)
|
|
|
|
* - Troll's Tale (Pre-AGI)
|
2009-11-24 22:10:14 +00:00
|
|
|
*/
|
2006-05-23 23:43:52 +00:00
|
|
|
namespace Agi {
|
|
|
|
|
|
|
|
typedef signed int Err;
|
|
|
|
|
2009-06-06 17:39:13 +00:00
|
|
|
//
|
|
|
|
// Version and other definitions
|
|
|
|
//
|
2006-05-23 23:43:52 +00:00
|
|
|
|
|
|
|
#define TITLE "AGI engine"
|
|
|
|
|
|
|
|
#define DIR_ "dir"
|
|
|
|
#define LOGDIR "logdir"
|
|
|
|
#define PICDIR "picdir"
|
|
|
|
#define VIEWDIR "viewdir"
|
|
|
|
#define SNDDIR "snddir"
|
|
|
|
#define OBJECTS "object"
|
|
|
|
#define WORDS "words.tok"
|
|
|
|
|
|
|
|
#define MAX_DIRS 256
|
|
|
|
#define MAX_VARS 256
|
|
|
|
#define MAX_FLAGS (256 >> 3)
|
2009-06-06 17:39:13 +00:00
|
|
|
#define MAX_VIEWTABLE 255 // KQ3 uses o255!
|
2006-05-23 23:43:52 +00:00
|
|
|
#define MAX_WORDS 20
|
2009-06-06 17:39:13 +00:00
|
|
|
#define MAX_STRINGS 24 // MAX_STRINGS + 1 used for get.num
|
2006-05-23 23:43:52 +00:00
|
|
|
#define MAX_STRINGLEN 40
|
2009-06-06 17:48:09 +00:00
|
|
|
#define MAX_CONTROLLERS 39
|
2006-05-23 23:43:52 +00:00
|
|
|
|
|
|
|
#define _EMPTY 0xfffff
|
|
|
|
#define EGO_OWNED 0xff
|
|
|
|
|
|
|
|
#define CRYPT_KEY_SIERRA "Avis Durgan"
|
|
|
|
#define CRYPT_KEY_AGDS "Alex Simkin"
|
|
|
|
|
2011-04-14 12:12:27 +00:00
|
|
|
#define MSG_BOX_COLOR 0x0f // White
|
2009-06-06 17:39:13 +00:00
|
|
|
#define MSG_BOX_TEXT 0x00 // Black
|
|
|
|
#define MSG_BOX_LINE 0x04 // Red
|
|
|
|
#define BUTTON_BORDER 0x00 // Black
|
|
|
|
#define STATUS_FG 0x00 // Black
|
|
|
|
#define STATUS_BG 0x0f // White
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2007-01-12 02:29:20 +00:00
|
|
|
#define ADD_PIC 1
|
|
|
|
#define ADD_VIEW 2
|
|
|
|
|
2009-06-06 17:43:26 +00:00
|
|
|
#define CMD_BSIZE 12
|
|
|
|
|
2007-08-14 13:36:03 +00:00
|
|
|
enum AgiGameID {
|
|
|
|
GID_AGIDEMO,
|
|
|
|
GID_BC,
|
|
|
|
GID_DDP,
|
|
|
|
GID_GOLDRUSH,
|
|
|
|
GID_KQ1,
|
|
|
|
GID_KQ2,
|
|
|
|
GID_KQ3,
|
|
|
|
GID_KQ4,
|
|
|
|
GID_LSL1,
|
|
|
|
GID_MH1,
|
|
|
|
GID_MH2,
|
|
|
|
GID_MIXEDUP,
|
|
|
|
GID_PQ1,
|
|
|
|
GID_SQ1,
|
|
|
|
GID_SQ2,
|
|
|
|
GID_XMASCARD,
|
2007-09-18 16:20:44 +00:00
|
|
|
GID_FANMADE,
|
2010-06-15 10:29:20 +00:00
|
|
|
GID_GETOUTTASQ, // Fanmade
|
2010-06-21 21:32:56 +00:00
|
|
|
GID_SQ0, // Fanmade
|
2007-09-06 10:48:00 +00:00
|
|
|
GID_MICKEY, // PreAGI
|
2007-09-18 16:20:44 +00:00
|
|
|
GID_WINNIE, // PreAGI
|
2010-06-15 10:29:20 +00:00
|
|
|
GID_TROLL // PreAGI
|
2007-08-14 13:36:03 +00:00
|
|
|
};
|
|
|
|
|
2006-12-19 01:11:41 +00:00
|
|
|
enum AgiGameType {
|
2007-09-01 14:58:46 +00:00
|
|
|
GType_PreAGI = 0,
|
2006-12-19 01:11:41 +00:00
|
|
|
GType_V2 = 1,
|
2007-09-01 14:58:46 +00:00
|
|
|
GType_V3 = 2
|
2006-12-19 01:11:41 +00:00
|
|
|
};
|
|
|
|
|
2009-06-06 17:39:13 +00:00
|
|
|
//
|
|
|
|
// GF_OLDAMIGAV20 means that the interpreter is an old Amiga AGI interpreter that
|
|
|
|
// uses value 20 for the computer type (v20 i.e. vComputer) rather than the usual value 5.
|
|
|
|
//
|
|
|
|
// GF_CLIPCOORDS means that views' coordinates must be clipped at least in commands
|
|
|
|
// position and position.v.
|
|
|
|
//
|
2006-12-19 01:11:41 +00:00
|
|
|
enum AgiGameFeatures {
|
2007-02-13 15:27:36 +00:00
|
|
|
GF_AGIMOUSE = (1 << 0),
|
|
|
|
GF_AGDS = (1 << 1),
|
|
|
|
GF_AGI256 = (1 << 2),
|
|
|
|
GF_AGI256_2 = (1 << 3),
|
|
|
|
GF_AGIPAL = (1 << 4),
|
|
|
|
GF_MACGOLDRUSH = (1 << 5),
|
2007-07-09 12:03:53 +00:00
|
|
|
GF_FANMADE = (1 << 6),
|
2007-07-17 20:17:28 +00:00
|
|
|
GF_MENUS = (1 << 7),
|
2008-01-02 19:10:01 +00:00
|
|
|
GF_ESCPAUSE = (1 << 8),
|
2008-01-03 08:41:40 +00:00
|
|
|
GF_OLDAMIGAV20 = (1 << 9),
|
2010-06-15 10:35:10 +00:00
|
|
|
GF_CLIPCOORDS = (1 << 10),
|
|
|
|
GF_2GSOLDSOUND = (1 << 11)
|
2007-05-06 14:36:02 +00:00
|
|
|
};
|
|
|
|
|
2007-01-21 20:24:38 +00:00
|
|
|
struct AGIGameDescription;
|
2006-12-19 01:11:41 +00:00
|
|
|
|
2006-05-23 23:43:52 +00:00
|
|
|
enum {
|
|
|
|
NO_GAMEDIR = 0,
|
|
|
|
GAMEDIR
|
|
|
|
};
|
|
|
|
|
|
|
|
enum AGIErrors {
|
2007-01-16 12:40:51 +00:00
|
|
|
errOK = 0,
|
|
|
|
errDoNothing,
|
|
|
|
errBadCLISwitch,
|
|
|
|
errInvalidAGIFile,
|
|
|
|
errBadFileOpen,
|
|
|
|
errNotEnoughMemory,
|
|
|
|
errBadResource,
|
|
|
|
errUnknownAGIVersion,
|
|
|
|
errNoLoopsInView,
|
|
|
|
errViewDataError,
|
|
|
|
errNoGameList,
|
2007-08-04 06:18:28 +00:00
|
|
|
errIOError,
|
2007-01-16 12:40:51 +00:00
|
|
|
|
|
|
|
errUnk = 127
|
2006-05-23 23:43:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum kDebugLevels {
|
|
|
|
kDebugLevelMain = 1 << 0,
|
|
|
|
kDebugLevelResources = 1 << 1,
|
|
|
|
kDebugLevelSprites = 1 << 2,
|
|
|
|
kDebugLevelInventory = 1 << 3,
|
|
|
|
kDebugLevelInput = 1 << 4,
|
|
|
|
kDebugLevelMenu = 1 << 5,
|
|
|
|
kDebugLevelScripts = 1 << 6,
|
|
|
|
kDebugLevelSound = 1 << 7,
|
2007-01-12 02:29:20 +00:00
|
|
|
kDebugLevelText = 1 << 8,
|
|
|
|
kDebugLevelSavegame = 1 << 9
|
2006-05-23 23:43:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* AGI resources.
|
|
|
|
*/
|
|
|
|
enum {
|
|
|
|
rLOGIC = 1,
|
|
|
|
rSOUND,
|
|
|
|
rVIEW,
|
|
|
|
rPICTURE
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
RES_LOADED = 1,
|
|
|
|
RES_COMPRESSED = 0x40
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
lCOMMAND_MODE = 1,
|
|
|
|
lTEST_MODE
|
|
|
|
};
|
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
struct gameIdList {
|
|
|
|
gameIdList *next;
|
2006-05-23 23:43:52 +00:00
|
|
|
uint32 version;
|
|
|
|
uint32 crc;
|
|
|
|
char *gName;
|
|
|
|
char *switches;
|
|
|
|
};
|
|
|
|
|
2006-12-06 19:27:02 +00:00
|
|
|
struct Mouse {
|
2006-05-23 23:43:52 +00:00
|
|
|
int button;
|
2009-06-06 17:47:29 +00:00
|
|
|
int x;
|
|
|
|
int y;
|
2006-05-23 23:43:52 +00:00
|
|
|
};
|
|
|
|
|
2008-01-23 00:06:10 +00:00
|
|
|
// Used by AGI Mouse protocol 1.0 for v27 (i.e. button pressed -variable).
|
|
|
|
enum AgiMouseButton {
|
|
|
|
kAgiMouseButtonUp, // Mouse button is up (not pressed)
|
|
|
|
kAgiMouseButtonLeft, // Left mouse button
|
|
|
|
kAgiMouseButtonRight, // Right mouse button
|
|
|
|
kAgiMouseButtonMiddle // Middle mouse button
|
|
|
|
};
|
|
|
|
|
2006-05-23 23:43:52 +00:00
|
|
|
enum GameId {
|
|
|
|
GID_AGI = 1
|
|
|
|
};
|
|
|
|
|
|
|
|
#define WIN_TO_PIC_X(x) ((x) / 2)
|
|
|
|
#define WIN_TO_PIC_Y(y) ((y) < 8 ? 999 : (y) >= (8 + _HEIGHT) ? 999 : (y) - 8)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* AGI variables.
|
|
|
|
*/
|
|
|
|
enum {
|
2009-06-06 17:39:13 +00:00
|
|
|
vCurRoom = 0, // 0
|
2007-01-16 12:40:51 +00:00
|
|
|
vPrevRoom,
|
|
|
|
vBorderTouchEgo,
|
|
|
|
vScore,
|
|
|
|
vBorderCode,
|
2009-06-06 17:39:13 +00:00
|
|
|
vBorderTouchObj, // 5
|
2007-01-16 12:40:51 +00:00
|
|
|
vEgoDir,
|
|
|
|
vMaxScore,
|
|
|
|
vFreePages,
|
|
|
|
vWordNotFound,
|
2009-06-06 17:39:13 +00:00
|
|
|
vTimeDelay, // 10
|
2007-01-16 12:40:51 +00:00
|
|
|
vSeconds,
|
|
|
|
vMinutes,
|
|
|
|
vHours,
|
|
|
|
vDays,
|
2009-06-06 17:39:13 +00:00
|
|
|
vJoystickSensitivity, // 15
|
2007-01-16 12:40:51 +00:00
|
|
|
vEgoViewResource,
|
|
|
|
vAgiErrCode,
|
|
|
|
vAgiErrCodeInfo,
|
|
|
|
vKey,
|
2009-06-06 17:39:13 +00:00
|
|
|
vComputer, // 20
|
2007-01-16 12:40:51 +00:00
|
|
|
vWindowReset,
|
|
|
|
vSoundgen,
|
|
|
|
vVolume,
|
|
|
|
vMaxInputChars,
|
2009-06-06 17:39:13 +00:00
|
|
|
vSelItem, // 25
|
2007-01-16 12:40:51 +00:00
|
|
|
vMonitor
|
2006-05-23 23:43:52 +00:00
|
|
|
};
|
|
|
|
|
2007-06-29 15:58:48 +00:00
|
|
|
/**
|
|
|
|
* Different monitor types.
|
|
|
|
* Used with AGI variable 26 i.e. vMonitor.
|
|
|
|
*/
|
|
|
|
enum AgiMonitorType {
|
|
|
|
kAgiMonitorCga = 0,
|
|
|
|
// kAgiMonitorTandy = 1, // Not sure about this
|
|
|
|
kAgiMonitorHercules = 2,
|
2007-06-29 18:41:06 +00:00
|
|
|
kAgiMonitorEga = 3
|
2007-06-29 15:58:48 +00:00
|
|
|
// kAgiMonitorVga = 4 // Not sure about this
|
|
|
|
};
|
|
|
|
|
2008-01-02 16:36:47 +00:00
|
|
|
/**
|
|
|
|
* Different computer types.
|
|
|
|
* Used with AGI variable 20 i.e. vComputer.
|
2008-01-02 19:10:01 +00:00
|
|
|
*
|
|
|
|
* At least these Amiga AGI versions use value 5:
|
|
|
|
* 2.082 (King's Quest I v1.0U 1986)
|
2008-01-16 15:19:33 +00:00
|
|
|
* 2.090 (King's Quest III v1.01 1986-11-08)
|
2008-01-02 19:10:01 +00:00
|
|
|
* x.yyy (Black Cauldron v2.00 1987-06-14)
|
|
|
|
* x.yyy (Larry I v1.05 1987-06-26)
|
|
|
|
* 2.107 (King's Quest II v2.0J. Date is probably 1987-01-29)
|
2008-01-17 11:36:54 +00:00
|
|
|
* 2.202 (Space Quest II v2.0F)
|
2008-01-02 19:10:01 +00:00
|
|
|
* 2.310 (Police Quest I v2.0B 1989-02-22)
|
|
|
|
* 2.316 (Gold Rush! v2.05 1989-03-09)
|
|
|
|
* 2.333 (King's Quest III v2.15 1989-11-15)
|
|
|
|
*
|
|
|
|
* At least these Amiga AGI versions use value 20:
|
|
|
|
* 2.082 (Space Quest I v1.2 1986)
|
2009-02-16 04:45:29 +00:00
|
|
|
* x.yyy (Manhunter NY 1.06 3/18/89)
|
|
|
|
* 2.333 (Manhunter SF 3.06 8/17/89)
|
2008-01-02 19:10:01 +00:00
|
|
|
*
|
2008-01-02 16:36:47 +00:00
|
|
|
*/
|
|
|
|
enum AgiComputerType {
|
|
|
|
kAgiComputerPC = 0,
|
|
|
|
kAgiComputerAtariST = 4,
|
2008-01-02 19:10:01 +00:00
|
|
|
kAgiComputerAmiga = 5, // Newer Amiga AGI interpreters' value (Commonly used)
|
|
|
|
kAgiComputerApple2GS = 7,
|
|
|
|
kAgiComputerAmigaOld = 20 // Older Amiga AGI interpreters' value (Seldom used)
|
2008-01-02 16:36:47 +00:00
|
|
|
};
|
|
|
|
|
2010-06-15 10:35:10 +00:00
|
|
|
enum AgiSoundType {
|
|
|
|
kAgiSoundPC = 1,
|
|
|
|
kAgiSoundTandy = 3, // Tandy (This value is also used by the Amiga AGI and Apple IIGS AGI)
|
|
|
|
kAgiSound2GSOld = 8 // Apple IIGS's Gold Rush! (Version 1.0M 1989-02-28 (CE), AGI 3.003) uses value 8
|
|
|
|
};
|
|
|
|
|
2006-05-23 23:43:52 +00:00
|
|
|
/**
|
|
|
|
* AGI flags
|
|
|
|
*/
|
|
|
|
enum {
|
2009-06-06 17:39:13 +00:00
|
|
|
fEgoWater = 0, // 0
|
2007-01-16 12:40:51 +00:00
|
|
|
fEgoInvisible,
|
|
|
|
fEnteredCli,
|
|
|
|
fEgoTouchedP2,
|
|
|
|
fSaidAcceptedInput,
|
2009-06-06 17:39:13 +00:00
|
|
|
fNewRoomExec, // 5
|
2007-01-16 12:40:51 +00:00
|
|
|
fRestartGame,
|
|
|
|
fScriptBlocked,
|
|
|
|
fJoySensitivity,
|
|
|
|
fSoundOn,
|
2009-06-06 17:39:13 +00:00
|
|
|
fDebuggerOn, // 10
|
2007-01-16 12:40:51 +00:00
|
|
|
fLogicZeroFirsttime,
|
|
|
|
fRestoreJustRan,
|
|
|
|
fStatusSelectsItems,
|
|
|
|
fMenusWork,
|
2009-06-06 17:39:13 +00:00
|
|
|
fOutputMode, // 15
|
2009-06-06 17:42:37 +00:00
|
|
|
fAutoRestart
|
2006-05-23 23:43:52 +00:00
|
|
|
};
|
|
|
|
|
2009-06-06 17:41:29 +00:00
|
|
|
enum AgiSlowliness {
|
|
|
|
kPauseRoom = 1500,
|
|
|
|
kPausePicture = 500
|
|
|
|
};
|
|
|
|
|
2009-06-06 17:48:09 +00:00
|
|
|
struct AgiController {
|
|
|
|
uint16 keycode;
|
|
|
|
uint8 controller;
|
2006-05-23 23:43:52 +00:00
|
|
|
};
|
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
struct AgiObject {
|
2006-05-23 23:43:52 +00:00
|
|
|
int location;
|
|
|
|
char *name;
|
|
|
|
};
|
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
struct AgiWord {
|
2006-05-23 23:43:52 +00:00
|
|
|
int id;
|
|
|
|
char *word;
|
|
|
|
};
|
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
struct AgiDir {
|
2006-05-23 23:43:52 +00:00
|
|
|
uint8 volume;
|
|
|
|
uint32 offset;
|
|
|
|
uint32 len;
|
|
|
|
uint32 clen;
|
2009-06-06 17:39:13 +00:00
|
|
|
|
|
|
|
// 0 = not in mem, can be freed
|
|
|
|
// 1 = in mem, can be released
|
|
|
|
// 2 = not in mem, cant be released
|
|
|
|
// 3 = in mem, cant be released
|
|
|
|
// 0x40 = was compressed
|
2006-05-23 23:43:52 +00:00
|
|
|
uint8 flags;
|
|
|
|
};
|
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
struct AgiBlock {
|
2006-05-23 23:43:52 +00:00
|
|
|
int active;
|
|
|
|
int x1, y1;
|
|
|
|
int x2, y2;
|
2009-06-06 17:39:13 +00:00
|
|
|
uint8 *buffer; // used for window background
|
2006-05-23 23:43:52 +00:00
|
|
|
};
|
|
|
|
|
2007-07-10 15:28:43 +00:00
|
|
|
/** AGI text color (Background and foreground color). */
|
|
|
|
struct AgiTextColor {
|
2007-07-10 15:45:30 +00:00
|
|
|
/** Creates an AGI text color. Uses black text on white background by default. */
|
|
|
|
AgiTextColor(int fgColor = 0x00, int bgColor = 0x0F) : fg(fgColor), bg(bgColor) {}
|
2007-07-10 15:28:43 +00:00
|
|
|
|
|
|
|
/** Get an AGI text color with swapped foreground and background color. */
|
|
|
|
AgiTextColor swap() const { return AgiTextColor(bg, fg); }
|
|
|
|
|
|
|
|
int fg; ///< Foreground color (Used for text).
|
|
|
|
int bg; ///< Background color (Used for text's background).
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* AGI button style (Amiga or PC).
|
|
|
|
*
|
|
|
|
* Supports positive and negative button types (Used with Amiga-style only):
|
|
|
|
* Positive buttons do what the dialog was opened for.
|
|
|
|
* Negative buttons cancel what the dialog was opened for.
|
|
|
|
* Restart-dialog example: Restart-button is positive, Cancel-button negative.
|
|
|
|
* Paused-dialog example: Continue-button is positive.
|
|
|
|
*/
|
|
|
|
struct AgiButtonStyle {
|
|
|
|
// Public constants etc
|
|
|
|
public:
|
|
|
|
static const int
|
|
|
|
// Amiga colors (Indexes into the Amiga-ish palette)
|
|
|
|
amigaBlack = 0x00, ///< Accurate, is #000000 (24-bit RGB)
|
|
|
|
amigaWhite = 0x0F, ///< Practically accurate, is close to #FFFFFF (24-bit RGB)
|
|
|
|
amigaGreen = 0x02, ///< Quite accurate, should be #008A00 (24-bit RGB)
|
2007-09-19 08:40:12 +00:00
|
|
|
amigaOrange = 0x0C, ///< Inaccurate, too much blue, should be #FF7500 (24-bit RGB)
|
2007-07-10 15:28:43 +00:00
|
|
|
amigaPurple = 0x0D, ///< Inaccurate, too much green, should be #FF00FF (24-bit RGB)
|
|
|
|
amigaRed = 0x04, ///< Quite accurate, should be #BD0000 (24-bit RGB)
|
|
|
|
amigaCyan = 0x0B, ///< Inaccurate, too much red, should be #00FFDE (24-bit RGB)
|
|
|
|
// PC colors (Indexes into the EGA-palette)
|
|
|
|
pcBlack = 0x00,
|
|
|
|
pcWhite = 0x0F;
|
|
|
|
|
|
|
|
// Public methods
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Get the color of the button with the given state and type using current style.
|
|
|
|
*
|
|
|
|
* @param hasFocus True if button has focus, false otherwise.
|
|
|
|
* @param pressed True if button is being pressed, false otherwise.
|
|
|
|
* @param positive True if button is positive, false if button is negative. Only matters for Amiga-style buttons.
|
|
|
|
*/
|
|
|
|
AgiTextColor getColor(bool hasFocus, bool pressed, bool positive = true) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the color of a button with the given base color and state ignoring current style.
|
|
|
|
* Swaps foreground and background color when the button has focus or is being pressed.
|
|
|
|
*
|
|
|
|
* @param hasFocus True if button has focus, false otherwise.
|
|
|
|
* @param pressed True if button is being pressed, false otherwise.
|
|
|
|
* @param baseFgColor Foreground color of the button when it has no focus and is not being pressed.
|
|
|
|
* @param baseBgColor Background color of the button when it has no focus and is not being pressed.
|
|
|
|
*/
|
2007-07-10 17:04:09 +00:00
|
|
|
AgiTextColor getColor(bool hasFocus, bool pressed, int baseFgColor, int baseBgColor) const;
|
2007-07-10 15:28:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the color of a button with the given base color and state ignoring current style.
|
|
|
|
* Swaps foreground and background color when the button has focus or is being pressed.
|
|
|
|
*
|
|
|
|
* @param hasFocus True if button has focus, false otherwise.
|
|
|
|
* @param pressed True if button is being pressed, false otherwise.
|
|
|
|
* @param baseColor Color of the button when it has no focus and is not being pressed.
|
|
|
|
*/
|
|
|
|
AgiTextColor getColor(bool hasFocus, bool pressed, const AgiTextColor &baseColor) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* How many pixels to offset the shown text diagonally down and to the right.
|
|
|
|
* Currently only used for pressed PC-style buttons.
|
|
|
|
*/
|
|
|
|
int getTextOffset(bool hasFocus, bool pressed) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Show border around the button?
|
|
|
|
* Currently border is only used for in focus or pressed Amiga-style buttons
|
|
|
|
* when in inauthentic Amiga-style mode.
|
|
|
|
*/
|
|
|
|
bool getBorder(bool hasFocus, bool pressed) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set Amiga-button style.
|
|
|
|
*
|
|
|
|
* @param amigaStyle Set Amiga-button style if true, otherwise set PC-button style.
|
|
|
|
* @param olderAgi If true then use older AGI style in Amiga-mode, otherwise use newer.
|
|
|
|
* @param authenticAmiga If true then don't use a border around buttons in Amiga-mode, otherwise use.
|
|
|
|
*/
|
|
|
|
void setAmigaStyle(bool amigaStyle = true, bool olderAgi = false, bool authenticAmiga = false);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set PC-button style.
|
|
|
|
* @param pcStyle Set PC-button style if true, otherwise set default Amiga-button style.
|
|
|
|
*/
|
|
|
|
void setPcStyle(bool pcStyle = true);
|
|
|
|
|
|
|
|
// Public constructors
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Create a button style based on the given rendering mode.
|
|
|
|
* @param renderMode If Common::kRenderAmiga then creates default Amiga-button style, otherwise PC-style.
|
|
|
|
*/
|
|
|
|
AgiButtonStyle(Common::RenderMode renderMode = Common::kRenderDefault);
|
|
|
|
|
|
|
|
// Private member variables
|
|
|
|
private:
|
|
|
|
bool _amigaStyle; ///< Use Amiga-style buttons if true, otherwise use PC-style buttons.
|
|
|
|
bool _olderAgi; ///< Use older AGI style in Amiga-style mode.
|
|
|
|
bool _authenticAmiga; ///< Don't use border around buttons in Amiga-style mode.
|
|
|
|
};
|
|
|
|
|
2009-06-06 17:43:26 +00:00
|
|
|
struct ScriptPos {
|
|
|
|
int script;
|
|
|
|
int curIP;
|
|
|
|
};
|
|
|
|
|
2010-06-18 22:07:32 +00:00
|
|
|
enum {
|
|
|
|
EGO_VIEW_TABLE = 0,
|
|
|
|
HORIZON = 36,
|
|
|
|
_WIDTH = 160,
|
|
|
|
_HEIGHT = 168
|
|
|
|
};
|
|
|
|
|
|
|
|
enum InputMode {
|
|
|
|
INPUT_NORMAL = 0x01,
|
|
|
|
INPUT_GETSTRING = 0x02,
|
|
|
|
INPUT_MENU = 0x03,
|
|
|
|
INPUT_NONE = 0x04
|
|
|
|
};
|
|
|
|
|
|
|
|
enum State {
|
|
|
|
STATE_INIT = 0x00,
|
|
|
|
STATE_LOADED = 0x01,
|
|
|
|
STATE_RUNNING = 0x02
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
SBUF16_OFFSET = 0,
|
|
|
|
SBUF256_OFFSET = ((_WIDTH) * (_HEIGHT)),
|
|
|
|
FROM_SBUF16_TO_SBUF256_OFFSET = ((SBUF256_OFFSET) - (SBUF16_OFFSET)),
|
|
|
|
FROM_SBUF256_TO_SBUF16_OFFSET = ((SBUF16_OFFSET) - (SBUF256_OFFSET))
|
|
|
|
};
|
2006-05-23 23:43:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* AGI game structure.
|
|
|
|
* This structure contains all global data of an AGI game executed
|
|
|
|
* by the interpreter.
|
|
|
|
*/
|
2007-01-16 12:40:51 +00:00
|
|
|
struct AgiGame {
|
2010-06-18 22:07:32 +00:00
|
|
|
State state; /**< state of the interpreter */
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2008-01-21 21:09:42 +00:00
|
|
|
// TODO: Check whether adjMouseX and adjMouseY must be saved and loaded when using savegames.
|
|
|
|
// If they must be then loading and saving is partially broken at the moment.
|
|
|
|
int adjMouseX; /**< last given adj.ego.move.to.x.y-command's 1st parameter */
|
|
|
|
int adjMouseY; /**< last given adj.ego.move.to.x.y-command's 2nd parameter */
|
|
|
|
|
2006-05-25 19:56:05 +00:00
|
|
|
char name[8]; /**< lead in id (e.g. `GR' for goldrush) */
|
2006-05-23 23:43:52 +00:00
|
|
|
char id[8]; /**< game id */
|
|
|
|
uint32 crc; /**< game CRC */
|
|
|
|
|
2009-06-06 17:39:13 +00:00
|
|
|
// game flags and variables
|
2006-05-25 19:56:05 +00:00
|
|
|
uint8 flags[MAX_FLAGS]; /**< 256 1-bit flags */
|
|
|
|
uint8 vars[MAX_VARS]; /**< 256 variables */
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2009-06-06 17:39:13 +00:00
|
|
|
// internal variables
|
2006-05-25 19:56:05 +00:00
|
|
|
int horizon; /**< horizon y coordinate */
|
2007-01-16 12:40:51 +00:00
|
|
|
int lineStatus; /**< line number to put status on */
|
|
|
|
int lineUserInput; /**< line to put user input on */
|
|
|
|
int lineMinPrint; /**< num lines to print on */
|
|
|
|
int cursorPos; /**< column where the input cursor is */
|
2010-10-15 08:49:20 +00:00
|
|
|
byte inputBuffer[40]; /**< buffer for user input */
|
|
|
|
byte echoBuffer[40]; /**< buffer for echo.line */
|
2006-05-23 23:43:52 +00:00
|
|
|
int keypress;
|
2010-06-18 22:07:32 +00:00
|
|
|
|
|
|
|
InputMode inputMode; /**< keyboard input mode */
|
|
|
|
bool inputEnabled; /**< keyboard input enabled */
|
2006-05-25 19:56:05 +00:00
|
|
|
int lognum; /**< current logic number */
|
2009-06-06 17:43:26 +00:00
|
|
|
Common::Array<ScriptPos> execStack;
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2009-06-06 17:39:13 +00:00
|
|
|
// internal flags
|
2007-01-16 12:40:51 +00:00
|
|
|
int playerControl; /**< player is in control */
|
|
|
|
int statusLine; /**< status line on/off */
|
|
|
|
int clockEnabled; /**< clock is on/off */
|
|
|
|
int exitAllLogics; /**< break cycle after new.room */
|
|
|
|
int pictureShown; /**< show.pic has been issued */
|
|
|
|
int hasPrompt; /**< input prompt has been printed */
|
2006-05-23 23:43:52 +00:00
|
|
|
#define ID_AGDS 0x00000001
|
|
|
|
#define ID_AMIGA 0x00000002
|
2007-01-16 12:40:51 +00:00
|
|
|
int gameFlags; /**< agi options flags */
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
uint8 priTable[_HEIGHT];/**< priority table */
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2009-06-06 17:39:13 +00:00
|
|
|
// windows
|
2007-01-16 12:40:51 +00:00
|
|
|
uint32 msgBoxTicks; /**< timed message box tick counter */
|
|
|
|
AgiBlock block;
|
|
|
|
AgiBlock window;
|
|
|
|
int hasWindow;
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2009-06-06 17:39:13 +00:00
|
|
|
// graphics & text
|
2007-01-16 12:40:51 +00:00
|
|
|
int gfxMode;
|
|
|
|
char cursorChar;
|
|
|
|
unsigned int colorFg;
|
|
|
|
unsigned int colorBg;
|
2010-06-18 22:07:32 +00:00
|
|
|
|
2007-09-19 08:40:12 +00:00
|
|
|
uint8 *sbufOrig; /**< Pointer to the 160x336 AGI screen buffer that contains vertically two 160x168 screens (16 color and 256 color). */
|
2007-06-20 22:54:51 +00:00
|
|
|
uint8 *sbuf16c; /**< 160x168 16 color (+control line & priority information) AGI screen buffer. Points at sbufOrig + SBUF16_OFFSET. */
|
|
|
|
uint8 *sbuf256c; /**< 160x168 256 color AGI screen buffer (For AGI256 and AGI256-2 support). Points at sbufOrig + SBUF256_OFFSET. */
|
2007-09-19 08:40:12 +00:00
|
|
|
uint8 *sbuf; /**< Currently chosen AGI screen buffer (sbuf256c if AGI256 or AGI256-2 is used, otherwise sbuf16c). */
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2009-06-06 17:39:13 +00:00
|
|
|
// player command line
|
2007-01-16 12:40:51 +00:00
|
|
|
AgiWord egoWords[MAX_WORDS];
|
|
|
|
int numEgoWords;
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
unsigned int numObjects;
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2009-06-06 17:48:09 +00:00
|
|
|
bool controllerOccured[MAX_DIRS]; /**< keyboard keypress events */
|
|
|
|
AgiController controllers[MAX_CONTROLLERS];
|
|
|
|
int lastController;
|
|
|
|
|
2006-05-25 19:56:05 +00:00
|
|
|
char strings[MAX_STRINGS + 1][MAX_STRINGLEN]; /**< strings */
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2009-06-06 17:39:13 +00:00
|
|
|
// directory entries for resources
|
2007-01-16 12:40:51 +00:00
|
|
|
AgiDir dirLogic[MAX_DIRS];
|
|
|
|
AgiDir dirPic[MAX_DIRS];
|
|
|
|
AgiDir dirView[MAX_DIRS];
|
|
|
|
AgiDir dirSound[MAX_DIRS];
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2009-06-06 17:39:13 +00:00
|
|
|
// resources
|
2008-01-28 00:14:17 +00:00
|
|
|
AgiPicture pictures[MAX_DIRS]; /**< AGI picture resources */
|
2007-01-16 12:40:51 +00:00
|
|
|
AgiLogic logics[MAX_DIRS]; /**< AGI logic resources */
|
|
|
|
AgiView views[MAX_DIRS]; /**< AGI view resources */
|
2007-08-15 22:00:31 +00:00
|
|
|
AgiSound *sounds[MAX_DIRS]; /**< Pointers to AGI sound resources */
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2009-06-06 17:39:13 +00:00
|
|
|
// view table
|
2007-02-03 21:37:52 +00:00
|
|
|
VtEntry viewTable[MAX_VIEWTABLE];
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2009-06-06 17:47:29 +00:00
|
|
|
int32 ver; /**< detected game version */
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2009-06-06 17:47:29 +00:00
|
|
|
int simpleSave; /**< select simple savegames */
|
|
|
|
|
|
|
|
Common::Rect mouseFence; /**< rectangle set by fence.mouse command */
|
2006-05-23 23:43:52 +00:00
|
|
|
};
|
|
|
|
|
2006-12-06 19:27:02 +00:00
|
|
|
class AgiLoader {
|
|
|
|
public:
|
|
|
|
|
|
|
|
AgiLoader() {}
|
2006-12-06 21:23:01 +00:00
|
|
|
virtual ~AgiLoader() {}
|
2006-12-06 19:27:02 +00:00
|
|
|
|
|
|
|
virtual int init() = 0;
|
|
|
|
virtual int deinit() = 0;
|
2007-01-16 12:40:51 +00:00
|
|
|
virtual int detectGame() = 0;
|
|
|
|
virtual int loadResource(int, int) = 0;
|
|
|
|
virtual int unloadResource(int, int) = 0;
|
|
|
|
virtual int loadObjects(const char *) = 0;
|
|
|
|
virtual int loadWords(const char *) = 0;
|
2006-12-06 19:27:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class AgiLoader_v2 : public AgiLoader {
|
|
|
|
private:
|
|
|
|
AgiEngine *_vm;
|
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
int loadDir(AgiDir *agid, const char *fname);
|
|
|
|
uint8 *loadVolRes(AgiDir *agid);
|
2006-12-06 19:27:02 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
AgiLoader_v2(AgiEngine *vm) {
|
|
|
|
_vm = vm;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual int init();
|
|
|
|
virtual int deinit();
|
2007-01-16 12:40:51 +00:00
|
|
|
virtual int detectGame();
|
|
|
|
virtual int loadResource(int, int);
|
|
|
|
virtual int unloadResource(int, int);
|
|
|
|
virtual int loadObjects(const char *);
|
|
|
|
virtual int loadWords(const char *);
|
2006-12-06 19:27:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class AgiLoader_v3 : public AgiLoader {
|
|
|
|
private:
|
|
|
|
AgiEngine *_vm;
|
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
int loadDir(AgiDir *agid, Common::File *fp, uint32 offs, uint32 len);
|
|
|
|
uint8 *loadVolRes(AgiDir *agid);
|
2006-12-06 19:27:02 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
AgiLoader_v3(AgiEngine *vm) {
|
|
|
|
_vm = vm;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual int init();
|
|
|
|
virtual int deinit();
|
2007-01-16 12:40:51 +00:00
|
|
|
virtual int detectGame();
|
|
|
|
virtual int loadResource(int, int);
|
|
|
|
virtual int unloadResource(int, int);
|
|
|
|
virtual int loadObjects(const char *);
|
|
|
|
virtual int loadWords(const char *);
|
2006-05-23 23:43:52 +00:00
|
|
|
};
|
|
|
|
|
2006-12-06 19:27:02 +00:00
|
|
|
class GfxMgr;
|
|
|
|
class SpritesMgr;
|
|
|
|
class Menu;
|
2007-02-12 00:21:30 +00:00
|
|
|
class SearchTree;
|
2006-12-06 19:27:02 +00:00
|
|
|
|
2009-06-06 17:39:13 +00:00
|
|
|
// Image stack support
|
2007-01-16 12:40:51 +00:00
|
|
|
struct ImageStackElement {
|
2006-12-06 19:27:02 +00:00
|
|
|
uint8 type;
|
|
|
|
uint8 pad;
|
|
|
|
int16 parm1;
|
|
|
|
int16 parm2;
|
|
|
|
int16 parm3;
|
|
|
|
int16 parm4;
|
|
|
|
int16 parm5;
|
|
|
|
int16 parm6;
|
|
|
|
int16 parm7;
|
|
|
|
};
|
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
struct StringData {
|
2006-12-06 19:27:02 +00:00
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int len;
|
|
|
|
int str;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define TICK_SECONDS 20
|
|
|
|
|
|
|
|
#define KEY_QUEUE_SIZE 16
|
|
|
|
|
2007-09-01 14:58:46 +00:00
|
|
|
class AgiBase : public ::Engine {
|
2007-11-23 10:51:16 +00:00
|
|
|
protected:
|
|
|
|
// Engine API
|
2009-03-01 04:30:55 +00:00
|
|
|
Common::Error init();
|
|
|
|
virtual Common::Error go() = 0;
|
|
|
|
virtual Common::Error run() {
|
|
|
|
Common::Error err;
|
|
|
|
err = init();
|
2011-04-18 15:39:31 +00:00
|
|
|
if (err.getCode() != Common::kNoError)
|
2009-03-01 04:30:55 +00:00
|
|
|
return err;
|
|
|
|
return go();
|
|
|
|
}
|
2008-11-04 16:11:40 +00:00
|
|
|
virtual bool hasFeature(EngineFeature f) const;
|
2007-11-23 10:51:16 +00:00
|
|
|
|
|
|
|
virtual void initialize() = 0;
|
|
|
|
|
2007-09-01 14:58:46 +00:00
|
|
|
public:
|
2007-11-23 10:51:16 +00:00
|
|
|
GfxMgr *_gfx;
|
|
|
|
|
2007-09-01 14:58:46 +00:00
|
|
|
AgiButtonStyle _defaultButtonStyle;
|
|
|
|
AgiButtonStyle _buttonStyle;
|
|
|
|
Common::RenderMode _renderMode;
|
|
|
|
volatile uint32 _clockCount;
|
|
|
|
AgiDebug _debug;
|
|
|
|
AgiGame _game;
|
|
|
|
Common::RandomSource *_rnd;
|
|
|
|
|
2009-10-20 11:13:00 +00:00
|
|
|
Mouse _mouse;
|
|
|
|
|
2009-06-06 17:42:37 +00:00
|
|
|
bool _noSaveLoadAllowed;
|
|
|
|
|
2009-11-02 21:54:57 +00:00
|
|
|
virtual void pollTimer() = 0;
|
|
|
|
virtual int getKeypress() = 0;
|
|
|
|
virtual bool isKeypress() = 0;
|
|
|
|
virtual void clearKeyQueue() = 0;
|
2007-09-01 14:58:46 +00:00
|
|
|
|
2007-11-03 21:06:58 +00:00
|
|
|
AgiBase(OSystem *syst, const AGIGameDescription *gameDesc);
|
2007-09-01 14:58:46 +00:00
|
|
|
|
|
|
|
virtual void clearImageStack() = 0;
|
|
|
|
virtual void recordImageStackCall(uint8 type, int16 p1, int16 p2, int16 p3,
|
|
|
|
int16 p4, int16 p5, int16 p6, int16 p7) = 0;
|
|
|
|
virtual void replayImageStackCall(uint8 type, int16 p1, int16 p2, int16 p3,
|
|
|
|
int16 p4, int16 p5, int16 p6, int16 p7) = 0;
|
|
|
|
virtual void releaseImageStack() = 0;
|
2008-11-10 19:02:47 +00:00
|
|
|
virtual int saveGame(const char *fileName, const char *saveName) = 0;
|
|
|
|
virtual int loadGame(const char *fileName, bool checkId = true) = 0;
|
2007-09-01 14:58:46 +00:00
|
|
|
|
2007-09-03 09:39:15 +00:00
|
|
|
int _soundemu;
|
|
|
|
|
|
|
|
int getflag(int);
|
|
|
|
void setflag(int, int);
|
|
|
|
void flipflag(int);
|
|
|
|
|
2007-09-01 14:58:46 +00:00
|
|
|
const AGIGameDescription *_gameDescription;
|
2009-06-06 17:44:46 +00:00
|
|
|
|
|
|
|
uint32 _gameFeatures;
|
2009-06-06 17:45:52 +00:00
|
|
|
uint16 _gameVersion;
|
2009-06-06 17:44:46 +00:00
|
|
|
|
2007-09-01 14:58:46 +00:00
|
|
|
uint32 getGameID() const;
|
|
|
|
uint32 getFeatures() const;
|
|
|
|
uint16 getVersion() const;
|
|
|
|
uint16 getGameType() const;
|
2007-09-23 16:43:43 +00:00
|
|
|
Common::Language getLanguage() const;
|
2007-09-01 14:58:46 +00:00
|
|
|
Common::Platform getPlatform() const;
|
2009-06-06 17:41:50 +00:00
|
|
|
const char *getGameMD5() const;
|
2009-11-02 21:54:57 +00:00
|
|
|
void initFeatures();
|
2009-06-06 17:44:46 +00:00
|
|
|
void setFeature(uint32 feature);
|
2009-11-02 21:54:57 +00:00
|
|
|
void initVersion();
|
2009-06-06 17:45:52 +00:00
|
|
|
void setVersion(uint16 version);
|
2009-06-06 17:41:50 +00:00
|
|
|
|
2008-11-10 19:02:47 +00:00
|
|
|
bool canLoadGameStateCurrently();
|
|
|
|
bool canSaveGameStateCurrently();
|
2007-09-01 14:58:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class AgiEngine : public AgiBase {
|
2006-12-06 19:27:02 +00:00
|
|
|
protected:
|
2008-11-04 16:11:40 +00:00
|
|
|
// Engine APIs
|
2008-11-06 17:05:54 +00:00
|
|
|
virtual Common::Error go();
|
2008-11-04 16:11:40 +00:00
|
|
|
|
2006-12-06 19:27:02 +00:00
|
|
|
void initialize();
|
|
|
|
|
2008-08-10 22:53:43 +00:00
|
|
|
uint32 _lastSaveTime;
|
|
|
|
|
2006-12-06 19:27:02 +00:00
|
|
|
public:
|
2007-11-03 21:06:58 +00:00
|
|
|
AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc);
|
2006-12-06 19:27:02 +00:00
|
|
|
virtual ~AgiEngine();
|
|
|
|
|
2009-08-03 17:18:18 +00:00
|
|
|
Common::Error loadGameState(int slot);
|
|
|
|
Common::Error saveGameState(int slot, const char *desc);
|
2008-07-07 05:51:39 +00:00
|
|
|
|
2006-12-06 19:27:02 +00:00
|
|
|
private:
|
2011-03-05 09:32:56 +00:00
|
|
|
uint32 _lastTick;
|
2009-10-20 11:13:00 +00:00
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
int _keyQueue[KEY_QUEUE_SIZE];
|
|
|
|
int _keyQueueStart;
|
|
|
|
int _keyQueueEnd;
|
2006-12-06 19:27:02 +00:00
|
|
|
|
2007-03-17 16:08:29 +00:00
|
|
|
bool _allowSynthetic;
|
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
int checkPriority(VtEntry *v);
|
|
|
|
int checkCollision(VtEntry *v);
|
|
|
|
int checkPosition(VtEntry *v);
|
2006-12-06 19:27:02 +00:00
|
|
|
|
2009-11-02 21:54:57 +00:00
|
|
|
void parseFeatures();
|
2006-12-06 19:27:02 +00:00
|
|
|
|
2007-03-12 08:43:13 +00:00
|
|
|
int _firstSlot;
|
|
|
|
|
2006-12-06 19:27:02 +00:00
|
|
|
public:
|
2009-06-06 17:39:13 +00:00
|
|
|
AgiObject *_objects; // objects in the game
|
2006-12-06 19:27:02 +00:00
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
StringData _stringdata;
|
2006-12-06 19:27:02 +00:00
|
|
|
|
2007-01-12 02:29:20 +00:00
|
|
|
const char *getSavegameFilename(int num);
|
2007-03-12 19:19:30 +00:00
|
|
|
void getSavegameDescription(int num, char *buf, bool showEmpty = true);
|
2007-01-12 02:29:20 +00:00
|
|
|
int selectSlot();
|
|
|
|
int saveGame(const char *fileName, const char *saveName);
|
|
|
|
int saveGameDialog();
|
|
|
|
int saveGameSimple();
|
2007-04-22 16:06:00 +00:00
|
|
|
int loadGame(const char *fileName, bool checkId = true);
|
2007-01-12 02:29:20 +00:00
|
|
|
int loadGameDialog();
|
|
|
|
int loadGameSimple();
|
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
uint8 *_intobj;
|
2010-06-18 22:07:32 +00:00
|
|
|
InputMode _oldMode;
|
2009-06-06 17:40:56 +00:00
|
|
|
bool _restartGame;
|
2006-12-06 19:27:02 +00:00
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
Menu* _menu;
|
2009-06-06 17:43:51 +00:00
|
|
|
bool _menuSelected;
|
2006-12-06 19:27:02 +00:00
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
char _lastSentence[40];
|
2006-12-06 19:27:02 +00:00
|
|
|
|
|
|
|
SpritesMgr *_sprites;
|
|
|
|
SoundMgr *_sound;
|
|
|
|
PictureMgr *_picture;
|
2009-06-06 17:39:13 +00:00
|
|
|
AgiLoader *_loader; // loader
|
2006-12-06 19:27:02 +00:00
|
|
|
|
2007-11-22 10:32:36 +00:00
|
|
|
Common::Stack<ImageStackElement> _imageStack;
|
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
void clearImageStack();
|
|
|
|
void recordImageStackCall(uint8 type, int16 p1, int16 p2, int16 p3,
|
2006-12-06 19:27:02 +00:00
|
|
|
int16 p4, int16 p5, int16 p6, int16 p7);
|
2007-01-16 12:40:51 +00:00
|
|
|
void replayImageStackCall(uint8 type, int16 p1, int16 p2, int16 p3,
|
2006-12-06 19:27:02 +00:00
|
|
|
int16 p4, int16 p5, int16 p6, int16 p7);
|
2007-01-16 12:40:51 +00:00
|
|
|
void releaseImageStack();
|
2006-12-06 19:27:02 +00:00
|
|
|
|
2009-06-06 17:39:42 +00:00
|
|
|
void pause(uint32 msec);
|
|
|
|
|
2006-12-06 19:27:02 +00:00
|
|
|
Console *_console;
|
2009-08-30 21:43:07 +00:00
|
|
|
GUI::Debugger *getDebugger() { return _console; }
|
2006-12-06 19:27:02 +00:00
|
|
|
|
|
|
|
int agiInit();
|
|
|
|
int agiDeinit();
|
|
|
|
int agiDetectGame();
|
|
|
|
int agiLoadResource(int, int);
|
|
|
|
int agiUnloadResource(int, int);
|
|
|
|
void agiUnloadResources();
|
|
|
|
|
2009-11-02 21:54:57 +00:00
|
|
|
virtual void pollTimer();
|
|
|
|
virtual int getKeypress();
|
|
|
|
virtual bool isKeypress();
|
|
|
|
virtual void clearKeyQueue();
|
2009-06-06 17:45:52 +00:00
|
|
|
|
2006-12-06 19:27:02 +00:00
|
|
|
void initPriTable();
|
|
|
|
|
2010-06-18 22:07:32 +00:00
|
|
|
void newInputMode(InputMode mode);
|
2007-01-16 12:40:51 +00:00
|
|
|
void oldInputMode();
|
2006-12-06 19:27:02 +00:00
|
|
|
|
|
|
|
int getvar(int);
|
|
|
|
void setvar(int, int);
|
2009-06-06 17:45:52 +00:00
|
|
|
void decrypt(uint8 *mem, int len);
|
2007-01-16 12:40:51 +00:00
|
|
|
void releaseSprites();
|
|
|
|
int mainCycle();
|
|
|
|
int viewPictures();
|
|
|
|
int runGame();
|
2006-12-06 19:27:02 +00:00
|
|
|
void inventory();
|
2007-01-16 12:40:51 +00:00
|
|
|
void updateTimer();
|
|
|
|
int getAppDir(char *appDir, unsigned int size);
|
|
|
|
|
2009-06-06 17:45:52 +00:00
|
|
|
int setupV2Game(int ver);
|
|
|
|
int setupV3Game(int ver);
|
2007-01-16 12:40:51 +00:00
|
|
|
|
|
|
|
void newRoom(int n);
|
|
|
|
void resetControllers();
|
|
|
|
void interpretCycle();
|
|
|
|
int playGame();
|
2006-12-06 19:27:02 +00:00
|
|
|
|
|
|
|
void printItem(int n, int fg, int bg);
|
|
|
|
int findItem();
|
|
|
|
int showItems();
|
|
|
|
void selectItems(int n);
|
|
|
|
|
2007-03-17 16:08:29 +00:00
|
|
|
void allowSynthetic(bool);
|
2006-12-06 19:27:02 +00:00
|
|
|
void processEvents();
|
2007-10-31 21:28:33 +00:00
|
|
|
void checkQuickLoad();
|
2006-12-06 19:27:02 +00:00
|
|
|
|
|
|
|
// Objects
|
2007-01-16 12:40:51 +00:00
|
|
|
int showObjects();
|
|
|
|
int decodeObjects(uint8 *mem, uint32 flen);
|
|
|
|
int loadObjects(const char *fname);
|
|
|
|
int allocObjects(int);
|
|
|
|
void unloadObjects();
|
|
|
|
const char *objectName(unsigned int);
|
|
|
|
int objectGetLocation(unsigned int);
|
|
|
|
void objectSetLocation(unsigned int, int);
|
2006-12-06 19:27:02 +00:00
|
|
|
|
|
|
|
// Logic
|
2007-01-16 12:40:51 +00:00
|
|
|
int decodeLogic(int);
|
|
|
|
void unloadLogic(int);
|
|
|
|
int runLogic(int);
|
|
|
|
void debugConsole(int, int, const char *);
|
|
|
|
int testIfCode(int);
|
|
|
|
void executeAgiCommand(uint8, uint8 *);
|
2006-12-06 19:27:02 +00:00
|
|
|
|
2010-06-21 21:34:06 +00:00
|
|
|
private:
|
|
|
|
// Some submethods of testIfCode
|
|
|
|
uint8 testObjRight(uint8, uint8, uint8, uint8, uint8);
|
2011-04-14 12:34:28 +00:00
|
|
|
uint8 testObjCenter(uint8, uint8, uint8, uint8, uint8);
|
2010-06-21 21:34:06 +00:00
|
|
|
uint8 testObjInBox(uint8, uint8, uint8, uint8, uint8);
|
|
|
|
uint8 testPosn(uint8, uint8, uint8, uint8, uint8);
|
|
|
|
uint8 testSaid(uint8, uint8 *);
|
|
|
|
uint8 testController(uint8);
|
|
|
|
uint8 testKeypressed();
|
|
|
|
uint8 testCompareStrings(uint8, uint8);
|
|
|
|
|
2006-12-06 19:27:02 +00:00
|
|
|
// View
|
|
|
|
private:
|
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
void lSetCel(VtEntry *v, int n);
|
|
|
|
void lSetLoop(VtEntry *v, int n);
|
|
|
|
void updateView(VtEntry *v);
|
2006-12-06 19:27:02 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
void setCel(VtEntry *, int);
|
2008-01-03 08:41:40 +00:00
|
|
|
void clipViewCoordinates(VtEntry *v);
|
2007-01-16 12:40:51 +00:00
|
|
|
void setLoop(VtEntry *, int);
|
|
|
|
void setView(VtEntry *, int);
|
|
|
|
void startUpdate(VtEntry *);
|
|
|
|
void stopUpdate(VtEntry *);
|
|
|
|
void updateViewtable();
|
|
|
|
void unloadView(int);
|
|
|
|
int decodeView(int);
|
|
|
|
void addToPic(int, int, int, int, int, int, int);
|
|
|
|
void drawObj(int);
|
|
|
|
bool isEgoView(const VtEntry *v);
|
2006-12-06 19:27:02 +00:00
|
|
|
|
|
|
|
// Words
|
2007-01-16 12:40:51 +00:00
|
|
|
int showWords();
|
|
|
|
int loadWords(const char *);
|
|
|
|
void unloadWords();
|
|
|
|
int findWord(char *word, int *flen);
|
|
|
|
void dictionaryWords(char *);
|
2006-12-06 19:27:02 +00:00
|
|
|
|
|
|
|
// Motion
|
|
|
|
private:
|
2007-01-16 12:40:51 +00:00
|
|
|
int checkStep(int delta, int step);
|
|
|
|
int checkBlock(int x, int y);
|
|
|
|
void changePos(VtEntry *v);
|
|
|
|
void motionWander(VtEntry *v);
|
|
|
|
void motionFollowEgo(VtEntry *v);
|
|
|
|
void motionMoveObj(VtEntry *v);
|
|
|
|
void checkMotion(VtEntry *v);
|
2009-06-06 17:46:19 +00:00
|
|
|
|
2006-12-06 19:27:02 +00:00
|
|
|
public:
|
2007-01-16 12:40:51 +00:00
|
|
|
void checkAllMotions();
|
|
|
|
void moveObj(VtEntry *);
|
|
|
|
void inDestination(VtEntry *);
|
|
|
|
void fixPosition(int);
|
|
|
|
void updatePosition();
|
|
|
|
int getDirection(int x0, int y0, int x, int y, int s);
|
2006-12-06 19:27:02 +00:00
|
|
|
|
2009-06-06 17:46:19 +00:00
|
|
|
bool _egoHoldKey;
|
|
|
|
|
2006-12-06 19:27:02 +00:00
|
|
|
// Keyboard
|
2007-01-16 12:40:51 +00:00
|
|
|
void initWords();
|
|
|
|
void cleanInput();
|
|
|
|
int doPollKeyboard();
|
|
|
|
void cleanKeyboard();
|
|
|
|
void handleKeys(int);
|
|
|
|
void handleGetstring(int);
|
|
|
|
int handleController(int);
|
|
|
|
void getString(int, int, int, int);
|
|
|
|
uint16 agiGetKeypress();
|
|
|
|
int waitKey();
|
|
|
|
int waitAnyKey();
|
2006-12-06 19:27:02 +00:00
|
|
|
|
|
|
|
// Text
|
|
|
|
public:
|
2007-01-16 12:40:51 +00:00
|
|
|
int messageBox(const char *);
|
|
|
|
int selectionBox(const char *, const char **);
|
2009-11-02 21:54:57 +00:00
|
|
|
void closeWindow();
|
2007-01-16 12:40:51 +00:00
|
|
|
void drawWindow(int, int, int, int);
|
|
|
|
void printText(const char *, int, int, int, int, int, int, bool checkerboard = false);
|
|
|
|
void printTextConsole(const char *, int, int, int, int, int);
|
2006-12-06 19:27:02 +00:00
|
|
|
int print(const char *, int, int, int);
|
2009-01-07 13:27:58 +00:00
|
|
|
char *wordWrapString(const char *, int *);
|
2007-01-16 12:40:51 +00:00
|
|
|
char *agiSprintf(const char *);
|
2009-11-02 21:54:57 +00:00
|
|
|
void writeStatus();
|
|
|
|
void writePrompt();
|
|
|
|
void clearPrompt();
|
2007-01-16 12:40:51 +00:00
|
|
|
void clearLines(int, int, int);
|
|
|
|
void flushLines(int, int);
|
2009-11-02 21:54:57 +00:00
|
|
|
bool predictiveDialog();
|
2006-12-06 19:27:02 +00:00
|
|
|
|
|
|
|
private:
|
2009-07-01 20:51:04 +00:00
|
|
|
void printStatus(const char *message, ...) GCC_PRINTF(2, 3);
|
2007-01-16 12:40:51 +00:00
|
|
|
void printText2(int l, const char *msg, int foff, int xoff, int yoff, int len, int fg, int bg, bool checkerboard = false);
|
|
|
|
void blitTextbox(const char *p, int y, int x, int len);
|
|
|
|
void eraseTextbox();
|
2009-11-02 21:54:57 +00:00
|
|
|
void loadDict();
|
|
|
|
bool matchWord();
|
2006-12-06 19:27:02 +00:00
|
|
|
|
2007-06-13 12:48:14 +00:00
|
|
|
// Predictive dialog
|
2007-06-13 13:26:46 +00:00
|
|
|
// TODO: Move this to a separate class
|
2007-06-13 12:48:14 +00:00
|
|
|
char *_predictiveDictText;
|
|
|
|
char **_predictiveDictLine;
|
2007-06-13 13:26:46 +00:00
|
|
|
int32 _predictiveDictLineCount;
|
2007-06-13 12:48:14 +00:00
|
|
|
char *_predictiveDictActLine;
|
2011-01-05 13:04:08 +00:00
|
|
|
Common::String _currentCode;
|
|
|
|
Common::String _currentWord;
|
2006-12-06 19:27:02 +00:00
|
|
|
int _wordNumber;
|
2007-06-02 08:15:06 +00:00
|
|
|
bool _predictiveDialogRunning;
|
2006-12-06 19:27:02 +00:00
|
|
|
public:
|
|
|
|
char _predictiveResult[40];
|
2010-06-21 21:32:56 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
typedef void (AgiEngine::*AgiCommand)(uint8 *);
|
|
|
|
|
|
|
|
AgiCommand _agiCommands[183];
|
2010-06-21 21:33:22 +00:00
|
|
|
AgiLogic *_curLogic;
|
|
|
|
int _timerHack; // Workaround for timer loop in MH1 logic 153
|
2010-06-21 21:32:56 +00:00
|
|
|
|
|
|
|
void setupOpcodes();
|
|
|
|
|
|
|
|
void cmd_increment(uint8 *p);
|
|
|
|
void cmd_decrement(uint8 *p);
|
|
|
|
void cmd_assignn(uint8 *p);
|
|
|
|
void cmd_assignv(uint8 *p);
|
|
|
|
void cmd_addn(uint8 *p);
|
|
|
|
void cmd_addv(uint8 *p);
|
|
|
|
void cmd_subn(uint8 *p);
|
|
|
|
void cmd_subv(uint8 *p); // 0x08
|
|
|
|
void cmd_lindirectv(uint8 *p);
|
|
|
|
void cmd_rindirect(uint8 *p);
|
|
|
|
void cmd_lindirectn(uint8 *p);
|
|
|
|
void cmd_set(uint8 *p);
|
|
|
|
void cmd_reset(uint8 *p);
|
|
|
|
void cmd_toggle(uint8 *p);
|
|
|
|
void cmd_set_v(uint8 *p);
|
|
|
|
void cmd_reset_v(uint8 *p); // 0x10
|
|
|
|
void cmd_toggle_v(uint8 *p);
|
|
|
|
void cmd_new_room(uint8 *p);
|
|
|
|
void cmd_new_room_f(uint8 *p);
|
|
|
|
void cmd_load_logic(uint8 *p);
|
|
|
|
void cmd_load_logic_f(uint8 *p);
|
|
|
|
void cmd_call(uint8 *p);
|
|
|
|
void cmd_call_f(uint8 *p);
|
|
|
|
void cmd_load_pic(uint8 *p); // 0x18
|
|
|
|
void cmd_draw_pic(uint8 *p);
|
|
|
|
void cmd_show_pic(uint8 *p);
|
|
|
|
void cmd_discard_pic(uint8 *p);
|
|
|
|
void cmd_overlay_pic(uint8 *p);
|
|
|
|
void cmd_show_pri_screen(uint8 *p);
|
|
|
|
void cmd_load_view(uint8 *p);
|
|
|
|
void cmd_load_view_f(uint8 *p);
|
|
|
|
void cmd_discard_view(uint8 *p); // 0x20
|
|
|
|
void cmd_animate_obj(uint8 *p);
|
|
|
|
void cmd_unanimate_all(uint8 *p);
|
|
|
|
void cmd_draw(uint8 *p);
|
|
|
|
void cmd_erase(uint8 *p);
|
|
|
|
void cmd_position(uint8 *p);
|
|
|
|
void cmd_position_f(uint8 *p);
|
|
|
|
void cmd_get_posn(uint8 *p);
|
|
|
|
void cmd_reposition(uint8 *p); // 0x28
|
|
|
|
void cmd_set_view(uint8 *p);
|
|
|
|
void cmd_set_view_f(uint8 *p);
|
|
|
|
void cmd_set_loop(uint8 *p);
|
|
|
|
void cmd_set_loop_f(uint8 *p);
|
|
|
|
void cmd_fix_loop(uint8 *p);
|
|
|
|
void cmd_release_loop(uint8 *p);
|
|
|
|
void cmd_set_cel(uint8 *p);
|
|
|
|
void cmd_set_cel_f(uint8 *p); // 0x30
|
|
|
|
void cmd_last_cel(uint8 *p);
|
|
|
|
void cmd_current_cel(uint8 *p);
|
|
|
|
void cmd_current_loop(uint8 *p);
|
|
|
|
void cmd_current_view(uint8 *p);
|
|
|
|
void cmd_number_of_loops(uint8 *p);
|
|
|
|
void cmd_set_priority(uint8 *p);
|
|
|
|
void cmd_set_priority_f(uint8 *p);
|
|
|
|
void cmd_release_priority(uint8 *p); // 0x38
|
|
|
|
void cmd_get_priority(uint8 *p);
|
|
|
|
void cmd_stop_update(uint8 *p);
|
|
|
|
void cmd_start_update(uint8 *p);
|
|
|
|
void cmd_force_update(uint8 *p);
|
|
|
|
void cmd_ignore_horizon(uint8 *p);
|
|
|
|
void cmd_observe_horizon(uint8 *p);
|
|
|
|
void cmd_set_horizon(uint8 *p);
|
|
|
|
void cmd_object_on_water(uint8 *p); // 0x40
|
|
|
|
void cmd_object_on_land(uint8 *p);
|
|
|
|
void cmd_object_on_anything(uint8 *p);
|
|
|
|
void cmd_ignore_objs(uint8 *p);
|
|
|
|
void cmd_observe_objs(uint8 *p);
|
|
|
|
void cmd_distance(uint8 *p);
|
|
|
|
void cmd_stop_cycling(uint8 *p);
|
|
|
|
void cmd_start_cycling(uint8 *p);
|
|
|
|
void cmd_normal_cycle(uint8 *p); // 0x48
|
|
|
|
void cmd_end_of_loop(uint8 *p);
|
|
|
|
void cmd_reverse_cycle(uint8 *p);
|
|
|
|
void cmd_reverse_loop(uint8 *p);
|
|
|
|
void cmd_cycle_time(uint8 *p);
|
|
|
|
void cmd_stop_motion(uint8 *p);
|
|
|
|
void cmd_start_motion(uint8 *p);
|
|
|
|
void cmd_step_size(uint8 *p);
|
|
|
|
void cmd_step_time(uint8 *p); // 0x50
|
|
|
|
void cmd_move_obj(uint8 *p);
|
|
|
|
void cmd_move_obj_f(uint8 *p);
|
|
|
|
void cmd_follow_ego(uint8 *p);
|
|
|
|
void cmd_wander(uint8 *p);
|
|
|
|
void cmd_normal_motion(uint8 *p);
|
|
|
|
void cmd_set_dir(uint8 *p);
|
|
|
|
void cmd_get_dir(uint8 *p);
|
|
|
|
void cmd_ignore_blocks(uint8 *p); // 0x58
|
|
|
|
void cmd_observe_blocks(uint8 *p);
|
|
|
|
void cmd_block(uint8 *p);
|
|
|
|
void cmd_unblock(uint8 *p);
|
|
|
|
void cmd_get(uint8 *p);
|
|
|
|
void cmd_get_f(uint8 *p);
|
|
|
|
void cmd_drop(uint8 *p);
|
|
|
|
void cmd_put(uint8 *p);
|
|
|
|
void cmd_put_f(uint8 *p); // 0x60
|
|
|
|
void cmd_get_room_f(uint8 *p);
|
|
|
|
void cmd_load_sound(uint8 *p);
|
|
|
|
void cmd_sound(uint8 *p);
|
|
|
|
void cmd_stop_sound(uint8 *p);
|
|
|
|
void cmd_print(uint8 *p);
|
|
|
|
void cmd_print_f(uint8 *p);
|
|
|
|
void cmd_display(uint8 *p);
|
|
|
|
void cmd_display_f(uint8 *p); // 0x68
|
|
|
|
void cmd_clear_lines(uint8 *p);
|
|
|
|
void cmd_text_screen(uint8 *p);
|
|
|
|
void cmd_graphics(uint8 *p);
|
|
|
|
void cmd_set_cursor_char(uint8 *p);
|
|
|
|
void cmd_set_text_attribute(uint8 *p);
|
|
|
|
void cmd_shake_screen(uint8 *p);
|
|
|
|
void cmd_configure_screen(uint8 *p);
|
|
|
|
void cmd_status_line_on(uint8 *p); // 0x70
|
|
|
|
void cmd_status_line_off(uint8 *p);
|
|
|
|
void cmd_set_string(uint8 *p);
|
|
|
|
void cmd_get_string(uint8 *p);
|
|
|
|
void cmd_word_to_string(uint8 *p);
|
|
|
|
void cmd_parse(uint8 *p);
|
|
|
|
void cmd_get_num(uint8 *p);
|
|
|
|
void cmd_prevent_input(uint8 *p);
|
|
|
|
void cmd_accept_input(uint8 *p); // 0x78
|
|
|
|
void cmd_set_key(uint8 *p);
|
|
|
|
void cmd_add_to_pic(uint8 *p);
|
|
|
|
void cmd_add_to_pic_f(uint8 *p);
|
|
|
|
void cmd_status(uint8 *p);
|
|
|
|
void cmd_save_game(uint8 *p);
|
|
|
|
void cmd_load_game(uint8 *p);
|
|
|
|
void cmd_init_disk(uint8 *p);
|
|
|
|
void cmd_restart_game(uint8 *p); // 0x80
|
|
|
|
void cmd_show_obj(uint8 *p);
|
|
|
|
void cmd_random(uint8 *p);
|
|
|
|
void cmd_program_control(uint8 *p);
|
|
|
|
void cmd_player_control(uint8 *p);
|
|
|
|
void cmd_obj_status_f(uint8 *p);
|
|
|
|
void cmd_quit(uint8 *p);
|
|
|
|
void cmd_show_mem(uint8 *p);
|
|
|
|
void cmd_pause(uint8 *p); // 0x88
|
|
|
|
void cmd_echo_line(uint8 *p);
|
|
|
|
void cmd_cancel_line(uint8 *p);
|
|
|
|
void cmd_init_joy(uint8 *p);
|
|
|
|
void cmd_toggle_monitor(uint8 *p);
|
|
|
|
void cmd_version(uint8 *p);
|
|
|
|
void cmd_script_size(uint8 *p);
|
|
|
|
void cmd_set_game_id(uint8 *p);
|
|
|
|
void cmd_log(uint8 *p); // 0x90
|
|
|
|
void cmd_set_scan_start(uint8 *p);
|
|
|
|
void cmd_reset_scan_start(uint8 *p);
|
|
|
|
void cmd_reposition_to(uint8 *p);
|
|
|
|
void cmd_reposition_to_f(uint8 *p);
|
|
|
|
void cmd_trace_on(uint8 *p);
|
|
|
|
void cmd_trace_info(uint8 *p);
|
|
|
|
void cmd_print_at(uint8 *p);
|
|
|
|
void cmd_print_at_v(uint8 *p); // 0x98
|
|
|
|
//void cmd_discard_view(uint8 *p); // Opcode repeated from 0x20 ?
|
|
|
|
void cmd_clear_text_rect(uint8 *p);
|
|
|
|
void cmd_set_upper_left(uint8 *p);
|
|
|
|
void cmd_set_menu(uint8 *p);
|
|
|
|
void cmd_set_menu_item(uint8 *p);
|
|
|
|
void cmd_submit_menu(uint8 *p);
|
|
|
|
void cmd_enable_item(uint8 *p);
|
|
|
|
void cmd_disable_item(uint8 *p); // 0xa0
|
|
|
|
void cmd_menu_input(uint8 *p);
|
|
|
|
void cmd_show_obj_v(uint8 *p);
|
|
|
|
void cmd_open_dialogue(uint8 *p);
|
|
|
|
void cmd_close_dialogue(uint8 *p);
|
|
|
|
void cmd_mul_n(uint8 *p);
|
|
|
|
void cmd_mul_v(uint8 *p);
|
|
|
|
void cmd_div_n(uint8 *p);
|
|
|
|
void cmd_div_v(uint8 *p); // 0xa8
|
|
|
|
void cmd_close_window(uint8 *p);
|
|
|
|
void cmd_set_simple(uint8 *p);
|
|
|
|
void cmd_push_script(uint8 *p);
|
|
|
|
void cmd_pop_script(uint8 *p);
|
|
|
|
void cmd_hold_key(uint8 *p);
|
|
|
|
void cmd_set_pri_base(uint8 *p);
|
|
|
|
void cmd_discard_sound(uint8 *p);
|
|
|
|
void cmd_hide_mouse(uint8 *p); // 0xb0
|
|
|
|
void cmd_allow_menu(uint8 *p);
|
|
|
|
void cmd_show_mouse(uint8 *p);
|
|
|
|
void cmd_fence_mouse(uint8 *p);
|
|
|
|
void cmd_mouse_posn(uint8 *p);
|
|
|
|
void cmd_release_key(uint8 *p);
|
|
|
|
void cmd_adj_ego_move_to_x_y(uint8 *p);
|
2006-12-06 19:27:02 +00:00
|
|
|
};
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2006-05-25 19:56:05 +00:00
|
|
|
} // End of namespace Agi
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2007-02-20 17:22:58 +00:00
|
|
|
#endif /* AGI_H */
|