2002-12-22 21:58:16 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
|
|
|
* Copyright (C) 2001 Ludvig Strigeus
|
2004-01-06 12:45:34 +00:00
|
|
|
* Copyright (C) 2001-2004 The ScummVM project
|
2002-12-22 21:58:16 +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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INTERN_H
|
|
|
|
#define INTERN_H
|
|
|
|
|
2003-10-03 18:33:57 +00:00
|
|
|
#include "scumm/scumm.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace Scumm {
|
|
|
|
|
2002-12-25 14:31:17 +00:00
|
|
|
class NutRenderer; // V8 Font Renderer
|
2004-01-19 20:27:31 +00:00
|
|
|
struct ArrayHeader;
|
2002-12-22 21:58:16 +00:00
|
|
|
|
2003-10-02 22:42:03 +00:00
|
|
|
class ScummEngine_v5 : public ScummEngine {
|
2002-12-22 21:58:16 +00:00
|
|
|
protected:
|
2003-10-02 22:42:03 +00:00
|
|
|
typedef void (ScummEngine_v5::*OpcodeProcV5)();
|
2002-12-22 21:58:16 +00:00
|
|
|
struct OpcodeEntryV5 {
|
|
|
|
OpcodeProcV5 proc;
|
|
|
|
const char *desc;
|
|
|
|
};
|
|
|
|
|
|
|
|
const OpcodeEntryV5 *_opcodesV5;
|
2003-03-06 17:58:13 +00:00
|
|
|
|
2002-12-22 21:58:16 +00:00
|
|
|
public:
|
2003-10-28 17:07:25 +00:00
|
|
|
ScummEngine_v5(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine(detector, syst, gs) {}
|
2002-12-22 21:58:16 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void setupOpcodes();
|
2003-05-14 20:37:53 +00:00
|
|
|
virtual void executeOpcode(byte i);
|
|
|
|
virtual const char *getOpcodeDesc(byte i);
|
2002-12-22 21:58:16 +00:00
|
|
|
|
2004-01-09 13:14:59 +00:00
|
|
|
virtual void setupScummVars();
|
2003-05-04 01:10:45 +00:00
|
|
|
virtual void decodeParseString();
|
2004-01-19 19:47:47 +00:00
|
|
|
|
2002-12-25 14:46:39 +00:00
|
|
|
int getWordVararg(int *ptr);
|
2003-08-31 14:58:56 +00:00
|
|
|
void saveVars();
|
|
|
|
void loadVars();
|
2002-12-22 21:58:16 +00:00
|
|
|
|
2003-05-05 09:19:15 +00:00
|
|
|
virtual int getVar();
|
|
|
|
virtual int getVarOrDirectByte(byte mask);
|
|
|
|
virtual int getVarOrDirectWord(byte mask);
|
|
|
|
|
2002-12-22 21:58:16 +00:00
|
|
|
/* Version 5 script opcodes */
|
|
|
|
void o5_actorFollowCamera();
|
|
|
|
void o5_actorFromPos();
|
2003-11-10 00:05:17 +00:00
|
|
|
void o5_actorOps();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o5_add();
|
|
|
|
void o5_and();
|
|
|
|
void o5_animateActor();
|
|
|
|
void o5_breakHere();
|
|
|
|
void o5_chainScript();
|
|
|
|
void o5_cursorCommand();
|
|
|
|
void o5_cutscene();
|
|
|
|
void o5_debug();
|
|
|
|
void o5_decrement();
|
|
|
|
void o5_delay();
|
|
|
|
void o5_delayVariable();
|
|
|
|
void o5_divide();
|
|
|
|
void o5_doSentence();
|
|
|
|
void o5_drawBox();
|
|
|
|
void o5_drawObject();
|
|
|
|
void o5_endCutscene();
|
|
|
|
void o5_equalZero();
|
|
|
|
void o5_expression();
|
|
|
|
void o5_faceActor();
|
|
|
|
void o5_findInventory();
|
|
|
|
void o5_findObject();
|
|
|
|
void o5_freezeScripts();
|
|
|
|
void o5_getActorCostume();
|
|
|
|
void o5_getActorElevation();
|
|
|
|
void o5_getActorFacing();
|
|
|
|
void o5_getActorMoving();
|
|
|
|
void o5_getActorRoom();
|
|
|
|
void o5_getActorScale();
|
|
|
|
void o5_getActorWalkBox();
|
|
|
|
void o5_getActorWidth();
|
|
|
|
void o5_getActorX();
|
|
|
|
void o5_getActorY();
|
|
|
|
void o5_getAnimCounter();
|
|
|
|
void o5_getClosestObjActor();
|
|
|
|
void o5_getDist();
|
|
|
|
void o5_getInventoryCount();
|
|
|
|
void o5_getObjectOwner();
|
|
|
|
void o5_getObjectState();
|
|
|
|
void o5_getRandomNr();
|
2003-04-28 14:46:55 +00:00
|
|
|
void o5_getStringWidth();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o5_getVerbEntrypoint();
|
|
|
|
void o5_ifClassOfIs();
|
2003-04-28 14:46:55 +00:00
|
|
|
void o5_ifNotState();
|
|
|
|
void o5_ifState();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o5_increment();
|
|
|
|
void o5_isActorInBox();
|
|
|
|
void o5_isEqual();
|
|
|
|
void o5_isGreater();
|
|
|
|
void o5_isGreaterEqual();
|
|
|
|
void o5_isLess();
|
|
|
|
void o5_isNotEqual();
|
2003-04-28 14:46:55 +00:00
|
|
|
void o5_isScriptRunning();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o5_isSoundRunning();
|
|
|
|
void o5_jumpRelative();
|
|
|
|
void o5_lessOrEqual();
|
|
|
|
void o5_lights();
|
|
|
|
void o5_loadRoom();
|
|
|
|
void o5_loadRoomWithEgo();
|
|
|
|
void o5_matrixOps();
|
|
|
|
void o5_move();
|
|
|
|
void o5_multiply();
|
|
|
|
void o5_notEqualZero();
|
2003-04-28 14:46:55 +00:00
|
|
|
void o5_oldRoomEffect();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o5_or();
|
2003-05-21 14:00:19 +00:00
|
|
|
void o5_beginOverride();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o5_panCameraTo();
|
|
|
|
void o5_pickupObject();
|
2003-04-28 14:46:55 +00:00
|
|
|
void o5_pickupObjectOld();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o5_print();
|
|
|
|
void o5_printEgo();
|
|
|
|
void o5_pseudoRoom();
|
|
|
|
void o5_putActor();
|
|
|
|
void o5_putActorAtObject();
|
|
|
|
void o5_putActorInRoom();
|
|
|
|
void o5_quitPauseRestart();
|
|
|
|
void o5_resourceRoutines();
|
|
|
|
void o5_roomOps();
|
2003-08-31 15:39:27 +00:00
|
|
|
void o5_saveLoadGame();
|
2003-04-28 14:46:55 +00:00
|
|
|
void o5_saveLoadVars();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o5_saveRestoreVerbs();
|
|
|
|
void o5_setCameraAt();
|
|
|
|
void o5_setClass();
|
|
|
|
void o5_setObjectName();
|
|
|
|
void o5_setOwnerOf();
|
|
|
|
void o5_setState();
|
|
|
|
void o5_setVarRange();
|
|
|
|
void o5_soundKludge();
|
|
|
|
void o5_startMusic();
|
|
|
|
void o5_startObject();
|
|
|
|
void o5_startScript();
|
|
|
|
void o5_startSound();
|
|
|
|
void o5_stopMusic();
|
|
|
|
void o5_stopObjectCode();
|
|
|
|
void o5_stopObjectScript();
|
|
|
|
void o5_stopScript();
|
|
|
|
void o5_stopSound();
|
|
|
|
void o5_stringOps();
|
|
|
|
void o5_subtract();
|
|
|
|
void o5_verbOps();
|
|
|
|
void o5_wait();
|
|
|
|
void o5_walkActorTo();
|
|
|
|
void o5_walkActorToActor();
|
|
|
|
void o5_walkActorToObject();
|
|
|
|
};
|
|
|
|
|
|
|
|
// FIXME - maybe we should move the opcodes from v5 to v3, and change the inheritance
|
|
|
|
// accordingly - that would be more logical I guess. However, if you do so, take care
|
|
|
|
// of preserving the right readIndexFile / loadCharset !!!
|
2003-10-02 22:42:03 +00:00
|
|
|
class ScummEngine_v3 : public ScummEngine_v5 {
|
2002-12-22 21:58:16 +00:00
|
|
|
public:
|
2003-10-28 17:07:25 +00:00
|
|
|
ScummEngine_v3(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine_v5(detector, syst, gs) {}
|
2002-12-22 21:58:16 +00:00
|
|
|
|
2003-03-07 21:38:46 +00:00
|
|
|
protected:
|
2002-12-22 21:58:16 +00:00
|
|
|
void readIndexFile();
|
2003-03-07 21:38:46 +00:00
|
|
|
void loadCharset(int no);
|
|
|
|
void readMAXS();
|
2003-04-11 20:05:37 +00:00
|
|
|
|
|
|
|
void readGlobalObjects();
|
2002-12-22 21:58:16 +00:00
|
|
|
};
|
|
|
|
|
2003-10-02 22:42:03 +00:00
|
|
|
class ScummEngine_v2 : public ScummEngine_v3 {
|
2003-04-20 16:04:50 +00:00
|
|
|
protected:
|
|
|
|
void readIndexFile();
|
2003-05-29 08:05:20 +00:00
|
|
|
void readClassicIndexFile(); // V1
|
|
|
|
void readEnhancedIndexFile(); // V2
|
2003-04-20 16:37:43 +00:00
|
|
|
void loadCharset(int no);
|
2003-04-20 16:04:50 +00:00
|
|
|
void readMAXS();
|
2003-04-20 16:37:43 +00:00
|
|
|
|
2003-10-02 22:42:03 +00:00
|
|
|
typedef void (ScummEngine_v2::*OpcodeProcV2)();
|
2003-04-20 16:04:50 +00:00
|
|
|
struct OpcodeEntryV2 {
|
|
|
|
OpcodeProcV2 proc;
|
|
|
|
const char *desc;
|
|
|
|
};
|
|
|
|
|
|
|
|
const OpcodeEntryV2 *_opcodesV2;
|
|
|
|
|
2003-05-04 01:10:45 +00:00
|
|
|
public:
|
2003-10-28 17:07:25 +00:00
|
|
|
ScummEngine_v2(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine_v3(detector, syst, gs) {}
|
2003-04-21 11:54:27 +00:00
|
|
|
|
2003-05-04 01:10:45 +00:00
|
|
|
protected:
|
2003-04-20 16:04:50 +00:00
|
|
|
virtual void setupOpcodes();
|
2003-05-14 20:37:53 +00:00
|
|
|
virtual void executeOpcode(byte i);
|
|
|
|
virtual const char *getOpcodeDesc(byte i);
|
2003-05-04 01:10:45 +00:00
|
|
|
|
|
|
|
virtual void setupScummVars();
|
|
|
|
virtual void decodeParseString();
|
|
|
|
|
2003-05-05 09:19:15 +00:00
|
|
|
virtual int getVar();
|
|
|
|
|
2003-05-04 02:27:22 +00:00
|
|
|
void getResultPosIndirect();
|
|
|
|
virtual void getResultPos();
|
2003-05-04 02:10:49 +00:00
|
|
|
virtual int readVar(uint var);
|
2003-05-21 14:25:14 +00:00
|
|
|
virtual void writeVar(uint var, int value);
|
2003-05-04 02:10:49 +00:00
|
|
|
|
2003-04-21 08:50:16 +00:00
|
|
|
virtual void ifStateCommon(byte type);
|
|
|
|
virtual void ifNotStateCommon(byte type);
|
|
|
|
virtual void setStateCommon(byte type);
|
|
|
|
virtual void clearStateCommon(byte type);
|
2003-05-18 12:52:27 +00:00
|
|
|
|
|
|
|
void resetSentence();
|
2003-07-12 22:00:59 +00:00
|
|
|
void setUserState(byte state);
|
2003-04-20 16:04:50 +00:00
|
|
|
|
|
|
|
/* Version 2 script opcodes */
|
2003-05-11 00:03:03 +00:00
|
|
|
void o2_actorFromPos();
|
2003-11-10 08:46:40 +00:00
|
|
|
void o2_actorOps();
|
2003-05-22 22:42:44 +00:00
|
|
|
void o2_add();
|
2003-05-11 00:03:03 +00:00
|
|
|
void o2_addIndirect();
|
|
|
|
void o2_animateActor();
|
2003-04-20 16:04:50 +00:00
|
|
|
void o2_assignVarByte();
|
2003-05-11 00:03:03 +00:00
|
|
|
void o2_assignVarWordIndirect();
|
2003-05-21 14:00:19 +00:00
|
|
|
void o2_beginOverride();
|
2003-05-11 00:03:03 +00:00
|
|
|
void o2_chainScript();
|
|
|
|
void o2_clearState01();
|
|
|
|
void o2_clearState02();
|
|
|
|
void o2_clearState04();
|
|
|
|
void o2_clearState08();
|
|
|
|
void o2_cursorCommand();
|
|
|
|
void o2_cutscene();
|
|
|
|
void o2_delay();
|
|
|
|
void o2_doSentence();
|
|
|
|
void o2_drawObject();
|
|
|
|
void o2_drawSentence();
|
|
|
|
void o2_dummy();
|
|
|
|
void o2_endCutscene();
|
|
|
|
void o2_findObject();
|
|
|
|
void o2_getActorWalkBox();
|
|
|
|
void o2_getActorX();
|
|
|
|
void o2_getActorY();
|
2003-04-20 16:04:50 +00:00
|
|
|
void o2_getBitVar();
|
2003-05-22 14:10:20 +00:00
|
|
|
void o2_getObjPreposition();
|
2003-05-11 00:03:03 +00:00
|
|
|
void o2_ifClassOfIs();
|
|
|
|
void o2_ifNotState01();
|
2003-04-21 08:50:16 +00:00
|
|
|
void o2_ifNotState02();
|
2003-05-11 00:03:03 +00:00
|
|
|
void o2_ifNotState04();
|
|
|
|
void o2_ifNotState08();
|
2003-04-21 08:50:16 +00:00
|
|
|
void o2_ifState01();
|
2003-05-11 00:03:03 +00:00
|
|
|
void o2_ifState02();
|
|
|
|
void o2_ifState04();
|
|
|
|
void o2_ifState08();
|
2003-07-14 19:57:44 +00:00
|
|
|
void o2_isGreater();
|
|
|
|
void o2_isGreaterEqual();
|
|
|
|
void o2_isLess();
|
|
|
|
void o2_isLessEqual();
|
2003-08-18 10:46:42 +00:00
|
|
|
void o2_lights();
|
2003-05-11 00:03:03 +00:00
|
|
|
void o2_loadRoomWithEgo();
|
2003-05-20 16:13:34 +00:00
|
|
|
void o2_setBoxFlags();
|
2003-04-26 16:37:35 +00:00
|
|
|
void o2_panCameraTo();
|
2003-05-11 00:03:03 +00:00
|
|
|
void o2_pickupObject();
|
|
|
|
void o2_putActor();
|
2003-04-26 16:37:35 +00:00
|
|
|
void o2_putActorAtObject();
|
2003-05-11 00:03:03 +00:00
|
|
|
void o2_resourceRoutines();
|
|
|
|
void o2_restart();
|
|
|
|
void o2_roomOps();
|
2003-07-01 04:20:41 +00:00
|
|
|
void o2_getActorElevation();
|
2003-05-11 00:03:03 +00:00
|
|
|
void o2_setActorElevation();
|
|
|
|
void o2_setBitVar();
|
2003-04-26 16:37:35 +00:00
|
|
|
void o2_setCameraAt();
|
2003-05-22 14:10:20 +00:00
|
|
|
void o2_setObjPreposition();
|
2003-05-11 00:03:03 +00:00
|
|
|
void o2_setOwnerOf();
|
|
|
|
void o2_setState01();
|
|
|
|
void o2_setState02();
|
|
|
|
void o2_setState04();
|
|
|
|
void o2_setState08();
|
|
|
|
void o2_startScript();
|
2004-02-22 16:08:13 +00:00
|
|
|
void o2_stopScript();
|
2003-05-22 22:42:44 +00:00
|
|
|
void o2_subtract();
|
2003-05-11 00:03:03 +00:00
|
|
|
void o2_subIndirect();
|
2003-08-14 11:40:50 +00:00
|
|
|
void o2_switchCostumeSet();
|
2003-05-11 00:03:03 +00:00
|
|
|
void o2_verbOps();
|
|
|
|
void o2_waitForActor();
|
|
|
|
void o2_waitForMessage();
|
|
|
|
void o2_waitForSentence();
|
|
|
|
void o2_walkActorTo();
|
|
|
|
void o2_walkActorToObject();
|
2003-05-16 22:11:49 +00:00
|
|
|
|
|
|
|
byte VAR_SENTENCE_VERB;
|
|
|
|
byte VAR_SENTENCE_OBJECT1;
|
|
|
|
byte VAR_SENTENCE_OBJECT2;
|
2003-05-22 14:10:20 +00:00
|
|
|
byte VAR_SENTENCE_PREPOSITION;
|
2003-05-18 12:52:27 +00:00
|
|
|
byte VAR_BACKUP_VERB;
|
2003-04-20 16:04:50 +00:00
|
|
|
};
|
|
|
|
|
2003-10-02 22:42:03 +00:00
|
|
|
class ScummEngine_v4 : public ScummEngine_v3 {
|
2002-12-22 21:58:16 +00:00
|
|
|
public:
|
2003-10-28 17:07:25 +00:00
|
|
|
ScummEngine_v4(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine_v3(detector, syst, gs) {}
|
2002-12-22 21:58:16 +00:00
|
|
|
|
2003-03-07 21:38:46 +00:00
|
|
|
protected:
|
2002-12-22 21:58:16 +00:00
|
|
|
void loadCharset(int no);
|
|
|
|
};
|
|
|
|
|
2003-10-02 22:42:03 +00:00
|
|
|
class ScummEngine_v6 : public ScummEngine {
|
2004-01-19 19:34:48 +00:00
|
|
|
friend class Insane;
|
|
|
|
|
2002-12-22 21:58:16 +00:00
|
|
|
protected:
|
2003-10-02 22:42:03 +00:00
|
|
|
typedef void (ScummEngine_v6::*OpcodeProcV6)();
|
2002-12-22 21:58:16 +00:00
|
|
|
struct OpcodeEntryV6 {
|
|
|
|
OpcodeProcV6 proc;
|
|
|
|
const char *desc;
|
|
|
|
};
|
|
|
|
|
|
|
|
const OpcodeEntryV6 *_opcodesV6;
|
2003-09-13 21:04:47 +00:00
|
|
|
|
2002-12-22 21:58:16 +00:00
|
|
|
public:
|
2003-11-08 21:59:32 +00:00
|
|
|
ScummEngine_v6(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine(detector, syst, gs) {
|
2003-05-08 15:48:50 +00:00
|
|
|
VAR_VIDEONAME = 0xFF;
|
2004-01-19 19:47:47 +00:00
|
|
|
VAR_RANDOM_NR = 0xFF;
|
|
|
|
VAR_STRING2DRAW = 0xFF;
|
2003-05-08 15:48:50 +00:00
|
|
|
|
|
|
|
VAR_TIMEDATE_YEAR = 0xFF;
|
|
|
|
VAR_TIMEDATE_MONTH = 0xFF;
|
|
|
|
VAR_TIMEDATE_DAY = 0xFF;
|
|
|
|
VAR_TIMEDATE_HOUR = 0xFF;
|
|
|
|
VAR_TIMEDATE_MINUTE = 0xFF;
|
|
|
|
VAR_TIMEDATE_SECOND = 0xFF;
|
|
|
|
}
|
2002-12-22 21:58:16 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void setupOpcodes();
|
2003-05-14 20:37:53 +00:00
|
|
|
virtual void executeOpcode(byte i);
|
|
|
|
virtual const char *getOpcodeDesc(byte i);
|
2002-12-22 21:58:16 +00:00
|
|
|
|
2003-02-18 01:51:05 +00:00
|
|
|
virtual void setupScummVars();
|
2004-01-19 19:47:47 +00:00
|
|
|
virtual void decodeParseString(int a, int b);
|
2004-01-19 20:27:31 +00:00
|
|
|
virtual void readArrayFromIndexFile();
|
2003-02-18 01:51:05 +00:00
|
|
|
|
2003-12-17 17:12:09 +00:00
|
|
|
virtual void palManipulateInit(int resID, int start, int end, int time);
|
|
|
|
|
2002-12-25 14:46:39 +00:00
|
|
|
int getStackList(int *args, uint maxnum);
|
2003-05-04 01:10:45 +00:00
|
|
|
int popRoomAndObj(int *room);
|
2004-01-19 20:27:31 +00:00
|
|
|
|
|
|
|
ArrayHeader *getArray(int array);
|
|
|
|
ArrayHeader *defineArray(int array, int type, int dim2, int dim1);
|
|
|
|
int findFreeArrayId();
|
|
|
|
void nukeArray(int array);
|
|
|
|
int readArray(int array, int index, int base);
|
|
|
|
void writeArray(int array, int index, int base, int value);
|
|
|
|
|
2003-05-04 01:10:45 +00:00
|
|
|
void shuffleArray(int num, int minIdx, int maxIdx);
|
2002-12-22 21:58:16 +00:00
|
|
|
|
|
|
|
/* Version 6 script opcodes */
|
|
|
|
void o6_setBlastObjectWindow();
|
|
|
|
void o6_pushByte();
|
|
|
|
void o6_pushWord();
|
|
|
|
void o6_pushByteVar();
|
|
|
|
void o6_pushWordVar();
|
|
|
|
void o6_invalid();
|
|
|
|
void o6_byteArrayRead();
|
|
|
|
void o6_wordArrayRead();
|
|
|
|
void o6_byteArrayIndexedRead();
|
|
|
|
void o6_wordArrayIndexedRead();
|
|
|
|
void o6_dup();
|
2002-12-23 12:50:38 +00:00
|
|
|
void o6_pop();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o6_not();
|
|
|
|
void o6_eq();
|
|
|
|
void o6_neq();
|
|
|
|
void o6_gt();
|
|
|
|
void o6_lt();
|
|
|
|
void o6_le();
|
|
|
|
void o6_ge();
|
|
|
|
void o6_add();
|
|
|
|
void o6_sub();
|
|
|
|
void o6_mul();
|
|
|
|
void o6_div();
|
|
|
|
void o6_land();
|
|
|
|
void o6_lor();
|
|
|
|
void o6_writeByteVar();
|
|
|
|
void o6_writeWordVar();
|
|
|
|
void o6_byteArrayWrite();
|
|
|
|
void o6_wordArrayWrite();
|
|
|
|
void o6_byteArrayIndexedWrite();
|
|
|
|
void o6_wordArrayIndexedWrite();
|
|
|
|
void o6_byteVarInc();
|
|
|
|
void o6_wordVarInc();
|
|
|
|
void o6_byteArrayInc();
|
|
|
|
void o6_wordArrayInc();
|
|
|
|
void o6_byteVarDec();
|
|
|
|
void o6_wordVarDec();
|
|
|
|
void o6_byteArrayDec();
|
|
|
|
void o6_wordArrayDec();
|
2003-11-09 22:12:16 +00:00
|
|
|
void o6_if();
|
|
|
|
void o6_ifNot();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o6_jump();
|
|
|
|
void o6_startScript();
|
2003-11-09 22:12:16 +00:00
|
|
|
void o6_startScriptQuick();
|
|
|
|
void o6_startObject();
|
|
|
|
void o6_drawObject();
|
|
|
|
void o6_drawObjectAt();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o6_stopObjectCode();
|
|
|
|
void o6_endCutscene();
|
2002-12-22 23:26:10 +00:00
|
|
|
void o6_cutscene();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o6_stopMusic();
|
|
|
|
void o6_freezeUnfreeze();
|
|
|
|
void o6_cursorCommand();
|
|
|
|
void o6_breakHere();
|
2003-11-10 08:00:55 +00:00
|
|
|
void o6_ifClassOfIs();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o6_setClass();
|
|
|
|
void o6_getState();
|
|
|
|
void o6_setState();
|
|
|
|
void o6_setOwner();
|
|
|
|
void o6_getOwner();
|
|
|
|
void o6_startSound();
|
|
|
|
void o6_stopSound();
|
|
|
|
void o6_startMusic();
|
|
|
|
void o6_stopObjectScript();
|
|
|
|
void o6_panCameraTo();
|
|
|
|
void o6_actorFollowCamera();
|
|
|
|
void o6_setCameraAt();
|
|
|
|
void o6_loadRoom();
|
|
|
|
void o6_stopScript();
|
|
|
|
void o6_walkActorToObj();
|
|
|
|
void o6_walkActorTo();
|
2003-11-09 22:12:16 +00:00
|
|
|
void o6_putActorAtXY();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o6_putActorAtObject();
|
|
|
|
void o6_faceActor();
|
|
|
|
void o6_animateActor();
|
|
|
|
void o6_doSentence();
|
|
|
|
void o6_pickupObject();
|
|
|
|
void o6_loadRoomWithEgo();
|
|
|
|
void o6_getRandomNumber();
|
|
|
|
void o6_getRandomNumberRange();
|
|
|
|
void o6_getActorMoving();
|
|
|
|
void o6_isScriptRunning();
|
|
|
|
void o6_getActorRoom();
|
|
|
|
void o6_getObjectX();
|
|
|
|
void o6_getObjectY();
|
|
|
|
void o6_getObjectOldDir();
|
|
|
|
void o6_getObjectNewDir();
|
|
|
|
void o6_getActorWalkBox();
|
|
|
|
void o6_getActorCostume();
|
|
|
|
void o6_findInventory();
|
|
|
|
void o6_getInventoryCount();
|
|
|
|
void o6_getVerbFromXY();
|
|
|
|
void o6_beginOverride();
|
|
|
|
void o6_endOverride();
|
|
|
|
void o6_setObjectName();
|
|
|
|
void o6_isSoundRunning();
|
|
|
|
void o6_setBoxFlags();
|
|
|
|
void o6_createBoxMatrix();
|
|
|
|
void o6_resourceRoutines();
|
|
|
|
void o6_roomOps();
|
2002-12-23 15:46:53 +00:00
|
|
|
void o6_actorOps();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o6_verbOps();
|
|
|
|
void o6_getActorFromXY();
|
|
|
|
void o6_findObject();
|
|
|
|
void o6_pseudoRoom();
|
|
|
|
void o6_getActorElevation();
|
|
|
|
void o6_getVerbEntrypoint();
|
|
|
|
void o6_arrayOps();
|
|
|
|
void o6_saveRestoreVerbs();
|
|
|
|
void o6_drawBox();
|
|
|
|
void o6_getActorWidth();
|
|
|
|
void o6_wait();
|
|
|
|
void o6_getActorScaleX();
|
|
|
|
void o6_getActorAnimCounter1();
|
|
|
|
void o6_soundKludge();
|
|
|
|
void o6_isAnyOf();
|
|
|
|
void o6_quitPauseRestart();
|
|
|
|
void o6_isActorInBox();
|
|
|
|
void o6_delay();
|
2002-12-26 21:50:13 +00:00
|
|
|
void o6_delaySeconds();
|
|
|
|
void o6_delayMinutes();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o6_stopSentence();
|
2003-01-01 17:57:14 +00:00
|
|
|
void o6_printLine();
|
|
|
|
void o6_printCursor();
|
|
|
|
void o6_printDebug();
|
|
|
|
void o6_printSystem();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o6_printActor();
|
|
|
|
void o6_printEgo();
|
|
|
|
void o6_talkActor();
|
|
|
|
void o6_talkEgo();
|
2003-11-10 08:00:55 +00:00
|
|
|
void o6_dimArray();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o6_dummy();
|
2002-12-23 12:50:38 +00:00
|
|
|
void o6_startObjectQuick();
|
2003-11-09 22:12:16 +00:00
|
|
|
void o6_startScriptQuick2();
|
2003-11-10 08:00:55 +00:00
|
|
|
void o6_dim2dimArray();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o6_abs();
|
|
|
|
void o6_distObjectObject();
|
|
|
|
void o6_distObjectPt();
|
|
|
|
void o6_distPtPt();
|
2003-01-06 01:53:38 +00:00
|
|
|
void o6_kernelSetFunctions();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o6_delayFrames();
|
|
|
|
void o6_pickOneOf();
|
|
|
|
void o6_pickOneOfDefault();
|
|
|
|
void o6_jumpToScript();
|
|
|
|
void o6_isRoomScriptRunning();
|
2003-01-06 01:53:38 +00:00
|
|
|
void o6_kernelGetFunctions();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o6_getAnimateVariable();
|
|
|
|
void o6_drawBlastObject();
|
2002-12-24 00:41:59 +00:00
|
|
|
void o6_getActorLayer();
|
2003-02-16 14:52:25 +00:00
|
|
|
void o6_stampObject();
|
2002-12-22 21:58:16 +00:00
|
|
|
void o6_bor();
|
|
|
|
void o6_band();
|
2003-02-14 08:12:45 +00:00
|
|
|
void o6_stopTalking();
|
2003-02-17 10:14:43 +00:00
|
|
|
void o6_findAllObjects();
|
2003-02-17 21:42:33 +00:00
|
|
|
void o6_pickVarRandom();
|
2003-02-18 00:13:24 +00:00
|
|
|
void o6_getDateTime();
|
2003-03-18 20:32:01 +00:00
|
|
|
void o6_unknownE1();
|
2004-02-16 05:53:17 +00:00
|
|
|
void o6_setBoxSet();
|
2003-02-21 00:42:51 +00:00
|
|
|
void o6_shuffle();
|
2003-02-18 01:51:05 +00:00
|
|
|
|
|
|
|
byte VAR_VIDEONAME;
|
2004-01-19 19:47:47 +00:00
|
|
|
byte VAR_RANDOM_NR;
|
|
|
|
byte VAR_STRING2DRAW;
|
2003-02-18 01:51:05 +00:00
|
|
|
|
|
|
|
byte VAR_TIMEDATE_YEAR;
|
|
|
|
byte VAR_TIMEDATE_MONTH;
|
|
|
|
byte VAR_TIMEDATE_DAY;
|
|
|
|
byte VAR_TIMEDATE_HOUR;
|
|
|
|
byte VAR_TIMEDATE_MINUTE;
|
|
|
|
byte VAR_TIMEDATE_SECOND;
|
2002-12-22 21:58:16 +00:00
|
|
|
};
|
|
|
|
|
2004-02-07 02:23:24 +00:00
|
|
|
class ScummEngine_v6he : public ScummEngine_v6 {
|
|
|
|
protected:
|
|
|
|
typedef void (ScummEngine_v6he::*OpcodeProcV6he)();
|
|
|
|
struct OpcodeEntryV6he {
|
|
|
|
OpcodeProcV6he proc;
|
|
|
|
const char *desc;
|
|
|
|
};
|
2004-06-01 06:38:36 +00:00
|
|
|
struct vsUnpackCtx {
|
2004-06-01 17:56:33 +00:00
|
|
|
uint8 size;
|
|
|
|
uint8 type;
|
2004-06-01 06:38:36 +00:00
|
|
|
uint8 b;
|
|
|
|
uint8 *ptr;
|
|
|
|
};
|
|
|
|
struct vsPackCtx {
|
|
|
|
int size;
|
|
|
|
uint8 buf[256];
|
|
|
|
};
|
|
|
|
|
2004-02-07 02:23:24 +00:00
|
|
|
const OpcodeEntryV6he *_opcodesV6he;
|
|
|
|
|
|
|
|
File _hFileTable[17];
|
|
|
|
|
|
|
|
public:
|
|
|
|
ScummEngine_v6he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine_v6(detector, syst, gs) {}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void setupOpcodes();
|
|
|
|
virtual void executeOpcode(byte i);
|
|
|
|
virtual const char *getOpcodeDesc(byte i);
|
|
|
|
|
2004-02-11 03:36:27 +00:00
|
|
|
void redimArray(int arrayId, int newX, int newY, int d);
|
2004-02-07 02:23:24 +00:00
|
|
|
int readFileToArray(int slot, int32 size);
|
|
|
|
void writeFileFromArray(int slot, int resID);
|
2004-06-01 06:38:36 +00:00
|
|
|
int virtScreenSave(byte *dst, int x1, int y1, int x2, int y2);
|
|
|
|
int virtScreenSavePack(byte *dst, byte *src, int len, int unk);
|
2004-06-01 22:06:05 +00:00
|
|
|
void virtScreenSavePackBuf(vsPackCtx *ctx, uint8 *&dst, int len);
|
|
|
|
void virtScreenSavePackByte(vsPackCtx *ctx, uint8 *&dst, int len, uint8 b);
|
2004-06-01 06:38:36 +00:00
|
|
|
void virtScreenLoad(int resIdx, int x1, int y1, int x2, int y2);
|
|
|
|
uint8 virtScreenLoadUnpack(vsUnpackCtx *ctx, byte *data);
|
2004-02-24 00:43:01 +00:00
|
|
|
void seekFilePos(int slot, int offset, int mode);
|
2004-03-02 06:19:26 +00:00
|
|
|
virtual void decodeParseString(int a, int b);
|
2004-02-07 02:23:24 +00:00
|
|
|
|
|
|
|
/* Version 6 script opcodes */
|
|
|
|
void o6_drawBlastObject();
|
|
|
|
void o6_setBlastObjectWindow();
|
2004-02-07 02:52:27 +00:00
|
|
|
void o6_setState();
|
|
|
|
void o6_startSound();
|
2004-02-07 02:23:24 +00:00
|
|
|
void o6_roomOps();
|
|
|
|
void o6_actorOps();
|
|
|
|
void o6_verbOps();
|
|
|
|
void o6_wait();
|
|
|
|
void o6_soundKludge();
|
|
|
|
void o6_dummy();
|
|
|
|
void o6_kernelSetFunctions();
|
|
|
|
void o6_kernelGetFunctions();
|
|
|
|
void o6_openFile();
|
|
|
|
void o6_closeFile();
|
|
|
|
void o6_deleteFile();
|
|
|
|
void o6_readFile();
|
|
|
|
void o6_rename();
|
|
|
|
void o6_writeFile();
|
2004-02-09 14:53:13 +00:00
|
|
|
void o6_setVolume();
|
2004-02-24 00:43:01 +00:00
|
|
|
void o6_seekFilePos();
|
2004-06-01 08:37:57 +00:00
|
|
|
void o6_unknownE1();
|
2004-02-07 02:23:24 +00:00
|
|
|
void o6_localizeArray();
|
2004-02-11 03:36:27 +00:00
|
|
|
void o6_redimArray();
|
2004-02-24 00:43:01 +00:00
|
|
|
void o6_readFilePos();
|
2004-02-07 02:23:24 +00:00
|
|
|
};
|
|
|
|
|
2004-03-01 05:57:30 +00:00
|
|
|
class ScummEngine_v7he : public ScummEngine_v6he {
|
|
|
|
protected:
|
|
|
|
typedef void (ScummEngine_v7he::*OpcodeProcV7he)();
|
|
|
|
struct OpcodeEntryV7he {
|
|
|
|
OpcodeProcV7he proc;
|
|
|
|
const char *desc;
|
|
|
|
};
|
|
|
|
|
|
|
|
const OpcodeEntryV7he *_opcodesV7he;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ScummEngine_v7he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine_v6he(detector, syst, gs) {}
|
|
|
|
|
|
|
|
protected:
|
2004-06-05 00:54:48 +00:00
|
|
|
virtual void setupScummVars();
|
2004-03-01 06:25:01 +00:00
|
|
|
|
2004-03-01 05:57:30 +00:00
|
|
|
virtual void setupOpcodes();
|
|
|
|
virtual void executeOpcode(byte i);
|
|
|
|
virtual const char *getOpcodeDesc(byte i);
|
|
|
|
|
2004-06-01 08:37:57 +00:00
|
|
|
byte stringLen(byte *);
|
|
|
|
|
2004-03-01 05:57:30 +00:00
|
|
|
/* Version 7 script opcodes */
|
|
|
|
void o7_objectX();
|
|
|
|
void o7_objectY();
|
2004-06-01 08:37:57 +00:00
|
|
|
void o7_stringLen();
|
|
|
|
void o7_readINI();
|
|
|
|
void o7_unknownF4();
|
|
|
|
void o7_unknownF9();
|
|
|
|
void o7_unknownFA();
|
|
|
|
void o7_unknownFB();
|
2004-06-03 00:55:40 +00:00
|
|
|
void o7_quitPauseRestart();
|
2004-03-01 05:57:30 +00:00
|
|
|
};
|
|
|
|
|
2003-10-02 22:42:03 +00:00
|
|
|
class ScummEngine_v7 : public ScummEngine_v6 {
|
2002-12-22 21:58:16 +00:00
|
|
|
public:
|
2003-10-28 17:07:25 +00:00
|
|
|
ScummEngine_v7(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine_v6(detector, syst, gs) {}
|
2002-12-22 21:58:16 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void setupScummVars();
|
2003-05-29 12:55:28 +00:00
|
|
|
|
|
|
|
virtual void setCameraAt(int pos_x, int pos_y);
|
|
|
|
virtual void setCameraFollows(Actor *a);
|
2003-05-29 23:44:24 +00:00
|
|
|
virtual void moveCamera();
|
|
|
|
virtual void panCameraTo(int x, int y);
|
2002-12-22 21:58:16 +00:00
|
|
|
};
|
|
|
|
|
2003-10-02 22:42:03 +00:00
|
|
|
class ScummEngine_v8 : public ScummEngine_v7 {
|
2002-12-22 21:58:16 +00:00
|
|
|
protected:
|
2003-10-02 22:42:03 +00:00
|
|
|
typedef void (ScummEngine_v8::*OpcodeProcV8)();
|
2002-12-22 21:58:16 +00:00
|
|
|
struct OpcodeEntryV8 {
|
|
|
|
OpcodeProcV8 proc;
|
|
|
|
const char *desc;
|
|
|
|
};
|
|
|
|
|
|
|
|
const OpcodeEntryV8 *_opcodesV8;
|
|
|
|
|
|
|
|
public:
|
2003-10-28 17:07:25 +00:00
|
|
|
ScummEngine_v8(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine_v7(detector, syst, gs) {}
|
2002-12-22 21:58:16 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void setupOpcodes();
|
2003-05-14 20:37:53 +00:00
|
|
|
virtual void executeOpcode(byte i);
|
|
|
|
virtual const char *getOpcodeDesc(byte i);
|
2002-12-22 21:58:16 +00:00
|
|
|
|
2002-12-23 15:46:53 +00:00
|
|
|
virtual void setupScummVars();
|
2003-05-04 01:10:45 +00:00
|
|
|
virtual void decodeParseString(int m, int n);
|
2004-01-19 20:27:31 +00:00
|
|
|
virtual void readArrayFromIndexFile();
|
2003-05-04 01:10:45 +00:00
|
|
|
|
2002-12-23 12:50:38 +00:00
|
|
|
virtual uint fetchScriptWord();
|
|
|
|
virtual int fetchScriptWordSigned();
|
2002-12-23 18:30:12 +00:00
|
|
|
|
|
|
|
virtual int readVar(uint var);
|
|
|
|
virtual void writeVar(uint var, int value);
|
|
|
|
|
2002-12-22 21:58:16 +00:00
|
|
|
/* Version 8 script opcodes */
|
|
|
|
void o8_mod();
|
2002-12-23 12:50:38 +00:00
|
|
|
void o8_wait();
|
2002-12-23 15:46:53 +00:00
|
|
|
|
2003-11-10 08:00:55 +00:00
|
|
|
void o8_dimArray();
|
|
|
|
void o8_dim2dimArray();
|
2002-12-23 17:21:09 +00:00
|
|
|
void o8_arrayOps();
|
2002-12-25 00:04:12 +00:00
|
|
|
void o8_blastText();
|
2002-12-23 15:46:53 +00:00
|
|
|
|
2002-12-23 12:50:38 +00:00
|
|
|
void o8_cursorCommand();
|
2003-01-26 06:17:25 +00:00
|
|
|
void o8_createBoxMatrix();
|
2002-12-23 12:50:38 +00:00
|
|
|
void o8_resourceRoutines();
|
|
|
|
void o8_roomOps();
|
2002-12-23 15:46:53 +00:00
|
|
|
void o8_actorOps();
|
|
|
|
void o8_cameraOps();
|
2002-12-23 12:50:38 +00:00
|
|
|
void o8_verbOps();
|
2002-12-23 15:46:53 +00:00
|
|
|
|
|
|
|
void o8_system();
|
2002-12-26 02:18:45 +00:00
|
|
|
void o8_startVideo();
|
2002-12-30 17:05:38 +00:00
|
|
|
void o8_kernelSetFunctions();
|
|
|
|
void o8_kernelGetFunctions();
|
2002-12-25 00:04:12 +00:00
|
|
|
|
2003-01-06 13:41:29 +00:00
|
|
|
void o8_getActorChore();
|
2003-05-14 10:16:57 +00:00
|
|
|
void o8_getActorZPlane();
|
2003-01-06 13:41:29 +00:00
|
|
|
|
2003-01-27 06:51:26 +00:00
|
|
|
void o8_drawObject();
|
2002-12-25 00:04:12 +00:00
|
|
|
void o8_getObjectImageX();
|
|
|
|
void o8_getObjectImageY();
|
|
|
|
void o8_getObjectImageWidth();
|
|
|
|
void o8_getObjectImageHeight();
|
2002-12-27 15:32:27 +00:00
|
|
|
|
|
|
|
void o8_getStringWidth();
|
2002-12-31 17:28:51 +00:00
|
|
|
|
2002-12-22 21:58:16 +00:00
|
|
|
};
|
|
|
|
|
2003-10-03 18:33:57 +00:00
|
|
|
} // End of namespace Scumm
|
2002-12-23 12:50:38 +00:00
|
|
|
|
2002-12-22 21:58:16 +00:00
|
|
|
#endif
|