2002-12-22 21:58:16 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
|
|
|
* Copyright (C) 2001 Ludvig Strigeus
|
2005-01-01 16:09:25 +00:00
|
|
|
* Copyright (C) 2001-2005 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"
|
2004-12-19 12:30:40 +00:00
|
|
|
#include "scumm/wiz_he.h"
|
2003-10-03 18:33:57 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
2004-10-19 12:30:42 +00:00
|
|
|
// This is to help devices with small memory (PDA, smartphones, ...)
|
|
|
|
// to save abit of memory used by opcode names in the Scumm engine.
|
|
|
|
#ifndef REDUCE_MEMORY_USAGE
|
|
|
|
# define _OPCODE(ver, x) { &ver::x, #x }
|
|
|
|
#else
|
|
|
|
# define _OPCODE(ver, x) { &ver::x, "" }
|
|
|
|
#endif
|
|
|
|
|
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;
|
2004-09-18 20:29:13 +00:00
|
|
|
|
|
|
|
uint16 _cursorImages[4][16];
|
|
|
|
byte _cursorHotspots[2 * 4];
|
2003-03-06 17:58:13 +00:00
|
|
|
|
2002-12-22 21:58:16 +00:00
|
|
|
public:
|
2004-09-18 20:29:13 +00:00
|
|
|
ScummEngine_v5(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]);
|
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);
|
|
|
|
|
2004-09-18 20:29:13 +00:00
|
|
|
virtual void animateCursor();
|
|
|
|
|
|
|
|
void setBuiltinCursor(int index);
|
|
|
|
void redefineBuiltinCursorFromChar(int index, int chr);
|
|
|
|
void redefineBuiltinCursorHotspot(int index, int x, int y);
|
2005-01-06 15:57:12 +00:00
|
|
|
void saveOrLoadCursorImages(Serializer *s);
|
2004-09-18 20:29:13 +00:00
|
|
|
|
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();
|
|
|
|
};
|
|
|
|
|
2005-04-03 22:56:02 +00:00
|
|
|
/**
|
|
|
|
* Engine for version 4 SCUMM games; GF_SMALL_HEADER is always set for these.
|
|
|
|
*/
|
2005-04-03 15:06:08 +00:00
|
|
|
class ScummEngine_v4 : public ScummEngine_v5 {
|
2002-12-22 21:58:16 +00:00
|
|
|
public:
|
2005-04-03 15:06:08 +00:00
|
|
|
ScummEngine_v4(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]);
|
2002-12-22 21:58:16 +00:00
|
|
|
|
2003-03-07 21:38:46 +00:00
|
|
|
protected:
|
2005-04-03 23:53:34 +00:00
|
|
|
virtual void readIndexFile();
|
|
|
|
virtual void loadCharset(int no);
|
|
|
|
virtual void loadRoomObjects();
|
|
|
|
virtual void readMAXS(int blockSize);
|
|
|
|
virtual void readGlobalObjects();
|
2005-04-01 13:05:40 +00:00
|
|
|
|
2005-04-03 23:53:34 +00:00
|
|
|
virtual void setupRoomObject(ObjectData *od, const byte *room, const byte *searchptr = NULL);
|
2005-04-01 13:05:40 +00:00
|
|
|
};
|
|
|
|
|
2005-04-03 22:56:02 +00:00
|
|
|
/**
|
|
|
|
* Engine for version 3 SCUMM games; GF_SMALL_NAMES is always set for these.
|
|
|
|
*/
|
2005-04-03 15:06:08 +00:00
|
|
|
class ScummEngine_v3 : public ScummEngine_v4 {
|
2005-04-01 13:05:40 +00:00
|
|
|
public:
|
2005-04-03 15:06:08 +00:00
|
|
|
ScummEngine_v3(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]);
|
2005-04-01 13:05:40 +00:00
|
|
|
|
|
|
|
protected:
|
2005-04-03 23:53:34 +00:00
|
|
|
virtual void readRoomsOffsets();
|
|
|
|
virtual void loadCharset(int no);
|
2002-12-22 21:58:16 +00:00
|
|
|
};
|
|
|
|
|
2005-04-03 22:56:02 +00:00
|
|
|
/**
|
|
|
|
* Engine for old format version 3 SCUMM games; GF_OLD_BUNDLE is always set for these.
|
|
|
|
*/
|
2005-04-03 15:06:08 +00:00
|
|
|
class ScummEngine_v3old : public ScummEngine_v3 {
|
|
|
|
public:
|
|
|
|
ScummEngine_v3old(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]);
|
|
|
|
|
|
|
|
protected:
|
2005-04-03 23:53:34 +00:00
|
|
|
virtual void readResTypeList(int id, uint32 tag, const char *name);
|
|
|
|
virtual void readIndexFile();
|
|
|
|
virtual void initRoomSubBlocks();
|
|
|
|
virtual void loadRoomObjects();
|
2005-04-03 15:06:08 +00:00
|
|
|
};
|
|
|
|
|
2005-04-03 22:56:02 +00:00
|
|
|
/**
|
|
|
|
* Engine for version 2 SCUMM games.
|
|
|
|
*/
|
2005-04-03 15:06:08 +00:00
|
|
|
class ScummEngine_v2 : public ScummEngine_v3old {
|
2003-04-20 16:04:50 +00:00
|
|
|
protected:
|
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:
|
2005-04-03 15:06:08 +00:00
|
|
|
ScummEngine_v2(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]);
|
2003-04-21 11:54:27 +00:00
|
|
|
|
2004-09-26 07:30:29 +00:00
|
|
|
virtual void scummInit();
|
|
|
|
|
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();
|
|
|
|
|
2005-04-03 23:53:34 +00:00
|
|
|
virtual void readIndexFile();
|
|
|
|
void readClassicIndexFile(); // V1
|
|
|
|
void readEnhancedIndexFile(); // V2
|
|
|
|
virtual void loadCharset(int no);
|
|
|
|
|
|
|
|
|
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
|
|
|
|
2004-09-26 07:30:29 +00:00
|
|
|
void initV2MouseOver();
|
2005-03-22 00:46:48 +00:00
|
|
|
void initNESMouseOver();
|
2004-09-26 07:30:29 +00:00
|
|
|
|
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_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;
|
|
|
|
};
|
|
|
|
|
2004-11-27 13:13:41 +00:00
|
|
|
enum ArrayType {
|
|
|
|
kBitArray = 1,
|
|
|
|
kNibbleArray = 2,
|
|
|
|
kByteArray = 3,
|
|
|
|
kStringArray = 4,
|
|
|
|
kIntArray = 5,
|
|
|
|
kDwordArray = 6
|
|
|
|
};
|
|
|
|
|
|
|
|
#if !defined(__GNUC__)
|
|
|
|
#pragma START_PACK_STRUCTS
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct ArrayHeader {
|
|
|
|
int16 dim1;
|
|
|
|
int16 type;
|
|
|
|
int16 dim2;
|
|
|
|
byte data[1];
|
|
|
|
} GCC_PACK;
|
|
|
|
|
|
|
|
#if !defined(__GNUC__)
|
|
|
|
#pragma END_PACK_STRUCTS
|
|
|
|
#endif
|
|
|
|
|
2002-12-22 21:58:16 +00:00
|
|
|
const OpcodeEntryV6 *_opcodesV6;
|
2003-09-13 21:04:47 +00:00
|
|
|
|
2004-06-27 21:06:04 +00:00
|
|
|
int _smushFrameRate;
|
|
|
|
|
2002-12-22 21:58:16 +00:00
|
|
|
public:
|
2004-09-10 12:13:03 +00:00
|
|
|
ScummEngine_v6(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]);
|
2002-12-22 21:58:16 +00:00
|
|
|
|
2004-08-22 23:38:00 +00:00
|
|
|
virtual void scummInit();
|
|
|
|
|
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
|
|
|
|
2005-04-03 23:53:34 +00:00
|
|
|
virtual void readMAXS(int blockSize);
|
|
|
|
|
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);
|
2004-09-20 19:19:57 +00:00
|
|
|
virtual int readArray(int array, int index, int base);
|
|
|
|
virtual 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
|
|
|
|
2004-09-18 20:29:13 +00:00
|
|
|
void setCursorTransparency(int a);
|
|
|
|
void setCursorHotspot(int x, int y);
|
|
|
|
|
2004-09-18 22:26:19 +00:00
|
|
|
virtual void setCursorFromImg(uint img, uint room, uint imgindex);
|
2004-08-22 23:38:00 +00:00
|
|
|
void useIm01Cursor(const byte *im, int w, int h);
|
|
|
|
void useBompCursor(const byte *im, int w, int h);
|
2004-09-18 20:29:13 +00:00
|
|
|
void grabCursor(int x, int y, int w, int h);
|
2004-08-22 23:38:00 +00:00
|
|
|
|
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();
|
2004-08-14 15:14:01 +00:00
|
|
|
void o6_getPixel();
|
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-09-21 01:00:30 +00:00
|
|
|
class ScummEngine_v60he : public ScummEngine_v6 {
|
2004-02-07 02:23:24 +00:00
|
|
|
protected:
|
2004-09-21 01:00:30 +00:00
|
|
|
typedef void (ScummEngine_v60he::*OpcodeProcv60he)();
|
|
|
|
struct OpcodeEntryv60he {
|
|
|
|
OpcodeProcv60he proc;
|
2004-02-07 02:23:24 +00:00
|
|
|
const char *desc;
|
|
|
|
};
|
2004-06-01 06:38:36 +00:00
|
|
|
|
2004-09-21 01:00:30 +00:00
|
|
|
const OpcodeEntryv60he *_opcodesv60he;
|
2004-02-07 02:23:24 +00:00
|
|
|
|
|
|
|
File _hFileTable[17];
|
|
|
|
|
|
|
|
public:
|
2004-09-21 01:00:30 +00:00
|
|
|
ScummEngine_v60he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]) : ScummEngine_v6(detector, syst, gs, md5sum) {}
|
2004-02-07 02:23:24 +00:00
|
|
|
|
2004-09-26 07:30:29 +00:00
|
|
|
virtual void scummInit();
|
|
|
|
|
2004-02-07 02:23:24 +00:00
|
|
|
protected:
|
|
|
|
virtual void setupOpcodes();
|
|
|
|
virtual void executeOpcode(byte i);
|
|
|
|
virtual const char *getOpcodeDesc(byte i);
|
|
|
|
|
2005-04-05 11:06:03 +00:00
|
|
|
void localizeArray(int slot, byte scriptSlot);
|
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);
|
|
|
|
void virtScreenLoad(int resIdx, int x1, int y1, int x2, int y2);
|
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-09-05 22:57:09 +00:00
|
|
|
void swapObjects(int object1, int object2);
|
2004-02-07 02:23:24 +00:00
|
|
|
|
2004-09-06 00:58:40 +00:00
|
|
|
/* HE version 60 script opcodes */
|
2004-09-21 01:00:30 +00:00
|
|
|
void o60_setState();
|
|
|
|
void o60_roomOps();
|
|
|
|
void o60_actorOps();
|
|
|
|
void o60_wait();
|
|
|
|
void o60_kernelSetFunctions();
|
|
|
|
void o60_kernelGetFunctions();
|
|
|
|
void o60_openFile();
|
|
|
|
void o60_closeFile();
|
|
|
|
void o60_deleteFile();
|
|
|
|
void o60_readFile();
|
|
|
|
void o60_rename();
|
|
|
|
void o60_writeFile();
|
|
|
|
void o60_soundOps();
|
|
|
|
void o60_seekFilePos();
|
2004-10-10 05:49:30 +00:00
|
|
|
void o60_localizeArrayToScript();
|
2004-09-21 01:00:30 +00:00
|
|
|
void o60_redimArray();
|
|
|
|
void o60_readFilePos();
|
2004-02-07 02:23:24 +00:00
|
|
|
};
|
|
|
|
|
2004-09-21 01:00:30 +00:00
|
|
|
class ScummEngine_v70he : public ScummEngine_v60he {
|
2004-09-18 20:29:13 +00:00
|
|
|
friend class Win32ResExtractor;
|
2005-01-31 03:53:35 +00:00
|
|
|
friend class MacResExtractor;
|
2004-09-18 20:29:13 +00:00
|
|
|
|
2004-03-01 05:57:30 +00:00
|
|
|
protected:
|
2004-09-21 01:00:30 +00:00
|
|
|
typedef void (ScummEngine_v70he::*OpcodeProcv70he)();
|
|
|
|
struct OpcodeEntryv70he {
|
|
|
|
OpcodeProcv70he proc;
|
2004-03-01 05:57:30 +00:00
|
|
|
const char *desc;
|
|
|
|
};
|
|
|
|
|
2004-09-29 21:45:52 +00:00
|
|
|
const OpcodeEntryv70he *_opcodesv70he;
|
|
|
|
|
2004-09-18 22:42:45 +00:00
|
|
|
Win32ResExtractor *_win32ResExtractor;
|
2005-01-31 03:53:35 +00:00
|
|
|
MacResExtractor *_macResExtractor;
|
2004-06-28 11:38:26 +00:00
|
|
|
|
2005-03-12 04:05:26 +00:00
|
|
|
int _heSndSoundFreq, _heSndOffset, _heSndChannel, _heSndSoundId, _heSndFlags, _heSBNGId;
|
2004-03-01 05:57:30 +00:00
|
|
|
|
|
|
|
public:
|
2004-09-21 01:00:30 +00:00
|
|
|
ScummEngine_v70he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]);
|
2004-03-01 05:57:30 +00:00
|
|
|
|
2004-12-19 12:30:40 +00:00
|
|
|
Wiz _wiz;
|
|
|
|
|
2004-03-01 05:57:30 +00:00
|
|
|
protected:
|
|
|
|
virtual void setupOpcodes();
|
|
|
|
virtual void executeOpcode(byte i);
|
|
|
|
virtual const char *getOpcodeDesc(byte i);
|
2004-10-17 05:04:49 +00:00
|
|
|
|
2005-04-03 23:53:34 +00:00
|
|
|
virtual void readRoomsOffsets();
|
|
|
|
virtual void readGlobalObjects();
|
2005-04-03 22:56:02 +00:00
|
|
|
|
2004-10-17 05:04:49 +00:00
|
|
|
virtual void redrawBGAreas();
|
2004-03-01 05:57:30 +00:00
|
|
|
|
2005-03-02 07:00:42 +00:00
|
|
|
int getStringCharWidth(byte chr);
|
2005-02-02 12:14:34 +00:00
|
|
|
virtual int setupStringArray(int size);
|
2004-11-26 20:17:02 +00:00
|
|
|
void appendSubstring(int dst, int src, int len2, int len);
|
2004-06-01 08:37:57 +00:00
|
|
|
|
2004-09-18 22:26:19 +00:00
|
|
|
virtual void setCursorFromImg(uint img, uint room, uint imgindex);
|
|
|
|
|
2004-09-06 00:58:40 +00:00
|
|
|
/* HE version 70 script opcodes */
|
2004-09-21 01:00:30 +00:00
|
|
|
void o70_startSound();
|
|
|
|
void o70_pickupObject();
|
|
|
|
void o70_getActorRoom();
|
|
|
|
void o70_resourceRoutines();
|
|
|
|
void o70_quitPauseRestart();
|
|
|
|
void o70_kernelSetFunctions();
|
2005-02-02 12:05:00 +00:00
|
|
|
void o70_copyString();
|
2004-11-23 19:47:54 +00:00
|
|
|
void o70_getStringWidth();
|
|
|
|
void o70_getStringLen();
|
2004-11-26 20:17:02 +00:00
|
|
|
void o70_appendString();
|
2005-02-02 12:05:00 +00:00
|
|
|
void o70_concatString();
|
2004-11-26 20:17:02 +00:00
|
|
|
void o70_compareString();
|
2004-09-21 01:00:30 +00:00
|
|
|
void o70_readINI();
|
|
|
|
void o70_writeINI();
|
2004-11-26 20:17:02 +00:00
|
|
|
void o70_getStringLenForWidth();
|
|
|
|
void o70_getCharIndexInString();
|
2004-09-21 01:00:30 +00:00
|
|
|
void o70_setFilePath();
|
2004-10-13 09:39:59 +00:00
|
|
|
void o70_setWindowCaption();
|
2004-09-21 01:00:30 +00:00
|
|
|
void o70_polygonOps();
|
|
|
|
void o70_polygonHit();
|
2004-08-23 10:34:50 +00:00
|
|
|
};
|
|
|
|
|
2004-09-21 01:00:30 +00:00
|
|
|
class ScummEngine_v72he : public ScummEngine_v70he {
|
2004-08-23 10:34:50 +00:00
|
|
|
protected:
|
|
|
|
typedef void (ScummEngine_v72he::*OpcodeProcV72he)();
|
|
|
|
struct OpcodeEntryV72he {
|
|
|
|
OpcodeProcV72he proc;
|
|
|
|
const char *desc;
|
|
|
|
};
|
|
|
|
|
2004-08-25 02:12:03 +00:00
|
|
|
#if !defined(__GNUC__)
|
|
|
|
#pragma START_PACK_STRUCTS
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct ArrayHeader {
|
|
|
|
int32 type; //0
|
|
|
|
int32 dim1start; //4
|
|
|
|
int32 dim1end; //8
|
2004-08-25 02:34:17 +00:00
|
|
|
int32 dim2start; //0C
|
2004-08-25 02:12:03 +00:00
|
|
|
int32 dim2end; //10
|
2004-08-25 02:34:17 +00:00
|
|
|
byte data[1]; //14
|
2004-08-25 02:12:03 +00:00
|
|
|
} GCC_PACK;
|
|
|
|
|
|
|
|
#if !defined(__GNUC__)
|
|
|
|
#pragma END_PACK_STRUCTS
|
|
|
|
#endif
|
|
|
|
|
2004-08-23 10:34:50 +00:00
|
|
|
const OpcodeEntryV72he *_opcodesV72he;
|
2005-03-30 11:49:53 +00:00
|
|
|
WizParameters _wizParams;
|
2004-08-23 10:34:50 +00:00
|
|
|
|
|
|
|
public:
|
2004-11-27 17:50:23 +00:00
|
|
|
ScummEngine_v72he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]) : ScummEngine_v70he(detector, syst, gs, md5sum) {}
|
2004-08-23 10:34:50 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void setupOpcodes();
|
|
|
|
virtual void executeOpcode(byte i);
|
|
|
|
virtual const char *getOpcodeDesc(byte i);
|
2005-04-03 23:53:34 +00:00
|
|
|
|
|
|
|
virtual void setupScummVars();
|
|
|
|
virtual void readArrayFromIndexFile();
|
2004-09-03 17:27:40 +00:00
|
|
|
|
|
|
|
virtual void redrawBGAreas();
|
2004-08-25 02:48:44 +00:00
|
|
|
|
2004-08-25 02:12:03 +00:00
|
|
|
ArrayHeader *defineArray(int array, int type, int dim2start, int dim2end, int dim1start, int dim1end);
|
2004-09-20 19:19:57 +00:00
|
|
|
virtual int readArray(int array, int idx2, int idx1);
|
|
|
|
virtual void writeArray(int array, int idx2, int idx1, int value);
|
2004-08-25 02:12:03 +00:00
|
|
|
void redimArray(int arrayId, int newDim2start, int newDim2end,
|
|
|
|
int newDim1start, int newDim1end, int type);
|
2005-04-02 17:19:44 +00:00
|
|
|
void checkArrayLimits(int array, int dim2start, int dim2end, int dim1start, int dim1end);
|
|
|
|
void copyArray(int array1, int a1_dim2start, int a1_dim2end, int a1_dim1start, int a1_dim1end,
|
|
|
|
int array2, int a2_dim2start, int a2_dim2end, int a2_dim1start, int a2_dim1end);
|
|
|
|
void copyArrayHelper(ArrayHeader *ah, int idx2, int idx1, int len1, byte **data, int *size, int *num);
|
2005-02-02 12:14:34 +00:00
|
|
|
virtual int setupStringArray(int size);
|
2004-08-25 12:48:47 +00:00
|
|
|
int readFileToArray(int slot, int32 size);
|
|
|
|
void writeFileFromArray(int slot, int resID);
|
2004-08-25 06:34:33 +00:00
|
|
|
|
2005-04-01 08:51:13 +00:00
|
|
|
void displayWizImage(WizImage *pwi);
|
2005-03-30 11:49:53 +00:00
|
|
|
void displayWizComplexImage(const WizParameters *params);
|
2005-04-05 14:42:36 +00:00
|
|
|
void drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int xmapNum, int angle, int zoom, const Common::Rect *r, int flags, int dstResNum, int paletteNum);
|
2005-04-01 12:43:13 +00:00
|
|
|
void captureWizImage(int resNum, const Common::Rect& r, bool frontBuffer, int compType);
|
|
|
|
void getWizImageDim(int resNum, int state, int32 &w, int32 &h);
|
2005-04-05 14:42:36 +00:00
|
|
|
uint8 *drawWizImage(int resNum, int state, int x1, int y1, int xmapNum, const Common::Rect *clipBox, int flags, int dstResNum, int paletteNum);
|
|
|
|
void drawWizPolygon(int resNum, int state, int id, int flags, int xmapNum, int dstResNum, int paletteNum);
|
2004-09-03 17:27:40 +00:00
|
|
|
void flushWizBuffer();
|
|
|
|
|
2004-09-05 09:36:51 +00:00
|
|
|
virtual void decodeParseString(int a, int b);
|
|
|
|
void decodeScriptString(byte *dst, bool scriptString = false);
|
2004-09-13 02:09:35 +00:00
|
|
|
void copyScriptString(byte *dst);
|
2004-09-05 09:36:51 +00:00
|
|
|
|
2005-03-10 11:06:37 +00:00
|
|
|
byte *heFindResourceData(uint32 tag, byte *ptr);
|
|
|
|
byte *heFindResource(uint32 tag, byte *ptr);
|
|
|
|
byte *findWrappedBlock(uint32 tag, byte *ptr, int state, bool flagError);
|
2005-03-28 10:02:22 +00:00
|
|
|
int findObject(int x, int y, int num, int *args);
|
2004-09-09 01:53:23 +00:00
|
|
|
|
2004-09-06 00:58:40 +00:00
|
|
|
/* HE version 72 script opcodes */
|
2004-08-25 08:49:34 +00:00
|
|
|
void o72_pushDWord();
|
2004-08-25 06:34:33 +00:00
|
|
|
void o72_addMessageToStack();
|
2004-09-17 11:20:37 +00:00
|
|
|
void o72_isAnyOf();
|
2004-11-26 20:17:02 +00:00
|
|
|
void o72_resetCutscene();
|
2004-09-14 15:06:02 +00:00
|
|
|
void o72_findObjectWithClassOf();
|
2004-10-08 07:13:13 +00:00
|
|
|
void o72_getObjectImageX();
|
|
|
|
void o72_getObjectImageY();
|
2004-10-08 22:58:49 +00:00
|
|
|
void o72_captureWizImage();
|
2004-08-26 06:08:41 +00:00
|
|
|
void o72_getTimer();
|
|
|
|
void o72_setTimer();
|
2005-04-04 11:47:38 +00:00
|
|
|
void o72_getSoundElapsedTime();
|
2004-08-23 12:19:08 +00:00
|
|
|
void o72_startScript();
|
|
|
|
void o72_startObject();
|
2004-08-23 14:11:53 +00:00
|
|
|
void o72_drawObject();
|
2004-09-03 17:27:40 +00:00
|
|
|
void o72_printWizImage();
|
2004-08-25 02:12:03 +00:00
|
|
|
void o72_getArrayDimSize();
|
2004-08-28 09:19:53 +00:00
|
|
|
void o72_getNumFreeArrays();
|
2004-09-29 11:25:21 +00:00
|
|
|
void o72_roomOps();
|
2004-09-05 09:36:51 +00:00
|
|
|
void o72_actorOps();
|
|
|
|
void o72_verbOps();
|
2005-03-28 10:02:22 +00:00
|
|
|
void o72_findObject();
|
2004-08-23 12:19:08 +00:00
|
|
|
void o72_arrayOps();
|
2005-03-17 10:53:29 +00:00
|
|
|
void o72_talkActor();
|
|
|
|
void o72_talkEgo();
|
2004-08-23 12:19:08 +00:00
|
|
|
void o72_dimArray();
|
|
|
|
void o72_dim2dimArray();
|
2004-09-21 01:00:30 +00:00
|
|
|
void o72_traceStatus();
|
2004-09-13 05:25:35 +00:00
|
|
|
void o72_unknownCF();
|
2004-09-03 17:27:40 +00:00
|
|
|
void o72_drawWizImage();
|
2004-10-04 00:01:06 +00:00
|
|
|
void o72_kernelGetFunctions();
|
2004-08-23 12:19:08 +00:00
|
|
|
void o72_jumpToScript();
|
2004-08-25 12:48:47 +00:00
|
|
|
void o72_openFile();
|
|
|
|
void o72_readFile();
|
|
|
|
void o72_writeFile();
|
2004-08-25 02:12:03 +00:00
|
|
|
void o72_findAllObjects();
|
2004-08-29 11:27:16 +00:00
|
|
|
void o72_deleteFile();
|
2005-03-17 11:06:43 +00:00
|
|
|
void o72_rename();
|
2004-08-24 11:17:28 +00:00
|
|
|
void o72_getPixel();
|
2004-08-25 02:12:03 +00:00
|
|
|
void o72_pickVarRandom();
|
|
|
|
void o72_redimArray();
|
2004-09-07 09:25:37 +00:00
|
|
|
void o72_checkGlobQueue();
|
2004-08-31 07:47:34 +00:00
|
|
|
void o72_readINI();
|
2004-09-03 06:57:38 +00:00
|
|
|
void o72_writeINI();
|
2004-10-03 14:13:05 +00:00
|
|
|
void o72_getResourceSize();
|
2004-09-10 10:55:43 +00:00
|
|
|
void o72_setFilePath();
|
2004-10-13 09:39:59 +00:00
|
|
|
void o72_setWindowCaption();
|
2004-03-01 05:57:30 +00:00
|
|
|
};
|
|
|
|
|
2004-09-06 00:58:40 +00:00
|
|
|
class ScummEngine_v80he : public ScummEngine_v72he {
|
|
|
|
protected:
|
|
|
|
typedef void (ScummEngine_v80he::*OpcodeProcV80he)();
|
|
|
|
struct OpcodeEntryV80he {
|
|
|
|
OpcodeProcV80he proc;
|
|
|
|
const char *desc;
|
|
|
|
};
|
|
|
|
|
|
|
|
const OpcodeEntryV80he *_opcodesV80he;
|
|
|
|
|
|
|
|
public:
|
2004-09-10 12:13:03 +00:00
|
|
|
ScummEngine_v80he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]) : ScummEngine_v72he(detector, syst, gs, md5sum) {}
|
2004-09-06 00:58:40 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void setupOpcodes();
|
|
|
|
virtual void executeOpcode(byte i);
|
|
|
|
virtual const char *getOpcodeDesc(byte i);
|
2004-09-09 01:53:23 +00:00
|
|
|
|
2004-09-26 15:29:58 +00:00
|
|
|
void loadImgSpot(int resId, int state, int16 &x, int16 &y);
|
2005-04-01 06:30:46 +00:00
|
|
|
void loadWizCursor(int resId);
|
2004-09-06 00:58:40 +00:00
|
|
|
|
|
|
|
/* HE version 80 script opcodes */
|
2004-11-23 19:47:54 +00:00
|
|
|
void o80_loadSBNG();
|
2005-02-14 07:15:16 +00:00
|
|
|
void o80_getFileSize();
|
2004-11-23 19:47:54 +00:00
|
|
|
void o80_stringToInt();
|
2004-10-17 06:32:58 +00:00
|
|
|
void o80_getSoundVar();
|
2004-10-10 05:49:30 +00:00
|
|
|
void o80_localizeArrayToRoom();
|
2004-09-13 04:45:21 +00:00
|
|
|
void o80_readConfigFile();
|
|
|
|
void o80_writeConfigFile();
|
2004-09-09 01:53:23 +00:00
|
|
|
void o80_cursorCommand();
|
2004-09-06 01:10:31 +00:00
|
|
|
void o80_setState();
|
2004-10-05 05:52:48 +00:00
|
|
|
void o80_drawBox();
|
2004-09-14 07:59:40 +00:00
|
|
|
void o80_drawWizPolygon();
|
2004-10-03 23:37:34 +00:00
|
|
|
void o80_unknownE0();
|
2004-09-16 12:30:54 +00:00
|
|
|
void o80_pickVarRandom();
|
2004-09-06 00:58:40 +00:00
|
|
|
};
|
|
|
|
|
2005-02-27 03:36:33 +00:00
|
|
|
struct SpriteInfo;
|
|
|
|
struct SpriteGroup;
|
|
|
|
|
2004-09-06 00:58:40 +00:00
|
|
|
class ScummEngine_v90he : public ScummEngine_v80he {
|
|
|
|
protected:
|
|
|
|
typedef void (ScummEngine_v90he::*OpcodeProcV90he)();
|
|
|
|
struct OpcodeEntryV90he {
|
|
|
|
OpcodeProcV90he proc;
|
|
|
|
const char *desc;
|
|
|
|
};
|
2004-09-26 15:29:58 +00:00
|
|
|
|
2005-02-27 02:29:54 +00:00
|
|
|
struct FloodStateParameters {
|
2005-02-27 01:20:44 +00:00
|
|
|
Common::Rect box;
|
|
|
|
int field_10;
|
|
|
|
int field_14;
|
|
|
|
int field_18;
|
|
|
|
int field_1C;
|
|
|
|
};
|
|
|
|
|
2004-10-02 01:40:34 +00:00
|
|
|
int _heObject, _heObjectNum;
|
2004-10-04 04:04:37 +00:00
|
|
|
int _hePaletteNum;
|
2004-09-06 00:58:40 +00:00
|
|
|
|
|
|
|
const OpcodeEntryV90he *_opcodesV90he;
|
2005-02-27 02:29:54 +00:00
|
|
|
FloodStateParameters _floodStateParams;
|
2004-09-06 00:58:40 +00:00
|
|
|
|
2005-02-21 00:02:44 +00:00
|
|
|
int _curMaxSpriteId;
|
|
|
|
int _curSpriteId;
|
2005-02-23 01:08:29 +00:00
|
|
|
int _curSpriteGroupId;
|
2005-02-27 03:36:33 +00:00
|
|
|
int _varNumSpriteGroups;
|
|
|
|
int _numSpritesToProcess;
|
|
|
|
int _varNumSprites;
|
|
|
|
int _varMaxSprites;
|
|
|
|
SpriteInfo *_spriteTable;
|
|
|
|
SpriteGroup *_spriteGroups;
|
|
|
|
SpriteInfo **_activeSpritesTable;
|
2005-02-21 00:02:44 +00:00
|
|
|
|
2004-09-06 00:58:40 +00:00
|
|
|
public:
|
2004-09-10 12:13:03 +00:00
|
|
|
ScummEngine_v90he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]) : ScummEngine_v80he(detector, syst, gs, md5sum) {}
|
2004-09-06 00:58:40 +00:00
|
|
|
|
2004-09-26 15:29:58 +00:00
|
|
|
virtual void scummInit();
|
|
|
|
|
2004-09-06 00:58:40 +00:00
|
|
|
protected:
|
2005-02-20 13:07:57 +00:00
|
|
|
virtual void allocateArrays();
|
2004-09-06 00:58:40 +00:00
|
|
|
virtual void setupOpcodes();
|
|
|
|
virtual void executeOpcode(byte i);
|
|
|
|
virtual const char *getOpcodeDesc(byte i);
|
|
|
|
|
2005-02-27 02:55:13 +00:00
|
|
|
void createWizEmptyImage(const WizParameters *params);
|
2005-02-28 20:19:56 +00:00
|
|
|
void fillWizRect(const WizParameters *params);
|
2004-10-08 22:58:49 +00:00
|
|
|
void processWizImage(const WizParameters *params);
|
2004-11-27 17:50:23 +00:00
|
|
|
int getWizImageStates(int resnum);
|
2005-04-01 06:30:46 +00:00
|
|
|
int isWizPixelNonTransparent(int resnum, int state, int x, int y, int flags);
|
|
|
|
uint8 getWizPixelColor(int resnum, int state, int x, int y, int flags);
|
2004-11-22 20:34:29 +00:00
|
|
|
int computeWizHistogram(int resnum, int state, int x, int y, int w, int h);
|
2005-04-02 17:19:44 +00:00
|
|
|
|
|
|
|
void getArrayDim(int array, int *dim2start, int *dim2end, int *dim1start, int *dim1end);
|
|
|
|
void sortArray(int array, int dim2start, int dim2end, int dim1start, int dim1end, int sortOrder);
|
2004-09-26 15:29:58 +00:00
|
|
|
|
2005-03-02 20:02:59 +00:00
|
|
|
uint8 *getHEPalette(int palSlot);
|
2005-04-07 10:43:51 +00:00
|
|
|
uint8 *getHEPaletteIndex(int palSlot);
|
2005-04-06 23:56:50 +00:00
|
|
|
int getHEPaletteColor(int palSlot, int color);
|
2005-03-02 20:02:59 +00:00
|
|
|
void setHEPaletteColor(int palSlot, uint8 color, uint8 r, uint8 g, uint8 b);
|
|
|
|
void setHEPaletteFromPtr(int palSlot, const uint8 *palData);
|
|
|
|
void setHEPaletteFromCostume(int palSlot, int resId);
|
|
|
|
void setHEPaletteFromImage(int palSlot, int resId, int state);
|
|
|
|
void setHEPaletteFromRoom(int palSlot, int resId, int state);
|
|
|
|
void restoreHEPalette(int palSlot);
|
|
|
|
void copyHEPalette(int dstPalSlot, int srcPalSlot);
|
|
|
|
void copyHEPaletteColor(int palSlot, uint8 dstColor, uint8 srcColor);
|
|
|
|
|
2005-03-31 02:28:14 +00:00
|
|
|
void getSpriteBounds(int spriteId, bool checkGroup, Common::Rect &bound);
|
2005-02-26 12:10:06 +00:00
|
|
|
int findSpriteWithClassOf(int x, int y, int spriteGroupId, int d, int num, int *args);
|
2005-03-28 11:38:04 +00:00
|
|
|
int spriteInfoGet_classFlags(int spriteId, int num, int *args);
|
2005-03-29 14:11:08 +00:00
|
|
|
int spriteInfoGet_flagDoubleBuffered(int spriteId);
|
2005-03-13 13:10:39 +00:00
|
|
|
int spriteInfoGet_flagYFlipped(int spriteId);
|
|
|
|
int spriteInfoGet_flagXFlipped(int spriteId);
|
2005-02-24 21:05:29 +00:00
|
|
|
int spriteInfoGet_flagActive(int spriteId);
|
2005-03-29 14:11:08 +00:00
|
|
|
int spriteInfoGet_flagNeedPaletteRemap(int spriteId);
|
2005-04-03 02:24:28 +00:00
|
|
|
int spriteInfoGet_flagDelayed(int spriteId);
|
2005-04-01 06:30:46 +00:00
|
|
|
int spriteInfoGet_flagMarkDirty(int spriteId);
|
2005-02-26 11:05:13 +00:00
|
|
|
int spriteInfoGet_flagHasImage(int spriteId);
|
2005-02-21 00:34:00 +00:00
|
|
|
int spriteInfoGet_resId(int spriteId);
|
|
|
|
int spriteInfoGet_resState(int spriteId);
|
|
|
|
int spriteInfoGet_groupNum(int spriteId);
|
2005-03-31 22:51:54 +00:00
|
|
|
int spriteInfoGet_paletteNum(int spriteId);
|
2005-03-14 12:54:24 +00:00
|
|
|
int spriteInfoGet_zorderPriority(int spriteId);
|
2005-02-21 00:34:00 +00:00
|
|
|
int spriteInfoGet_grp_tx(int spriteId);
|
|
|
|
int spriteInfoGet_grp_ty(int spriteId);
|
|
|
|
int spriteInfoGet_field_44(int spriteId);
|
2005-04-03 02:24:28 +00:00
|
|
|
int spriteInfoGet_xmapNum(int spriteId);
|
2005-02-21 00:34:00 +00:00
|
|
|
int spriteInfoGet_wizSize(int spriteId);
|
|
|
|
int spriteInfoGet_zoom(int spriteId);
|
2005-03-14 12:54:24 +00:00
|
|
|
int spriteInfoGet_delayAmount(int spriteId);
|
2005-02-21 04:53:34 +00:00
|
|
|
int spriteInfoGet_field_7C(int spriteId);
|
2005-02-21 00:34:00 +00:00
|
|
|
int spriteInfoGet_field_80(int spriteId);
|
2005-02-23 09:55:34 +00:00
|
|
|
int spriteInfoGet_field_88(int spriteId, int type);
|
2005-02-21 00:34:00 +00:00
|
|
|
void getSpriteImageDim(int spriteId, int32 &w, int32 &h);
|
|
|
|
void spriteInfoGet_tx_ty(int spriteId, int32 &tx, int32 &ty);
|
2005-02-23 04:05:22 +00:00
|
|
|
void spriteInfoGet_dx_dy(int spriteId, int32 &dx, int32 &dy);
|
2005-02-21 00:34:00 +00:00
|
|
|
|
2005-02-21 02:37:05 +00:00
|
|
|
int spriteGroupGet_allocateGroupSpritesList(int spriteGroupId);
|
2005-02-26 11:22:00 +00:00
|
|
|
int spriteGroupGet_zorderPriority(int spriteGroupId);
|
2005-04-03 02:24:28 +00:00
|
|
|
int spriteGroupGet_dstResNum(int spriteGroupId);
|
2005-02-26 11:22:00 +00:00
|
|
|
int spriteGroupGet_scale_x_ratio_mul(int spriteGroupId);
|
|
|
|
int spriteGroupGet_scale_x_ratio_div(int spriteGroupId);
|
|
|
|
int spriteGroupGet_scale_y_ratio_mul(int spriteGroupId);
|
|
|
|
int spriteGroupGet_scale_y_ratio_div(int spriteGroupId);
|
2005-02-21 02:37:05 +00:00
|
|
|
void spriteGroupGet_tx_ty(int spriteGroupId, int32 &tx, int32 &ty);
|
2005-02-21 01:08:48 +00:00
|
|
|
|
2005-03-31 22:51:54 +00:00
|
|
|
void spriteInfoSet_paletteNum(int spriteId, int value);
|
2005-02-21 00:34:00 +00:00
|
|
|
void spriteInfoSet_field_7C(int spriteId, int value);
|
|
|
|
void spriteInfoSet_field_80(int spriteId, int value);
|
2005-02-23 02:35:59 +00:00
|
|
|
void spriteInfoSet_resetSprite(int spriteId);
|
2005-02-21 02:37:05 +00:00
|
|
|
void spriteInfoSet_resState(int spriteId, int value);
|
|
|
|
void spriteInfoSet_tx_ty(int spriteId, int value1, int value2);
|
|
|
|
void spriteInfoSet_groupNum(int spriteId, int value);
|
2005-02-23 04:05:22 +00:00
|
|
|
void spriteInfoSet_dx_dy(int spriteId, int value1, int value2);
|
2005-04-03 02:24:28 +00:00
|
|
|
void spriteInfoSet_xmapNum(int spriteId, int value);
|
2005-02-21 02:37:05 +00:00
|
|
|
void spriteInfoSet_field_44(int spriteId, int value1, int value2);
|
2005-03-14 12:54:24 +00:00
|
|
|
void spriteInfoSet_zorderPriority(int spriteId, int value);
|
2005-02-21 02:37:05 +00:00
|
|
|
void spriteInfoSet_Inc_tx_ty(int spriteId, int value1, int value2);
|
|
|
|
void spriteInfoSet_zoom(int spriteId, int value);
|
2005-04-03 02:24:28 +00:00
|
|
|
void spriteInfoSet_angle(int spriteId, int value);
|
2005-03-29 14:11:08 +00:00
|
|
|
void spriteInfoSet_flagDoubleBuffered(int spriteId, int value);
|
2005-02-24 23:11:50 +00:00
|
|
|
void spriteInfoSet_flagYFlipped(int spriteId, int value);
|
|
|
|
void spriteInfoSet_flagXFlipped(int spriteId, int value);
|
2005-03-17 09:42:31 +00:00
|
|
|
void spriteInfoSet_flagActive(int spriteId, int value);
|
2005-03-29 14:11:08 +00:00
|
|
|
void spriteInfoSet_flagNeedPaletteRemap(int spriteId, int value);
|
2005-04-03 02:24:28 +00:00
|
|
|
void spriteInfoSet_flagDelayed(int spriteId, int value);
|
2005-04-01 06:30:46 +00:00
|
|
|
void spriteInfoSet_flagMarkDirty(int spriteId, int value);
|
2005-02-26 11:05:13 +00:00
|
|
|
void spriteInfoSet_flagHasImage(int spriteId, int value);
|
2005-03-14 12:54:24 +00:00
|
|
|
void spriteInfoSet_delay(int spriteId, int value);
|
2005-02-23 11:15:41 +00:00
|
|
|
void spriteInfoSet_setClassFlags(int spriteId, int value);
|
|
|
|
void spriteInfoSet_setClassFlag(int spriteId, int classId, int toggle);
|
2005-02-22 22:52:35 +00:00
|
|
|
void spriteInfoSet_resetClassFlags(int spriteId);
|
2005-02-23 09:55:34 +00:00
|
|
|
void spriteInfoSet_field_88(int spriteId, int type, int value);
|
2005-02-21 00:02:44 +00:00
|
|
|
|
2005-02-23 04:35:20 +00:00
|
|
|
void redrawSpriteGroup(int spriteGroupId);
|
2005-02-23 01:08:29 +00:00
|
|
|
void spriteGroupSet_case0_0(int spriteGroupId, int value1, int value2);
|
|
|
|
void spriteGroupSet_case0_1(int spriteGroupId, int value);
|
|
|
|
void spriteGroupSet_case0_2(int spriteGroupId, int value);
|
|
|
|
void spriteGroupSet_case0_3(int spriteGroupId, int value);
|
|
|
|
void spriteGroupSet_case0_4(int spriteGroupId);
|
|
|
|
void spriteGroupSet_case0_5(int spriteGroupId, int value);
|
|
|
|
void spriteGroupSet_case0_6(int spriteGroupId, int value);
|
|
|
|
void spriteGroupSet_case0_7(int spriteGroupId, int value);
|
2005-02-28 04:17:17 +00:00
|
|
|
void spriteGroupSet_bbox(int spriteGroupId, int x1, int y1, int x2, int y2);
|
2005-02-26 11:22:00 +00:00
|
|
|
void spriteGroupSet_zorderPriority(int spriteGroupId, int value);
|
2005-02-23 01:08:29 +00:00
|
|
|
void spriteGroupSet_tx_ty(int spriteGroupId, int value1, int value2);
|
2005-02-28 04:17:17 +00:00
|
|
|
void spriteGroupSet_inc_tx_ty(int spriteGroupId, int value1, int value2);
|
2005-04-03 02:24:28 +00:00
|
|
|
void spriteGroupSet_dstResNum(int spriteGroupId, int value);
|
2005-02-28 04:34:22 +00:00
|
|
|
void spriteGroupSet_scaling(int spriteGroupId);
|
2005-02-28 04:17:17 +00:00
|
|
|
void spriteGroupSet_scale_x_ratio_mul(int spriteGroupId, int value);
|
|
|
|
void spriteGroupSet_scale_x_ratio_div(int spriteGroupId, int value);
|
|
|
|
void spriteGroupSet_scale_y_ratio_mul(int spriteGroupId, int value);
|
|
|
|
void spriteGroupSet_scale_y_ratio_div(int spriteGroupId, int value);
|
2005-03-17 09:28:36 +00:00
|
|
|
void spriteGroupSet_flagClipBoxAnd(int spriteGroupId);
|
2005-02-23 01:08:29 +00:00
|
|
|
|
2005-02-22 21:38:44 +00:00
|
|
|
void spritesAllocTables(int numSprites, int numGroups, int numMaxSprites);
|
2005-02-26 04:20:47 +00:00
|
|
|
void spritesResetGroup(int spriteGroupId);
|
2005-02-20 22:16:31 +00:00
|
|
|
void spritesResetTables(bool refreshScreen);
|
2005-02-24 21:05:29 +00:00
|
|
|
void spriteAddImageToList(int spriteId, int imageNum, int *spriteIdptr);
|
2005-02-24 04:04:17 +00:00
|
|
|
|
|
|
|
public:
|
2005-02-22 01:16:41 +00:00
|
|
|
void spritesBlitToScreen();
|
2005-02-22 21:38:44 +00:00
|
|
|
void spritesMarkDirty(bool unkFlag);
|
2005-02-23 23:28:53 +00:00
|
|
|
void spritesSortActiveSprites();
|
2005-02-24 04:04:17 +00:00
|
|
|
void spritesProcessWiz(bool arg);
|
2005-02-24 08:00:30 +00:00
|
|
|
void spritesUpdateImages();
|
2005-02-21 00:59:50 +00:00
|
|
|
|
2005-02-24 04:04:17 +00:00
|
|
|
protected:
|
2004-09-06 00:58:40 +00:00
|
|
|
/* HE version 90 script opcodes */
|
2005-03-07 06:06:22 +00:00
|
|
|
void o90_dup_n();
|
2004-10-08 17:56:08 +00:00
|
|
|
void o90_min();
|
|
|
|
void o90_max();
|
2004-10-03 19:57:19 +00:00
|
|
|
void o90_sin();
|
|
|
|
void o90_cos();
|
2004-10-08 17:56:08 +00:00
|
|
|
void o90_sqrt();
|
|
|
|
void o90_atan2();
|
|
|
|
void o90_getSegmentAngle();
|
2005-03-08 05:56:21 +00:00
|
|
|
void o90_getActorData();
|
2004-10-10 05:49:30 +00:00
|
|
|
void o90_startScriptUnk();
|
|
|
|
void o90_jumpToScriptUnk();
|
2004-10-02 01:08:31 +00:00
|
|
|
void o90_wizImageOps();
|
2004-11-21 20:55:56 +00:00
|
|
|
void o90_getDistanceBetweenPoints();
|
2005-02-20 11:14:50 +00:00
|
|
|
void o90_getSpriteInfo();
|
|
|
|
void o90_setSpriteInfo();
|
|
|
|
void o90_getSpriteGroupInfo();
|
|
|
|
void o90_setSpriteGroupInfo();
|
2004-11-22 20:34:29 +00:00
|
|
|
void o90_getWizData();
|
2005-02-27 01:20:44 +00:00
|
|
|
void o90_floodState();
|
2004-09-12 10:23:20 +00:00
|
|
|
void o90_mod();
|
2004-11-28 05:33:33 +00:00
|
|
|
void o90_shl();
|
|
|
|
void o90_shr();
|
2004-10-03 05:29:31 +00:00
|
|
|
void o90_findAllObjectsWithClassOf();
|
2004-10-04 02:23:02 +00:00
|
|
|
void o90_getPolygonOverlap();
|
2004-11-26 20:17:02 +00:00
|
|
|
void o90_cond();
|
2004-10-04 01:34:29 +00:00
|
|
|
void o90_dim2dim2Array();
|
2005-03-07 10:21:23 +00:00
|
|
|
void o90_redim2dimArray();
|
2004-10-04 02:23:02 +00:00
|
|
|
void o90_sortArray();
|
|
|
|
void o90_getObjectData();
|
|
|
|
void o90_getPaletteData();
|
|
|
|
void o90_paletteOps();
|
2004-10-01 23:56:39 +00:00
|
|
|
void o90_unknownA5();
|
2004-09-21 05:59:26 +00:00
|
|
|
void o90_getActorAnimProgress();
|
2005-03-23 00:16:51 +00:00
|
|
|
void o90_kernelGetFunctions();
|
|
|
|
void o90_kernelSetFunctions();
|
2004-09-06 00:58:40 +00:00
|
|
|
};
|
|
|
|
|
2005-04-07 10:43:51 +00:00
|
|
|
class ScummEngine_v99he : public ScummEngine_v90he {
|
|
|
|
public:
|
|
|
|
ScummEngine_v99he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]) : ScummEngine_v90he(detector, syst, gs, md5sum) {}
|
|
|
|
|
2005-04-07 11:15:10 +00:00
|
|
|
virtual void scummInit();
|
|
|
|
|
2005-04-07 10:43:51 +00:00
|
|
|
protected:
|
|
|
|
virtual void copyPalColor(int dst, int src);
|
|
|
|
virtual void darkenPalette(int redScale, int greenScale, int blueScale, int startColor, int endColor);
|
|
|
|
virtual void setPaletteFromPtr(const byte *ptr, int numcolor = -1);
|
|
|
|
virtual void setPalColor(int index, int r, int g, int b);
|
|
|
|
virtual void updatePalette();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ScummEngine_v100he : public ScummEngine_v99he {
|
2004-10-09 14:33:31 +00:00
|
|
|
protected:
|
|
|
|
typedef void (ScummEngine_v100he::*OpcodeProcV100he)();
|
|
|
|
struct OpcodeEntryV100he {
|
|
|
|
OpcodeProcV100he proc;
|
|
|
|
const char *desc;
|
|
|
|
};
|
|
|
|
|
2004-10-10 01:52:35 +00:00
|
|
|
int _heResId, _heResType;
|
|
|
|
|
2004-10-09 14:33:31 +00:00
|
|
|
const OpcodeEntryV100he *_opcodesV100he;
|
|
|
|
|
|
|
|
public:
|
2005-04-07 10:43:51 +00:00
|
|
|
ScummEngine_v100he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]) : ScummEngine_v99he(detector, syst, gs, md5sum) {}
|
2004-10-09 14:33:31 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void setupOpcodes();
|
|
|
|
virtual void executeOpcode(byte i);
|
|
|
|
virtual const char *getOpcodeDesc(byte i);
|
|
|
|
|
|
|
|
virtual void decodeParseString(int a, int b);
|
|
|
|
|
|
|
|
/* HE version 100 script opcodes */
|
|
|
|
void o100_actorOps();
|
|
|
|
void o100_arrayOps();
|
|
|
|
void o100_dim2dimArray();
|
2005-02-14 08:58:02 +00:00
|
|
|
void o100_redim2dimArray();
|
2004-10-09 14:33:31 +00:00
|
|
|
void o100_dimArray();
|
2005-03-10 10:11:42 +00:00
|
|
|
void o100_unknownE0();
|
2004-10-09 14:33:31 +00:00
|
|
|
void o100_drawObject();
|
2005-02-20 11:14:50 +00:00
|
|
|
void o100_setSpriteGroupInfo();
|
2004-10-09 14:33:31 +00:00
|
|
|
void o100_resourceRoutines();
|
|
|
|
void o100_wizImageOps();
|
2005-03-08 04:17:45 +00:00
|
|
|
void o100_jumpToScript();
|
2005-02-01 06:37:30 +00:00
|
|
|
void o100_loadSBNG();
|
2004-10-09 14:33:31 +00:00
|
|
|
void o100_dim2dim2Array();
|
|
|
|
void o100_paletteOps();
|
2005-03-13 03:23:35 +00:00
|
|
|
void o100_jumpToScriptUnk();
|
|
|
|
void o100_startScriptUnk();
|
2004-10-10 04:02:37 +00:00
|
|
|
void o100_redimArray();
|
2004-10-09 14:33:31 +00:00
|
|
|
void o100_roomOps();
|
|
|
|
void o100_startSound();
|
2005-02-20 11:14:50 +00:00
|
|
|
void o100_setSpriteInfo();
|
2005-03-08 04:17:45 +00:00
|
|
|
void o100_startScript();
|
2004-10-09 14:33:31 +00:00
|
|
|
void o100_quitPauseRestart();
|
|
|
|
void o100_cursorCommand();
|
|
|
|
void o100_wait();
|
2005-01-30 05:34:04 +00:00
|
|
|
void o100_writeFile();
|
2004-10-10 01:52:35 +00:00
|
|
|
void o100_getResourceSize();
|
2005-02-20 11:14:50 +00:00
|
|
|
void o100_getSpriteGroupInfo();
|
2004-10-10 00:24:15 +00:00
|
|
|
void o100_getPaletteData();
|
2005-01-30 05:34:04 +00:00
|
|
|
void o100_readFile();
|
2005-02-20 11:14:50 +00:00
|
|
|
void o100_getSpriteInfo();
|
2005-02-08 11:17:36 +00:00
|
|
|
void o100_getWizData();
|
2004-10-09 14:33:31 +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:
|
2004-09-10 12:13:03 +00:00
|
|
|
ScummEngine_v7(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]) : ScummEngine_v6(detector, syst, gs, md5sum) {}
|
2002-12-22 21:58:16 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void setupScummVars();
|
2003-05-29 12:55:28 +00:00
|
|
|
|
2005-04-03 23:53:34 +00:00
|
|
|
virtual void readMAXS(int blockSize);
|
|
|
|
virtual void readGlobalObjects();
|
|
|
|
|
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:
|
2004-09-10 12:13:03 +00:00
|
|
|
ScummEngine_v8(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]) : ScummEngine_v7(detector, syst, gs, md5sum) {}
|
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
|
|
|
|
2005-04-03 23:53:34 +00:00
|
|
|
virtual void readMAXS(int blockSize);
|
|
|
|
virtual void readGlobalObjects();
|
|
|
|
|
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();
|
|
|
|
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
|