diff options
author | Max Horn | 2009-04-16 09:26:37 +0000 |
---|---|---|
committer | Max Horn | 2009-04-16 09:26:37 +0000 |
commit | 432e7917a5c9c7b1b14f2ffa3f1988484c3e1a4e (patch) | |
tree | 83d05a0985494ee9170c23f13f5d905260f6c321 /engines/scumm/he | |
parent | 2558350d1ca96338ec5f409ecea9e25b3b672481 (diff) | |
download | scummvm-rg350-432e7917a5c9c7b1b14f2ffa3f1988484c3e1a4e.tar.gz scummvm-rg350-432e7917a5c9c7b1b14f2ffa3f1988484c3e1a4e.tar.bz2 scummvm-rg350-432e7917a5c9c7b1b14f2ffa3f1988484c3e1a4e.zip |
SCUMM: Switched opcode tables to use Common::Functor0 (a bit like Kyra does it)
svn-id: r39956
Diffstat (limited to 'engines/scumm/he')
-rw-r--r-- | engines/scumm/he/intern_he.h | 70 | ||||
-rw-r--r-- | engines/scumm/he/script_v100he.cpp | 655 | ||||
-rw-r--r-- | engines/scumm/he/script_v60he.cpp | 655 | ||||
-rw-r--r-- | engines/scumm/he/script_v70he.cpp | 655 | ||||
-rw-r--r-- | engines/scumm/he/script_v71he.cpp | 655 | ||||
-rw-r--r-- | engines/scumm/he/script_v72he.cpp | 655 | ||||
-rw-r--r-- | engines/scumm/he/script_v80he.cpp | 654 | ||||
-rw-r--r-- | engines/scumm/he/script_v90he.cpp | 655 |
8 files changed, 2248 insertions, 2406 deletions
diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h index dcc1740d0e..c2079fa5fe 100644 --- a/engines/scumm/he/intern_he.h +++ b/engines/scumm/he/intern_he.h @@ -26,7 +26,6 @@ #ifndef SCUMM_HE_INTERN_HE_H #define SCUMM_HE_INTERN_HE_H -#include "scumm/intern.h" #include "scumm/scumm_v6.h" #ifdef ENABLE_HE #include "scumm/he/floodfill_he.h" @@ -51,13 +50,6 @@ class CUP_Player; class ScummEngine_v60he : public ScummEngine_v6 { protected: - typedef void (ScummEngine_v60he::*OpcodeProcv60he)(); - struct OpcodeEntryv60he { - OpcodeProcv60he proc; - const char *desc; - }; - - const OpcodeEntryv60he *_opcodesv60he; public: Common::SeekableReadStream *_hInFileTable[17]; @@ -75,8 +67,6 @@ public: protected: virtual void setupOpcodes(); - virtual void executeOpcode(byte i); - virtual const char *getOpcodeDesc(byte i); virtual void saveOrLoad(Serializer *s); @@ -115,14 +105,6 @@ class ScummEngine_v70he : public ScummEngine_v60he { friend class ResExtractor; protected: - typedef void (ScummEngine_v70he::*OpcodeProcv70he)(); - struct OpcodeEntryv70he { - OpcodeProcv70he proc; - const char *desc; - }; - - const OpcodeEntryv70he *_opcodesv70he; - ResExtractor *_resExtractor; byte *_heV7RoomOffsets; @@ -140,8 +122,6 @@ public: protected: virtual void setupOpcodes(); - virtual void executeOpcode(byte i); - virtual const char *getOpcodeDesc(byte i); virtual void setupScummVars(); virtual void resetScummVars(); @@ -185,15 +165,8 @@ class ScummEngine_v71he : public ScummEngine_v70he { friend class Wiz; protected: - typedef void (ScummEngine_v71he::*OpcodeProcv71he)(); - struct OpcodeEntryv71he { - OpcodeProcv71he proc; - const char *desc; - }; - - const OpcodeEntryv71he *_opcodesv71he; - bool _skipProcessActors; + public: ScummEngine_v71he(OSystem *syst, const DetectorResult &dr); ~ScummEngine_v71he(); @@ -206,8 +179,6 @@ public: protected: virtual void setupOpcodes(); - virtual void executeOpcode(byte i); - virtual const char *getOpcodeDesc(byte i); virtual void saveOrLoad(Serializer *s); @@ -253,11 +224,6 @@ public: class ScummEngine_v72he : public ScummEngine_v71he { protected: - typedef void (ScummEngine_v72he::*OpcodeProcV72he)(); - struct OpcodeEntryV72he { - OpcodeProcV72he proc; - const char *desc; - }; #include "common/pack-start.h" // START STRUCT PACKING @@ -272,8 +238,6 @@ protected: #include "common/pack-end.h" // END STRUCT PACKING - const OpcodeEntryV72he *_opcodesV72he; - int _stringLength; byte _stringBuffer[4096]; @@ -286,8 +250,6 @@ public: protected: virtual void setupOpcodes(); - virtual void executeOpcode(byte i); - virtual const char *getOpcodeDesc(byte i); virtual void setupScummVars(); virtual void resetScummVars(); @@ -386,14 +348,6 @@ protected: class ScummEngine_v80he : public ScummEngine_v72he { protected: - typedef void (ScummEngine_v80he::*OpcodeProcV80he)(); - struct OpcodeEntryV80he { - OpcodeProcV80he proc; - const char *desc; - }; - - const OpcodeEntryV80he *_opcodesV80he; - int32 _heSndResId, _curSndId, _sndPtrOffs, _sndTmrOffs, _sndDataSize; public: @@ -401,8 +355,6 @@ public: protected: virtual void setupOpcodes(); - virtual void executeOpcode(byte i); - virtual const char *getOpcodeDesc(byte i); virtual void setupScummVars(); virtual void resetScummVars(); @@ -443,14 +395,6 @@ class ScummEngine_v90he : public ScummEngine_v80he { friend class Sprite; protected: - typedef void (ScummEngine_v90he::*OpcodeProcV90he)(); - struct OpcodeEntryV90he { - OpcodeProcV90he proc; - const char *desc; - }; - - const OpcodeEntryV90he *_opcodesV90he; - FloodFillParameters _floodFillParams; struct VideoParameters { @@ -481,8 +425,6 @@ public: protected: virtual void allocateArrays(); virtual void setupOpcodes(); - virtual void executeOpcode(byte i); - virtual const char *getOpcodeDesc(byte i); virtual void resetScumm(); @@ -596,16 +538,8 @@ protected: class ScummEngine_v100he : public ScummEngine_v99he { protected: - typedef void (ScummEngine_v100he::*OpcodeProcV100he)(); - struct OpcodeEntryV100he { - OpcodeProcV100he proc; - const char *desc; - }; - int32 _heResId, _heResType; - const OpcodeEntryV100he *_opcodesV100he; - byte _debugInputBuffer[256]; public: ScummEngine_v100he(OSystem *syst, const DetectorResult &dr) : ScummEngine_v99he(syst, dr) {} @@ -614,8 +548,6 @@ public: protected: virtual void setupOpcodes(); - virtual void executeOpcode(byte i); - virtual const char *getOpcodeDesc(byte i); virtual void saveOrLoad(Serializer *s); diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index 1df53a78fc..cd087fbd95 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -40,342 +40,329 @@ namespace Scumm { -#define OPCODE(x) _OPCODE(ScummEngine_v100he, x) +#define OPCODE(i, x) _opcodes[i]._OPCODE(ScummEngine_v100he, x) void ScummEngine_v100he::setupOpcodes() { - static const OpcodeEntryV100he opcodes[256] = { - /* 00 */ - OPCODE(o100_actorOps), - OPCODE(o6_add), - OPCODE(o6_faceActor), - OPCODE(o90_sortArray), - /* 04 */ - OPCODE(o100_arrayOps), - OPCODE(o6_band), - OPCODE(o6_bor), - OPCODE(o6_breakHere), - /* 08 */ - OPCODE(o6_delayFrames), - OPCODE(o90_shl), - OPCODE(o90_shr), - OPCODE(o90_xor), - /* 0C */ - OPCODE(o6_setCameraAt), - OPCODE(o6_actorFollowCamera), - OPCODE(o6_loadRoom), - OPCODE(o6_panCameraTo), - /* 10 */ - OPCODE(o72_captureWizImage), - OPCODE(o100_jumpToScript), - OPCODE(o6_setClass), - OPCODE(o60_closeFile), - /* 14 */ - OPCODE(o6_loadRoomWithEgo), - OPCODE(o6_invalid), - OPCODE(o72_createDirectory), - OPCODE(o100_createSound), - /* 18 */ - OPCODE(o6_cutscene), - OPCODE(o6_pop), - OPCODE(o72_traceStatus), - OPCODE(o6_wordVarDec), - /* 1C */ - OPCODE(o6_wordArrayDec), - OPCODE(o72_deleteFile), - OPCODE(o100_dim2dimArray), - OPCODE(o100_dimArray), - /* 20 */ - OPCODE(o6_div), - OPCODE(o6_animateActor), - OPCODE(o6_doSentence), - OPCODE(o6_drawBox), - /* 24 */ - OPCODE(o72_drawWizImage), - OPCODE(o80_drawWizPolygon), - OPCODE(o100_drawLine), - OPCODE(o100_drawObject), - /* 28 */ - OPCODE(o6_dup), - OPCODE(o90_dup_n), - OPCODE(o6_endCutscene), - OPCODE(o6_stopObjectCode), - /* 2C */ - OPCODE(o6_stopObjectCode), - OPCODE(o6_eq), - OPCODE(o100_floodFill), - OPCODE(o6_freezeUnfreeze), - /* 30 */ - OPCODE(o6_ge), - OPCODE(o6_getDateTime), - OPCODE(o100_setSpriteGroupInfo), - OPCODE(o6_gt), - /* 34 */ - OPCODE(o100_resourceRoutines), - OPCODE(o6_if), - OPCODE(o6_ifNot), - OPCODE(o100_wizImageOps), - /* 38 */ - OPCODE(o72_isAnyOf), - OPCODE(o6_wordVarInc), - OPCODE(o6_wordArrayInc), - OPCODE(o6_jump), - /* 3C */ - OPCODE(o90_kernelSetFunctions), - OPCODE(o6_land), - OPCODE(o6_le), - OPCODE(o60_localizeArrayToScript), - /* 40 */ - OPCODE(o6_wordArrayRead), - OPCODE(o6_wordArrayIndexedRead), - OPCODE(o6_lor), - OPCODE(o6_lt), - /* 44 */ - OPCODE(o90_mod), - OPCODE(o6_mul), - OPCODE(o6_neq), - OPCODE(o100_dim2dim2Array), - /* 48 */ - OPCODE(o6_invalid), - OPCODE(o100_redim2dimArray), - OPCODE(o6_not), - OPCODE(o6_invalid), - /* 4C */ - OPCODE(o6_beginOverride), - OPCODE(o6_endOverride), - OPCODE(o72_resetCutscene), - OPCODE(o6_setOwner), - /* 50 */ - OPCODE(o100_paletteOps), - OPCODE(o70_pickupObject), - OPCODE(o71_polygonOps), - OPCODE(o6_pop), - /* 54 */ - OPCODE(o6_printDebug), - OPCODE(o72_printWizImage), - OPCODE(o6_printLine), - OPCODE(o6_printSystem), - /* 58 */ - OPCODE(o6_printText), - OPCODE(o100_jumpToScriptUnk), - OPCODE(o100_startScriptUnk), - OPCODE(o6_pseudoRoom), - /* 5C */ - OPCODE(o6_pushByte), - OPCODE(o72_pushDWord), - OPCODE(o72_getScriptString), - OPCODE(o6_pushWord), - /* 60 */ - OPCODE(o6_pushWordVar), - OPCODE(o6_putActorAtObject), - OPCODE(o6_putActorAtXY), - OPCODE(o6_invalid), - /* 64 */ - OPCODE(o100_redimArray), - OPCODE(o72_rename), - OPCODE(o6_stopObjectCode), - OPCODE(o80_localizeArrayToRoom), - /* 68 */ - OPCODE(o100_roomOps), - OPCODE(o6_printActor), - OPCODE(o6_printEgo), - OPCODE(o72_talkActor), - /* 6C */ - OPCODE(o72_talkEgo), - OPCODE(o6_invalid), - OPCODE(o60_seekFilePos), - OPCODE(o6_setBoxFlags), - /* 70 */ - OPCODE(o6_invalid), - OPCODE(o6_setBoxSet), - OPCODE(o100_setSystemMessage), - OPCODE(o6_shuffle), - /* 74 */ - OPCODE(o6_delay), - OPCODE(o6_delayMinutes), - OPCODE(o6_delaySeconds), - OPCODE(o100_startSound), - /* 78 */ - OPCODE(o80_sourceDebug), - OPCODE(o100_setSpriteInfo), - OPCODE(o6_stampObject), - OPCODE(o72_startObject), - /* 7C */ - OPCODE(o100_startScript), - OPCODE(o6_startScriptQuick), - OPCODE(o80_setState), - OPCODE(o6_stopObjectScript), - /* 80 */ - OPCODE(o6_stopScript), - OPCODE(o6_stopSentence), - OPCODE(o6_stopSound), - OPCODE(o6_stopTalking), - /* 84 */ - OPCODE(o6_writeWordVar), - OPCODE(o6_wordArrayWrite), - OPCODE(o6_wordArrayIndexedWrite), - OPCODE(o6_sub), - /* 88 */ - OPCODE(o100_systemOps), - OPCODE(o6_invalid), - OPCODE(o72_setTimer), - OPCODE(o100_cursorCommand), - /* 8C */ - OPCODE(o100_videoOps), - OPCODE(o100_wait), - OPCODE(o6_walkActorToObj), - OPCODE(o6_walkActorTo), - /* 90 */ - OPCODE(o100_writeFile), - OPCODE(o72_writeINI), - OPCODE(o80_writeConfigFile), - OPCODE(o6_abs), - /* 94 */ - OPCODE(o6_getActorWalkBox), - OPCODE(o6_getActorCostume), - OPCODE(o6_getActorElevation), - OPCODE(o6_getObjectOldDir), - /* 98 */ - OPCODE(o6_getActorMoving), - OPCODE(o90_getActorData), - OPCODE(o6_getActorRoom), - OPCODE(o6_getActorScaleX), - /* 9C */ - OPCODE(o6_getAnimateVariable), - OPCODE(o6_getActorWidth), - OPCODE(o6_getObjectX), - OPCODE(o6_getObjectY), - /* A0 */ - OPCODE(o90_atan2), - OPCODE(o90_getSegmentAngle), - OPCODE(o90_getActorAnimProgress), - OPCODE(o90_getDistanceBetweenPoints), - /* A4 */ - OPCODE(o6_ifClassOfIs), - OPCODE(o6_invalid), - OPCODE(o90_cond), - OPCODE(o90_cos), - /* A8 */ - OPCODE(o100_debugInput), - OPCODE(o80_getFileSize), - OPCODE(o6_getActorFromXY), - OPCODE(o72_findAllObjects), - /* AC */ - OPCODE(o90_findAllObjectsWithClassOf), - OPCODE(o71_findBox), - OPCODE(o6_findInventory), - OPCODE(o72_findObject), - /* B0 */ - OPCODE(o72_findObjectWithClassOf), - OPCODE(o71_polygonHit), - OPCODE(o90_getLinesIntersectionPoint), - OPCODE(o90_fontUnk), - /* B4 */ - OPCODE(o72_getNumFreeArrays), - OPCODE(o72_getArrayDimSize), - OPCODE(o100_isResourceLoaded), - OPCODE(o100_getResourceSize), - /* B8 */ - OPCODE(o100_getSpriteGroupInfo), - OPCODE(o6_invalid), - OPCODE(o100_getWizData), - OPCODE(o6_isActorInBox), - /* BC */ - OPCODE(o6_isAnyOf), - OPCODE(o6_getInventoryCount), - OPCODE(o90_kernelGetFunctions), - OPCODE(o90_max), - /* C0 */ - OPCODE(o90_min), - OPCODE(o72_getObjectImageX), - OPCODE(o72_getObjectImageY), - OPCODE(o6_isRoomScriptRunning), - /* C4 */ - OPCODE(o90_getObjectData), - OPCODE(o72_openFile), - OPCODE(o90_getPolygonOverlap), - OPCODE(o6_getOwner), - /* C8 */ - OPCODE(o100_getPaletteData), - OPCODE(o6_pickOneOf), - OPCODE(o6_pickOneOfDefault), - OPCODE(o80_pickVarRandom), - /* CC */ - OPCODE(o72_getPixel), - OPCODE(o6_distObjectObject), - OPCODE(o6_distObjectPt), - OPCODE(o6_distPtPt), - /* D0 */ - OPCODE(o6_getRandomNumber), - OPCODE(o6_getRandomNumberRange), - OPCODE(o6_invalid), - OPCODE(o100_readFile), - /* D4 */ - OPCODE(o72_readINI), - OPCODE(o80_readConfigFile), - OPCODE(o6_isScriptRunning), - OPCODE(o90_sin), - /* D8 */ - OPCODE(o72_getSoundPosition), - OPCODE(o6_isSoundRunning), - OPCODE(o80_getSoundVar), - OPCODE(o100_getSpriteInfo), - /* DC */ - OPCODE(o90_sqrt), - OPCODE(o6_startObjectQuick), - OPCODE(o6_startScriptQuick2), - OPCODE(o6_getState), - /* E0 */ - OPCODE(o71_compareString), - OPCODE(o71_copyString), - OPCODE(o71_appendString), - OPCODE(o71_concatString), - /* E4 */ - OPCODE(o70_getStringLen), - OPCODE(o71_getStringLenForWidth), - OPCODE(o80_stringToInt), - OPCODE(o71_getCharIndexInString), - /* E8 */ - OPCODE(o71_getStringWidth), - OPCODE(o60_readFilePos), - OPCODE(o72_getTimer), - OPCODE(o6_getVerbEntrypoint), - /* EC */ - OPCODE(o100_getVideoData), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* F0 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* F4 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* F8 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* FC */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - }; - - _opcodesV100he = opcodes; -} - -void ScummEngine_v100he::executeOpcode(byte i) { - OpcodeProcV100he op = _opcodesV100he[i].proc; - (this->*op) (); -} - -const char *ScummEngine_v100he::getOpcodeDesc(byte i) { - return _opcodesV100he[i].desc; + /* 00 */ + OPCODE(0x00, o100_actorOps); + OPCODE(0x01, o6_add); + OPCODE(0x02, o6_faceActor); + OPCODE(0x03, o90_sortArray); + /* 04 */ + OPCODE(0x04, o100_arrayOps); + OPCODE(0x05, o6_band); + OPCODE(0x06, o6_bor); + OPCODE(0x07, o6_breakHere); + /* 08 */ + OPCODE(0x08, o6_delayFrames); + OPCODE(0x09, o90_shl); + OPCODE(0x0a, o90_shr); + OPCODE(0x0b, o90_xor); + /* 0C */ + OPCODE(0x0c, o6_setCameraAt); + OPCODE(0x0d, o6_actorFollowCamera); + OPCODE(0x0e, o6_loadRoom); + OPCODE(0x0f, o6_panCameraTo); + /* 10 */ + OPCODE(0x10, o72_captureWizImage); + OPCODE(0x11, o100_jumpToScript); + OPCODE(0x12, o6_setClass); + OPCODE(0x13, o60_closeFile); + /* 14 */ + OPCODE(0x14, o6_loadRoomWithEgo); + OPCODE(0x15, o6_invalid); + OPCODE(0x16, o72_createDirectory); + OPCODE(0x17, o100_createSound); + /* 18 */ + OPCODE(0x18, o6_cutscene); + OPCODE(0x19, o6_pop); + OPCODE(0x1a, o72_traceStatus); + OPCODE(0x1b, o6_wordVarDec); + /* 1C */ + OPCODE(0x1c, o6_wordArrayDec); + OPCODE(0x1d, o72_deleteFile); + OPCODE(0x1e, o100_dim2dimArray); + OPCODE(0x1f, o100_dimArray); + /* 20 */ + OPCODE(0x20, o6_div); + OPCODE(0x21, o6_animateActor); + OPCODE(0x22, o6_doSentence); + OPCODE(0x23, o6_drawBox); + /* 24 */ + OPCODE(0x24, o72_drawWizImage); + OPCODE(0x25, o80_drawWizPolygon); + OPCODE(0x26, o100_drawLine); + OPCODE(0x27, o100_drawObject); + /* 28 */ + OPCODE(0x28, o6_dup); + OPCODE(0x29, o90_dup_n); + OPCODE(0x2a, o6_endCutscene); + OPCODE(0x2b, o6_stopObjectCode); + /* 2C */ + OPCODE(0x2c, o6_stopObjectCode); + OPCODE(0x2d, o6_eq); + OPCODE(0x2e, o100_floodFill); + OPCODE(0x2f, o6_freezeUnfreeze); + /* 30 */ + OPCODE(0x30, o6_ge); + OPCODE(0x31, o6_getDateTime); + OPCODE(0x32, o100_setSpriteGroupInfo); + OPCODE(0x33, o6_gt); + /* 34 */ + OPCODE(0x34, o100_resourceRoutines); + OPCODE(0x35, o6_if); + OPCODE(0x36, o6_ifNot); + OPCODE(0x37, o100_wizImageOps); + /* 38 */ + OPCODE(0x38, o72_isAnyOf); + OPCODE(0x39, o6_wordVarInc); + OPCODE(0x3a, o6_wordArrayInc); + OPCODE(0x3b, o6_jump); + /* 3C */ + OPCODE(0x3c, o90_kernelSetFunctions); + OPCODE(0x3d, o6_land); + OPCODE(0x3e, o6_le); + OPCODE(0x3f, o60_localizeArrayToScript); + /* 40 */ + OPCODE(0x40, o6_wordArrayRead); + OPCODE(0x41, o6_wordArrayIndexedRead); + OPCODE(0x42, o6_lor); + OPCODE(0x43, o6_lt); + /* 44 */ + OPCODE(0x44, o90_mod); + OPCODE(0x45, o6_mul); + OPCODE(0x46, o6_neq); + OPCODE(0x47, o100_dim2dim2Array); + /* 48 */ + OPCODE(0x48, o6_invalid); + OPCODE(0x49, o100_redim2dimArray); + OPCODE(0x4a, o6_not); + OPCODE(0x4b, o6_invalid); + /* 4C */ + OPCODE(0x4c, o6_beginOverride); + OPCODE(0x4d, o6_endOverride); + OPCODE(0x4e, o72_resetCutscene); + OPCODE(0x4f, o6_setOwner); + /* 50 */ + OPCODE(0x50, o100_paletteOps); + OPCODE(0x51, o70_pickupObject); + OPCODE(0x52, o71_polygonOps); + OPCODE(0x53, o6_pop); + /* 54 */ + OPCODE(0x54, o6_printDebug); + OPCODE(0x55, o72_printWizImage); + OPCODE(0x56, o6_printLine); + OPCODE(0x57, o6_printSystem); + /* 58 */ + OPCODE(0x58, o6_printText); + OPCODE(0x59, o100_jumpToScriptUnk); + OPCODE(0x5a, o100_startScriptUnk); + OPCODE(0x5b, o6_pseudoRoom); + /* 5C */ + OPCODE(0x5c, o6_pushByte); + OPCODE(0x5d, o72_pushDWord); + OPCODE(0x5e, o72_getScriptString); + OPCODE(0x5f, o6_pushWord); + /* 60 */ + OPCODE(0x60, o6_pushWordVar); + OPCODE(0x61, o6_putActorAtObject); + OPCODE(0x62, o6_putActorAtXY); + OPCODE(0x63, o6_invalid); + /* 64 */ + OPCODE(0x64, o100_redimArray); + OPCODE(0x65, o72_rename); + OPCODE(0x66, o6_stopObjectCode); + OPCODE(0x67, o80_localizeArrayToRoom); + /* 68 */ + OPCODE(0x68, o100_roomOps); + OPCODE(0x69, o6_printActor); + OPCODE(0x6a, o6_printEgo); + OPCODE(0x6b, o72_talkActor); + /* 6C */ + OPCODE(0x6c, o72_talkEgo); + OPCODE(0x6d, o6_invalid); + OPCODE(0x6e, o60_seekFilePos); + OPCODE(0x6f, o6_setBoxFlags); + /* 70 */ + OPCODE(0x70, o6_invalid); + OPCODE(0x71, o6_setBoxSet); + OPCODE(0x72, o100_setSystemMessage); + OPCODE(0x73, o6_shuffle); + /* 74 */ + OPCODE(0x74, o6_delay); + OPCODE(0x75, o6_delayMinutes); + OPCODE(0x76, o6_delaySeconds); + OPCODE(0x77, o100_startSound); + /* 78 */ + OPCODE(0x78, o80_sourceDebug); + OPCODE(0x79, o100_setSpriteInfo); + OPCODE(0x7a, o6_stampObject); + OPCODE(0x7b, o72_startObject); + /* 7C */ + OPCODE(0x7c, o100_startScript); + OPCODE(0x7d, o6_startScriptQuick); + OPCODE(0x7e, o80_setState); + OPCODE(0x7f, o6_stopObjectScript); + /* 80 */ + OPCODE(0x80, o6_stopScript); + OPCODE(0x81, o6_stopSentence); + OPCODE(0x82, o6_stopSound); + OPCODE(0x83, o6_stopTalking); + /* 84 */ + OPCODE(0x84, o6_writeWordVar); + OPCODE(0x85, o6_wordArrayWrite); + OPCODE(0x86, o6_wordArrayIndexedWrite); + OPCODE(0x87, o6_sub); + /* 88 */ + OPCODE(0x88, o100_systemOps); + OPCODE(0x89, o6_invalid); + OPCODE(0x8a, o72_setTimer); + OPCODE(0x8b, o100_cursorCommand); + /* 8C */ + OPCODE(0x8c, o100_videoOps); + OPCODE(0x8d, o100_wait); + OPCODE(0x8e, o6_walkActorToObj); + OPCODE(0x8f, o6_walkActorTo); + /* 90 */ + OPCODE(0x90, o100_writeFile); + OPCODE(0x91, o72_writeINI); + OPCODE(0x92, o80_writeConfigFile); + OPCODE(0x93, o6_abs); + /* 94 */ + OPCODE(0x94, o6_getActorWalkBox); + OPCODE(0x95, o6_getActorCostume); + OPCODE(0x96, o6_getActorElevation); + OPCODE(0x97, o6_getObjectOldDir); + /* 98 */ + OPCODE(0x98, o6_getActorMoving); + OPCODE(0x99, o90_getActorData); + OPCODE(0x9a, o6_getActorRoom); + OPCODE(0x9b, o6_getActorScaleX); + /* 9C */ + OPCODE(0x9c, o6_getAnimateVariable); + OPCODE(0x9d, o6_getActorWidth); + OPCODE(0x9e, o6_getObjectX); + OPCODE(0x9f, o6_getObjectY); + /* A0 */ + OPCODE(0xa0, o90_atan2); + OPCODE(0xa1, o90_getSegmentAngle); + OPCODE(0xa2, o90_getActorAnimProgress); + OPCODE(0xa3, o90_getDistanceBetweenPoints); + /* A4 */ + OPCODE(0xa4, o6_ifClassOfIs); + OPCODE(0xa5, o6_invalid); + OPCODE(0xa6, o90_cond); + OPCODE(0xa7, o90_cos); + /* A8 */ + OPCODE(0xa8, o100_debugInput); + OPCODE(0xa9, o80_getFileSize); + OPCODE(0xaa, o6_getActorFromXY); + OPCODE(0xab, o72_findAllObjects); + /* AC */ + OPCODE(0xac, o90_findAllObjectsWithClassOf); + OPCODE(0xad, o71_findBox); + OPCODE(0xae, o6_findInventory); + OPCODE(0xaf, o72_findObject); + /* B0 */ + OPCODE(0xb0, o72_findObjectWithClassOf); + OPCODE(0xb1, o71_polygonHit); + OPCODE(0xb2, o90_getLinesIntersectionPoint); + OPCODE(0xb3, o90_fontUnk); + /* B4 */ + OPCODE(0xb4, o72_getNumFreeArrays); + OPCODE(0xb5, o72_getArrayDimSize); + OPCODE(0xb6, o100_isResourceLoaded); + OPCODE(0xb7, o100_getResourceSize); + /* B8 */ + OPCODE(0xb8, o100_getSpriteGroupInfo); + OPCODE(0xb9, o6_invalid); + OPCODE(0xba, o100_getWizData); + OPCODE(0xbb, o6_isActorInBox); + /* BC */ + OPCODE(0xbc, o6_isAnyOf); + OPCODE(0xbd, o6_getInventoryCount); + OPCODE(0xbe, o90_kernelGetFunctions); + OPCODE(0xbf, o90_max); + /* C0 */ + OPCODE(0xc0, o90_min); + OPCODE(0xc1, o72_getObjectImageX); + OPCODE(0xc2, o72_getObjectImageY); + OPCODE(0xc3, o6_isRoomScriptRunning); + /* C4 */ + OPCODE(0xc4, o90_getObjectData); + OPCODE(0xc5, o72_openFile); + OPCODE(0xc6, o90_getPolygonOverlap); + OPCODE(0xc7, o6_getOwner); + /* C8 */ + OPCODE(0xc8, o100_getPaletteData); + OPCODE(0xc9, o6_pickOneOf); + OPCODE(0xca, o6_pickOneOfDefault); + OPCODE(0xcb, o80_pickVarRandom); + /* CC */ + OPCODE(0xcc, o72_getPixel); + OPCODE(0xcd, o6_distObjectObject); + OPCODE(0xce, o6_distObjectPt); + OPCODE(0xcf, o6_distPtPt); + /* D0 */ + OPCODE(0xd0, o6_getRandomNumber); + OPCODE(0xd1, o6_getRandomNumberRange); + OPCODE(0xd2, o6_invalid); + OPCODE(0xd3, o100_readFile); + /* D4 */ + OPCODE(0xd4, o72_readINI); + OPCODE(0xd5, o80_readConfigFile); + OPCODE(0xd6, o6_isScriptRunning); + OPCODE(0xd7, o90_sin); + /* D8 */ + OPCODE(0xd8, o72_getSoundPosition); + OPCODE(0xd9, o6_isSoundRunning); + OPCODE(0xda, o80_getSoundVar); + OPCODE(0xdb, o100_getSpriteInfo); + /* DC */ + OPCODE(0xdc, o90_sqrt); + OPCODE(0xdd, o6_startObjectQuick); + OPCODE(0xde, o6_startScriptQuick2); + OPCODE(0xdf, o6_getState); + /* E0 */ + OPCODE(0xe0, o71_compareString); + OPCODE(0xe1, o71_copyString); + OPCODE(0xe2, o71_appendString); + OPCODE(0xe3, o71_concatString); + /* E4 */ + OPCODE(0xe4, o70_getStringLen); + OPCODE(0xe5, o71_getStringLenForWidth); + OPCODE(0xe6, o80_stringToInt); + OPCODE(0xe7, o71_getCharIndexInString); + /* E8 */ + OPCODE(0xe8, o71_getStringWidth); + OPCODE(0xe9, o60_readFilePos); + OPCODE(0xea, o72_getTimer); + OPCODE(0xeb, o6_getVerbEntrypoint); + /* EC */ + OPCODE(0xec, o100_getVideoData); + OPCODE(0xed, o6_invalid); + OPCODE(0xee, o6_invalid); + OPCODE(0xef, o6_invalid); + /* F0 */ + OPCODE(0xf0, o6_invalid); + OPCODE(0xf1, o6_invalid); + OPCODE(0xf2, o6_invalid); + OPCODE(0xf3, o6_invalid); + /* F4 */ + OPCODE(0xf4, o6_invalid); + OPCODE(0xf5, o6_invalid); + OPCODE(0xf6, o6_invalid); + OPCODE(0xf7, o6_invalid); + /* F8 */ + OPCODE(0xf8, o6_invalid); + OPCODE(0xf9, o6_invalid); + OPCODE(0xfa, o6_invalid); + OPCODE(0xfb, o6_invalid); + /* FC */ + OPCODE(0xfc, o6_invalid); + OPCODE(0xfd, o6_invalid); + OPCODE(0xfe, o6_invalid); + OPCODE(0xff, o6_invalid); } void ScummEngine_v100he::o100_actorOps() { diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp index 86ce492033..a7c389d831 100644 --- a/engines/scumm/he/script_v60he.cpp +++ b/engines/scumm/he/script_v60he.cpp @@ -63,342 +63,329 @@ static int virtScreenSavePack(byte *dst, byte *src, int len, int unk); // transparency in akos.cpp // negative size in file read/write -#define OPCODE(x) _OPCODE(ScummEngine_v60he, x) +#define OPCODE(i, x) _opcodes[i]._OPCODE(ScummEngine_v60he, x) void ScummEngine_v60he::setupOpcodes() { - static const OpcodeEntryv60he opcodes[256] = { - /* 00 */ - OPCODE(o6_pushByte), - OPCODE(o6_pushWord), - OPCODE(o6_pushByteVar), - OPCODE(o6_pushWordVar), - /* 04 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayRead), - OPCODE(o6_wordArrayRead), - /* 08 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayIndexedRead), - OPCODE(o6_wordArrayIndexedRead), - /* 0C */ - OPCODE(o6_dup), - OPCODE(o6_not), - OPCODE(o6_eq), - OPCODE(o6_neq), - /* 10 */ - OPCODE(o6_gt), - OPCODE(o6_lt), - OPCODE(o6_le), - OPCODE(o6_ge), - /* 14 */ - OPCODE(o6_add), - OPCODE(o6_sub), - OPCODE(o6_mul), - OPCODE(o6_div), - /* 18 */ - OPCODE(o6_land), - OPCODE(o6_lor), - OPCODE(o6_pop), - OPCODE(o6_invalid), - /* 1C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 20 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 24 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 28 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 2C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 30 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 34 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 38 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 3C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 40 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_writeByteVar), - OPCODE(o6_writeWordVar), - /* 44 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayWrite), - OPCODE(o6_wordArrayWrite), - /* 48 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayIndexedWrite), - OPCODE(o6_wordArrayIndexedWrite), - /* 4C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteVarInc), - OPCODE(o6_wordVarInc), - /* 50 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayInc), - OPCODE(o6_wordArrayInc), - /* 54 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteVarDec), - OPCODE(o6_wordVarDec), - /* 58 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayDec), - OPCODE(o6_wordArrayDec), - /* 5C */ - OPCODE(o6_if), - OPCODE(o6_ifNot), - OPCODE(o6_startScript), - OPCODE(o6_startScriptQuick), - /* 60 */ - OPCODE(o6_startObject), - OPCODE(o6_drawObject), - OPCODE(o6_drawObjectAt), - OPCODE(o6_invalid), - /* 64 */ - OPCODE(o6_invalid), - OPCODE(o6_stopObjectCode), - OPCODE(o6_stopObjectCode), - OPCODE(o6_endCutscene), - /* 68 */ - OPCODE(o6_cutscene), - OPCODE(o6_stopMusic), - OPCODE(o6_freezeUnfreeze), - OPCODE(o6_cursorCommand), - /* 6C */ - OPCODE(o6_breakHere), - OPCODE(o6_ifClassOfIs), - OPCODE(o6_setClass), - OPCODE(o6_getState), - /* 70 */ - OPCODE(o60_setState), - OPCODE(o6_setOwner), - OPCODE(o6_getOwner), - OPCODE(o6_jump), - /* 74 */ - OPCODE(o6_startSound), - OPCODE(o6_stopSound), - OPCODE(o6_startMusic), - OPCODE(o6_stopObjectScript), - /* 78 */ - OPCODE(o6_panCameraTo), - OPCODE(o6_actorFollowCamera), - OPCODE(o6_setCameraAt), - OPCODE(o6_loadRoom), - /* 7C */ - OPCODE(o6_stopScript), - OPCODE(o6_walkActorToObj), - OPCODE(o6_walkActorTo), - OPCODE(o6_putActorAtXY), - /* 80 */ - OPCODE(o6_putActorAtObject), - OPCODE(o6_faceActor), - OPCODE(o6_animateActor), - OPCODE(o6_doSentence), - /* 84 */ - OPCODE(o6_pickupObject), - OPCODE(o6_loadRoomWithEgo), - OPCODE(o6_invalid), - OPCODE(o6_getRandomNumber), - /* 88 */ - OPCODE(o6_getRandomNumberRange), - OPCODE(o6_invalid), - OPCODE(o6_getActorMoving), - OPCODE(o6_isScriptRunning), - /* 8C */ - OPCODE(o6_getActorRoom), - OPCODE(o6_getObjectX), - OPCODE(o6_getObjectY), - OPCODE(o6_getObjectOldDir), - /* 90 */ - OPCODE(o6_getActorWalkBox), - OPCODE(o6_getActorCostume), - OPCODE(o6_findInventory), - OPCODE(o6_getInventoryCount), - /* 94 */ - OPCODE(o6_getVerbFromXY), - OPCODE(o6_beginOverride), - OPCODE(o6_endOverride), - OPCODE(o6_setObjectName), - /* 98 */ - OPCODE(o6_isSoundRunning), - OPCODE(o6_setBoxFlags), - OPCODE(o6_invalid), - OPCODE(o6_resourceRoutines), - /* 9C */ - OPCODE(o60_roomOps), - OPCODE(o60_actorOps), - OPCODE(o6_verbOps), - OPCODE(o6_getActorFromXY), - /* A0 */ - OPCODE(o6_findObject), - OPCODE(o6_pseudoRoom), - OPCODE(o6_getActorElevation), - OPCODE(o6_getVerbEntrypoint), - /* A4 */ - OPCODE(o6_arrayOps), - OPCODE(o6_saveRestoreVerbs), - OPCODE(o6_drawBox), - OPCODE(o6_pop), - /* A8 */ - OPCODE(o6_getActorWidth), - OPCODE(o6_wait), - OPCODE(o6_getActorScaleX), - OPCODE(o6_getActorAnimCounter), - /* AC */ - OPCODE(o6_invalid), - OPCODE(o6_isAnyOf), - OPCODE(o6_systemOps), - OPCODE(o6_isActorInBox), - /* B0 */ - OPCODE(o6_delay), - OPCODE(o6_delaySeconds), - OPCODE(o6_delayMinutes), - OPCODE(o6_stopSentence), - /* B4 */ - OPCODE(o6_printLine), - OPCODE(o6_printText), - OPCODE(o6_printDebug), - OPCODE(o6_printSystem), - /* B8 */ - OPCODE(o6_printActor), - OPCODE(o6_printEgo), - OPCODE(o6_talkActor), - OPCODE(o6_talkEgo), - /* BC */ - OPCODE(o6_dimArray), - OPCODE(o6_stopObjectCode), - OPCODE(o6_startObjectQuick), - OPCODE(o6_startScriptQuick2), - /* C0 */ - OPCODE(o6_dim2dimArray), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* C4 */ - OPCODE(o6_abs), - OPCODE(o6_distObjectObject), - OPCODE(o6_distObjectPt), - OPCODE(o6_distPtPt), - /* C8 */ - OPCODE(o60_kernelGetFunctions), - OPCODE(o60_kernelSetFunctions), - OPCODE(o6_delayFrames), - OPCODE(o6_pickOneOf), - /* CC */ - OPCODE(o6_pickOneOfDefault), - OPCODE(o6_stampObject), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* D0 */ - OPCODE(o6_getDateTime), - OPCODE(o6_stopTalking), - OPCODE(o6_getAnimateVariable), - OPCODE(o6_invalid), - /* D4 */ - OPCODE(o6_shuffle), - OPCODE(o6_jumpToScript), - OPCODE(o6_band), - OPCODE(o6_bor), - /* D8 */ - OPCODE(o6_isRoomScriptRunning), - OPCODE(o60_closeFile), - OPCODE(o60_openFile), - OPCODE(o60_readFile), - /* DC */ - OPCODE(o60_writeFile), - OPCODE(o6_findAllObjects), - OPCODE(o60_deleteFile), - OPCODE(o60_rename), - /* E0 */ - OPCODE(o60_soundOps), - OPCODE(o6_getPixel), - OPCODE(o60_localizeArrayToScript), - OPCODE(o6_pickVarRandom), - /* E4 */ - OPCODE(o6_setBoxSet), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* E8 */ - OPCODE(o6_invalid), - OPCODE(o60_seekFilePos), - OPCODE(o60_redimArray), - OPCODE(o60_readFilePos), - /* EC */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* F0 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* F4 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* F8 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* FC */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - }; - - _opcodesv60he = opcodes; -} - -void ScummEngine_v60he::executeOpcode(byte i) { - OpcodeProcv60he op = _opcodesv60he[i].proc; - (this->*op) (); -} - -const char *ScummEngine_v60he::getOpcodeDesc(byte i) { - return _opcodesv60he[i].desc; + /* 00 */ + OPCODE(0x00, o6_pushByte); + OPCODE(0x01, o6_pushWord); + OPCODE(0x02, o6_pushByteVar); + OPCODE(0x03, o6_pushWordVar); + /* 04 */ + OPCODE(0x04, o6_invalid); + OPCODE(0x05, o6_invalid); + OPCODE(0x06, o6_byteArrayRead); + OPCODE(0x07, o6_wordArrayRead); + /* 08 */ + OPCODE(0x08, o6_invalid); + OPCODE(0x09, o6_invalid); + OPCODE(0x0a, o6_byteArrayIndexedRead); + OPCODE(0x0b, o6_wordArrayIndexedRead); + /* 0C */ + OPCODE(0x0c, o6_dup); + OPCODE(0x0d, o6_not); + OPCODE(0x0e, o6_eq); + OPCODE(0x0f, o6_neq); + /* 10 */ + OPCODE(0x10, o6_gt); + OPCODE(0x11, o6_lt); + OPCODE(0x12, o6_le); + OPCODE(0x13, o6_ge); + /* 14 */ + OPCODE(0x14, o6_add); + OPCODE(0x15, o6_sub); + OPCODE(0x16, o6_mul); + OPCODE(0x17, o6_div); + /* 18 */ + OPCODE(0x18, o6_land); + OPCODE(0x19, o6_lor); + OPCODE(0x1a, o6_pop); + OPCODE(0x1b, o6_invalid); + /* 1C */ + OPCODE(0x1c, o6_invalid); + OPCODE(0x1d, o6_invalid); + OPCODE(0x1e, o6_invalid); + OPCODE(0x1f, o6_invalid); + /* 20 */ + OPCODE(0x20, o6_invalid); + OPCODE(0x21, o6_invalid); + OPCODE(0x22, o6_invalid); + OPCODE(0x23, o6_invalid); + /* 24 */ + OPCODE(0x24, o6_invalid); + OPCODE(0x25, o6_invalid); + OPCODE(0x26, o6_invalid); + OPCODE(0x27, o6_invalid); + /* 28 */ + OPCODE(0x28, o6_invalid); + OPCODE(0x29, o6_invalid); + OPCODE(0x2a, o6_invalid); + OPCODE(0x2b, o6_invalid); + /* 2C */ + OPCODE(0x2c, o6_invalid); + OPCODE(0x2d, o6_invalid); + OPCODE(0x2e, o6_invalid); + OPCODE(0x2f, o6_invalid); + /* 30 */ + OPCODE(0x30, o6_invalid); + OPCODE(0x31, o6_invalid); + OPCODE(0x32, o6_invalid); + OPCODE(0x33, o6_invalid); + /* 34 */ + OPCODE(0x34, o6_invalid); + OPCODE(0x35, o6_invalid); + OPCODE(0x36, o6_invalid); + OPCODE(0x37, o6_invalid); + /* 38 */ + OPCODE(0x38, o6_invalid); + OPCODE(0x39, o6_invalid); + OPCODE(0x3a, o6_invalid); + OPCODE(0x3b, o6_invalid); + /* 3C */ + OPCODE(0x3c, o6_invalid); + OPCODE(0x3d, o6_invalid); + OPCODE(0x3e, o6_invalid); + OPCODE(0x3f, o6_invalid); + /* 40 */ + OPCODE(0x40, o6_invalid); + OPCODE(0x41, o6_invalid); + OPCODE(0x42, o6_writeByteVar); + OPCODE(0x43, o6_writeWordVar); + /* 44 */ + OPCODE(0x44, o6_invalid); + OPCODE(0x45, o6_invalid); + OPCODE(0x46, o6_byteArrayWrite); + OPCODE(0x47, o6_wordArrayWrite); + /* 48 */ + OPCODE(0x48, o6_invalid); + OPCODE(0x49, o6_invalid); + OPCODE(0x4a, o6_byteArrayIndexedWrite); + OPCODE(0x4b, o6_wordArrayIndexedWrite); + /* 4C */ + OPCODE(0x4c, o6_invalid); + OPCODE(0x4d, o6_invalid); + OPCODE(0x4e, o6_byteVarInc); + OPCODE(0x4f, o6_wordVarInc); + /* 50 */ + OPCODE(0x50, o6_invalid); + OPCODE(0x51, o6_invalid); + OPCODE(0x52, o6_byteArrayInc); + OPCODE(0x53, o6_wordArrayInc); + /* 54 */ + OPCODE(0x54, o6_invalid); + OPCODE(0x55, o6_invalid); + OPCODE(0x56, o6_byteVarDec); + OPCODE(0x57, o6_wordVarDec); + /* 58 */ + OPCODE(0x58, o6_invalid); + OPCODE(0x59, o6_invalid); + OPCODE(0x5a, o6_byteArrayDec); + OPCODE(0x5b, o6_wordArrayDec); + /* 5C */ + OPCODE(0x5c, o6_if); + OPCODE(0x5d, o6_ifNot); + OPCODE(0x5e, o6_startScript); + OPCODE(0x5f, o6_startScriptQuick); + /* 60 */ + OPCODE(0x60, o6_startObject); + OPCODE(0x61, o6_drawObject); + OPCODE(0x62, o6_drawObjectAt); + OPCODE(0x63, o6_invalid); + /* 64 */ + OPCODE(0x64, o6_invalid); + OPCODE(0x65, o6_stopObjectCode); + OPCODE(0x66, o6_stopObjectCode); + OPCODE(0x67, o6_endCutscene); + /* 68 */ + OPCODE(0x68, o6_cutscene); + OPCODE(0x69, o6_stopMusic); + OPCODE(0x6a, o6_freezeUnfreeze); + OPCODE(0x6b, o6_cursorCommand); + /* 6C */ + OPCODE(0x6c, o6_breakHere); + OPCODE(0x6d, o6_ifClassOfIs); + OPCODE(0x6e, o6_setClass); + OPCODE(0x6f, o6_getState); + /* 70 */ + OPCODE(0x70, o60_setState); + OPCODE(0x71, o6_setOwner); + OPCODE(0x72, o6_getOwner); + OPCODE(0x73, o6_jump); + /* 74 */ + OPCODE(0x74, o6_startSound); + OPCODE(0x75, o6_stopSound); + OPCODE(0x76, o6_startMusic); + OPCODE(0x77, o6_stopObjectScript); + /* 78 */ + OPCODE(0x78, o6_panCameraTo); + OPCODE(0x79, o6_actorFollowCamera); + OPCODE(0x7a, o6_setCameraAt); + OPCODE(0x7b, o6_loadRoom); + /* 7C */ + OPCODE(0x7c, o6_stopScript); + OPCODE(0x7d, o6_walkActorToObj); + OPCODE(0x7e, o6_walkActorTo); + OPCODE(0x7f, o6_putActorAtXY); + /* 80 */ + OPCODE(0x80, o6_putActorAtObject); + OPCODE(0x81, o6_faceActor); + OPCODE(0x82, o6_animateActor); + OPCODE(0x83, o6_doSentence); + /* 84 */ + OPCODE(0x84, o6_pickupObject); + OPCODE(0x85, o6_loadRoomWithEgo); + OPCODE(0x86, o6_invalid); + OPCODE(0x87, o6_getRandomNumber); + /* 88 */ + OPCODE(0x88, o6_getRandomNumberRange); + OPCODE(0x89, o6_invalid); + OPCODE(0x8a, o6_getActorMoving); + OPCODE(0x8b, o6_isScriptRunning); + /* 8C */ + OPCODE(0x8c, o6_getActorRoom); + OPCODE(0x8d, o6_getObjectX); + OPCODE(0x8e, o6_getObjectY); + OPCODE(0x8f, o6_getObjectOldDir); + /* 90 */ + OPCODE(0x90, o6_getActorWalkBox); + OPCODE(0x91, o6_getActorCostume); + OPCODE(0x92, o6_findInventory); + OPCODE(0x93, o6_getInventoryCount); + /* 94 */ + OPCODE(0x94, o6_getVerbFromXY); + OPCODE(0x95, o6_beginOverride); + OPCODE(0x96, o6_endOverride); + OPCODE(0x97, o6_setObjectName); + /* 98 */ + OPCODE(0x98, o6_isSoundRunning); + OPCODE(0x99, o6_setBoxFlags); + OPCODE(0x9a, o6_invalid); + OPCODE(0x9b, o6_resourceRoutines); + /* 9C */ + OPCODE(0x9c, o60_roomOps); + OPCODE(0x9d, o60_actorOps); + OPCODE(0x9e, o6_verbOps); + OPCODE(0x9f, o6_getActorFromXY); + /* A0 */ + OPCODE(0xa0, o6_findObject); + OPCODE(0xa1, o6_pseudoRoom); + OPCODE(0xa2, o6_getActorElevation); + OPCODE(0xa3, o6_getVerbEntrypoint); + /* A4 */ + OPCODE(0xa4, o6_arrayOps); + OPCODE(0xa5, o6_saveRestoreVerbs); + OPCODE(0xa6, o6_drawBox); + OPCODE(0xa7, o6_pop); + /* A8 */ + OPCODE(0xa8, o6_getActorWidth); + OPCODE(0xa9, o6_wait); + OPCODE(0xaa, o6_getActorScaleX); + OPCODE(0xab, o6_getActorAnimCounter); + /* AC */ + OPCODE(0xac, o6_invalid); + OPCODE(0xad, o6_isAnyOf); + OPCODE(0xae, o6_systemOps); + OPCODE(0xaf, o6_isActorInBox); + /* B0 */ + OPCODE(0xb0, o6_delay); + OPCODE(0xb1, o6_delaySeconds); + OPCODE(0xb2, o6_delayMinutes); + OPCODE(0xb3, o6_stopSentence); + /* B4 */ + OPCODE(0xb4, o6_printLine); + OPCODE(0xb5, o6_printText); + OPCODE(0xb6, o6_printDebug); + OPCODE(0xb7, o6_printSystem); + /* B8 */ + OPCODE(0xb8, o6_printActor); + OPCODE(0xb9, o6_printEgo); + OPCODE(0xba, o6_talkActor); + OPCODE(0xbb, o6_talkEgo); + /* BC */ + OPCODE(0xbc, o6_dimArray); + OPCODE(0xbd, o6_stopObjectCode); + OPCODE(0xbe, o6_startObjectQuick); + OPCODE(0xbf, o6_startScriptQuick2); + /* C0 */ + OPCODE(0xc0, o6_dim2dimArray); + OPCODE(0xc1, o6_invalid); + OPCODE(0xc2, o6_invalid); + OPCODE(0xc3, o6_invalid); + /* C4 */ + OPCODE(0xc4, o6_abs); + OPCODE(0xc5, o6_distObjectObject); + OPCODE(0xc6, o6_distObjectPt); + OPCODE(0xc7, o6_distPtPt); + /* C8 */ + OPCODE(0xc8, o60_kernelGetFunctions); + OPCODE(0xc9, o60_kernelSetFunctions); + OPCODE(0xca, o6_delayFrames); + OPCODE(0xcb, o6_pickOneOf); + /* CC */ + OPCODE(0xcc, o6_pickOneOfDefault); + OPCODE(0xcd, o6_stampObject); + OPCODE(0xce, o6_invalid); + OPCODE(0xcf, o6_invalid); + /* D0 */ + OPCODE(0xd0, o6_getDateTime); + OPCODE(0xd1, o6_stopTalking); + OPCODE(0xd2, o6_getAnimateVariable); + OPCODE(0xd3, o6_invalid); + /* D4 */ + OPCODE(0xd4, o6_shuffle); + OPCODE(0xd5, o6_jumpToScript); + OPCODE(0xd6, o6_band); + OPCODE(0xd7, o6_bor); + /* D8 */ + OPCODE(0xd8, o6_isRoomScriptRunning); + OPCODE(0xd9, o60_closeFile); + OPCODE(0xda, o60_openFile); + OPCODE(0xdb, o60_readFile); + /* DC */ + OPCODE(0xdc, o60_writeFile); + OPCODE(0xdd, o6_findAllObjects); + OPCODE(0xde, o60_deleteFile); + OPCODE(0xdf, o60_rename); + /* E0 */ + OPCODE(0xe0, o60_soundOps); + OPCODE(0xe1, o6_getPixel); + OPCODE(0xe2, o60_localizeArrayToScript); + OPCODE(0xe3, o6_pickVarRandom); + /* E4 */ + OPCODE(0xe4, o6_setBoxSet); + OPCODE(0xe5, o6_invalid); + OPCODE(0xe6, o6_invalid); + OPCODE(0xe7, o6_invalid); + /* E8 */ + OPCODE(0xe8, o6_invalid); + OPCODE(0xe9, o60_seekFilePos); + OPCODE(0xea, o60_redimArray); + OPCODE(0xeb, o60_readFilePos); + /* EC */ + OPCODE(0xec, o6_invalid); + OPCODE(0xed, o6_invalid); + OPCODE(0xee, o6_invalid); + OPCODE(0xef, o6_invalid); + /* F0 */ + OPCODE(0xf0, o6_invalid); + OPCODE(0xf1, o6_invalid); + OPCODE(0xf2, o6_invalid); + OPCODE(0xf3, o6_invalid); + /* F4 */ + OPCODE(0xf4, o6_invalid); + OPCODE(0xf5, o6_invalid); + OPCODE(0xf6, o6_invalid); + OPCODE(0xf7, o6_invalid); + /* F8 */ + OPCODE(0xf8, o6_invalid); + OPCODE(0xf9, o6_invalid); + OPCODE(0xfa, o6_invalid); + OPCODE(0xfb, o6_invalid); + /* FC */ + OPCODE(0xfc, o6_invalid); + OPCODE(0xfd, o6_invalid); + OPCODE(0xfe, o6_invalid); + OPCODE(0xff, o6_invalid); } int ScummEngine_v60he::convertFilePath(byte *dst) { diff --git a/engines/scumm/he/script_v70he.cpp b/engines/scumm/he/script_v70he.cpp index 577e7c3d99..36c29f28e5 100644 --- a/engines/scumm/he/script_v70he.cpp +++ b/engines/scumm/he/script_v70he.cpp @@ -38,342 +38,329 @@ namespace Scumm { -#define OPCODE(x) _OPCODE(ScummEngine_v70he, x) +#define OPCODE(i, x) _opcodes[i]._OPCODE(ScummEngine_v70he, x) void ScummEngine_v70he::setupOpcodes() { - static const OpcodeEntryv70he opcodes[256] = { - /* 00 */ - OPCODE(o6_pushByte), - OPCODE(o6_pushWord), - OPCODE(o6_pushByteVar), - OPCODE(o6_pushWordVar), - /* 04 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayRead), - OPCODE(o6_wordArrayRead), - /* 08 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayIndexedRead), - OPCODE(o6_wordArrayIndexedRead), - /* 0C */ - OPCODE(o6_dup), - OPCODE(o6_not), - OPCODE(o6_eq), - OPCODE(o6_neq), - /* 10 */ - OPCODE(o6_gt), - OPCODE(o6_lt), - OPCODE(o6_le), - OPCODE(o6_ge), - /* 14 */ - OPCODE(o6_add), - OPCODE(o6_sub), - OPCODE(o6_mul), - OPCODE(o6_div), - /* 18 */ - OPCODE(o6_land), - OPCODE(o6_lor), - OPCODE(o6_pop), - OPCODE(o6_invalid), - /* 1C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 20 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 24 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 28 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 2C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 30 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 34 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 38 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 3C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 40 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_writeByteVar), - OPCODE(o6_writeWordVar), - /* 44 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayWrite), - OPCODE(o6_wordArrayWrite), - /* 48 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayIndexedWrite), - OPCODE(o6_wordArrayIndexedWrite), - /* 4C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteVarInc), - OPCODE(o6_wordVarInc), - /* 50 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayInc), - OPCODE(o6_wordArrayInc), - /* 54 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteVarDec), - OPCODE(o6_wordVarDec), - /* 58 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayDec), - OPCODE(o6_wordArrayDec), - /* 5C */ - OPCODE(o6_if), - OPCODE(o6_ifNot), - OPCODE(o6_startScript), - OPCODE(o6_startScriptQuick), - /* 60 */ - OPCODE(o6_startObject), - OPCODE(o6_drawObject), - OPCODE(o6_drawObjectAt), - OPCODE(o6_invalid), - /* 64 */ - OPCODE(o6_invalid), - OPCODE(o6_stopObjectCode), - OPCODE(o6_stopObjectCode), - OPCODE(o6_endCutscene), - /* 68 */ - OPCODE(o6_cutscene), - OPCODE(o6_stopMusic), - OPCODE(o6_freezeUnfreeze), - OPCODE(o6_cursorCommand), - /* 6C */ - OPCODE(o6_breakHere), - OPCODE(o6_ifClassOfIs), - OPCODE(o6_setClass), - OPCODE(o6_getState), - /* 70 */ - OPCODE(o60_setState), - OPCODE(o6_setOwner), - OPCODE(o6_getOwner), - OPCODE(o6_jump), - /* 74 */ - OPCODE(o70_startSound), - OPCODE(o6_stopSound), - OPCODE(o6_startMusic), - OPCODE(o6_stopObjectScript), - /* 78 */ - OPCODE(o6_panCameraTo), - OPCODE(o6_actorFollowCamera), - OPCODE(o6_setCameraAt), - OPCODE(o6_loadRoom), - /* 7C */ - OPCODE(o6_stopScript), - OPCODE(o6_walkActorToObj), - OPCODE(o6_walkActorTo), - OPCODE(o6_putActorAtXY), - /* 80 */ - OPCODE(o6_putActorAtObject), - OPCODE(o6_faceActor), - OPCODE(o6_animateActor), - OPCODE(o6_doSentence), - /* 84 */ - OPCODE(o70_pickupObject), - OPCODE(o6_loadRoomWithEgo), - OPCODE(o6_invalid), - OPCODE(o6_getRandomNumber), - /* 88 */ - OPCODE(o6_getRandomNumberRange), - OPCODE(o6_invalid), - OPCODE(o6_getActorMoving), - OPCODE(o6_isScriptRunning), - /* 8C */ - OPCODE(o70_getActorRoom), - OPCODE(o6_getObjectX), - OPCODE(o6_getObjectY), - OPCODE(o6_getObjectOldDir), - /* 90 */ - OPCODE(o6_getActorWalkBox), - OPCODE(o6_getActorCostume), - OPCODE(o6_findInventory), - OPCODE(o6_getInventoryCount), - /* 94 */ - OPCODE(o6_getVerbFromXY), - OPCODE(o6_beginOverride), - OPCODE(o6_endOverride), - OPCODE(o6_setObjectName), - /* 98 */ - OPCODE(o6_isSoundRunning), - OPCODE(o6_setBoxFlags), - OPCODE(o6_invalid), - OPCODE(o70_resourceRoutines), - /* 9C */ - OPCODE(o60_roomOps), - OPCODE(o60_actorOps), - OPCODE(o6_verbOps), - OPCODE(o6_getActorFromXY), - /* A0 */ - OPCODE(o6_findObject), - OPCODE(o6_pseudoRoom), - OPCODE(o6_getActorElevation), - OPCODE(o6_getVerbEntrypoint), - /* A4 */ - OPCODE(o6_arrayOps), - OPCODE(o6_saveRestoreVerbs), - OPCODE(o6_drawBox), - OPCODE(o6_pop), - /* A8 */ - OPCODE(o6_getActorWidth), - OPCODE(o6_wait), - OPCODE(o6_getActorScaleX), - OPCODE(o6_getActorAnimCounter), - /* AC */ - OPCODE(o6_invalid), - OPCODE(o6_isAnyOf), - OPCODE(o70_systemOps), - OPCODE(o6_isActorInBox), - /* B0 */ - OPCODE(o6_delay), - OPCODE(o6_delaySeconds), - OPCODE(o6_delayMinutes), - OPCODE(o6_stopSentence), - /* B4 */ - OPCODE(o6_printLine), - OPCODE(o6_printText), - OPCODE(o6_printDebug), - OPCODE(o6_printSystem), - /* B8 */ - OPCODE(o6_printActor), - OPCODE(o6_printEgo), - OPCODE(o6_talkActor), - OPCODE(o6_talkEgo), - /* BC */ - OPCODE(o6_dimArray), - OPCODE(o6_stopObjectCode), - OPCODE(o6_startObjectQuick), - OPCODE(o6_startScriptQuick2), - /* C0 */ - OPCODE(o6_dim2dimArray), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* C4 */ - OPCODE(o6_abs), - OPCODE(o6_distObjectObject), - OPCODE(o6_distObjectPt), - OPCODE(o6_distPtPt), - /* C8 */ - OPCODE(o60_kernelGetFunctions), - OPCODE(o60_kernelSetFunctions), - OPCODE(o6_delayFrames), - OPCODE(o6_pickOneOf), - /* CC */ - OPCODE(o6_pickOneOfDefault), - OPCODE(o6_stampObject), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* D0 */ - OPCODE(o6_getDateTime), - OPCODE(o6_stopTalking), - OPCODE(o6_getAnimateVariable), - OPCODE(o6_invalid), - /* D4 */ - OPCODE(o6_shuffle), - OPCODE(o6_jumpToScript), - OPCODE(o6_band), - OPCODE(o6_bor), - /* D8 */ - OPCODE(o6_isRoomScriptRunning), - OPCODE(o60_closeFile), - OPCODE(o60_openFile), - OPCODE(o60_readFile), - /* DC */ - OPCODE(o60_writeFile), - OPCODE(o6_findAllObjects), - OPCODE(o60_deleteFile), - OPCODE(o60_rename), - /* E0 */ - OPCODE(o60_soundOps), - OPCODE(o6_getPixel), - OPCODE(o60_localizeArrayToScript), - OPCODE(o6_pickVarRandom), - /* E4 */ - OPCODE(o6_setBoxSet), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* E8 */ - OPCODE(o6_invalid), - OPCODE(o60_seekFilePos), - OPCODE(o60_redimArray), - OPCODE(o60_readFilePos), - /* EC */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o70_getStringLen), - OPCODE(o6_invalid), - /* F0 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o70_isResourceLoaded), - OPCODE(o70_readINI), - /* F4 */ - OPCODE(o70_writeINI), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* F8 */ - OPCODE(o6_invalid), - OPCODE(o70_createDirectory), - OPCODE(o70_setSystemMessage), - OPCODE(o6_invalid), - /* FC */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - }; - - _opcodesv70he = opcodes; -} - -void ScummEngine_v70he::executeOpcode(byte i) { - OpcodeProcv70he op = _opcodesv70he[i].proc; - (this->*op) (); -} - -const char *ScummEngine_v70he::getOpcodeDesc(byte i) { - return _opcodesv70he[i].desc; + /* 00 */ + OPCODE(0x00, o6_pushByte); + OPCODE(0x01, o6_pushWord); + OPCODE(0x02, o6_pushByteVar); + OPCODE(0x03, o6_pushWordVar); + /* 04 */ + OPCODE(0x04, o6_invalid); + OPCODE(0x05, o6_invalid); + OPCODE(0x06, o6_byteArrayRead); + OPCODE(0x07, o6_wordArrayRead); + /* 08 */ + OPCODE(0x08, o6_invalid); + OPCODE(0x09, o6_invalid); + OPCODE(0x0a, o6_byteArrayIndexedRead); + OPCODE(0x0b, o6_wordArrayIndexedRead); + /* 0C */ + OPCODE(0x0c, o6_dup); + OPCODE(0x0d, o6_not); + OPCODE(0x0e, o6_eq); + OPCODE(0x0f, o6_neq); + /* 10 */ + OPCODE(0x10, o6_gt); + OPCODE(0x11, o6_lt); + OPCODE(0x12, o6_le); + OPCODE(0x13, o6_ge); + /* 14 */ + OPCODE(0x14, o6_add); + OPCODE(0x15, o6_sub); + OPCODE(0x16, o6_mul); + OPCODE(0x17, o6_div); + /* 18 */ + OPCODE(0x18, o6_land); + OPCODE(0x19, o6_lor); + OPCODE(0x1a, o6_pop); + OPCODE(0x1b, o6_invalid); + /* 1C */ + OPCODE(0x1c, o6_invalid); + OPCODE(0x1d, o6_invalid); + OPCODE(0x1e, o6_invalid); + OPCODE(0x1f, o6_invalid); + /* 20 */ + OPCODE(0x20, o6_invalid); + OPCODE(0x21, o6_invalid); + OPCODE(0x22, o6_invalid); + OPCODE(0x23, o6_invalid); + /* 24 */ + OPCODE(0x24, o6_invalid); + OPCODE(0x25, o6_invalid); + OPCODE(0x26, o6_invalid); + OPCODE(0x27, o6_invalid); + /* 28 */ + OPCODE(0x28, o6_invalid); + OPCODE(0x29, o6_invalid); + OPCODE(0x2a, o6_invalid); + OPCODE(0x2b, o6_invalid); + /* 2C */ + OPCODE(0x2c, o6_invalid); + OPCODE(0x2d, o6_invalid); + OPCODE(0x2e, o6_invalid); + OPCODE(0x2f, o6_invalid); + /* 30 */ + OPCODE(0x30, o6_invalid); + OPCODE(0x31, o6_invalid); + OPCODE(0x32, o6_invalid); + OPCODE(0x33, o6_invalid); + /* 34 */ + OPCODE(0x34, o6_invalid); + OPCODE(0x35, o6_invalid); + OPCODE(0x36, o6_invalid); + OPCODE(0x37, o6_invalid); + /* 38 */ + OPCODE(0x38, o6_invalid); + OPCODE(0x39, o6_invalid); + OPCODE(0x3a, o6_invalid); + OPCODE(0x3b, o6_invalid); + /* 3C */ + OPCODE(0x3c, o6_invalid); + OPCODE(0x3d, o6_invalid); + OPCODE(0x3e, o6_invalid); + OPCODE(0x3f, o6_invalid); + /* 40 */ + OPCODE(0x40, o6_invalid); + OPCODE(0x41, o6_invalid); + OPCODE(0x42, o6_writeByteVar); + OPCODE(0x43, o6_writeWordVar); + /* 44 */ + OPCODE(0x44, o6_invalid); + OPCODE(0x45, o6_invalid); + OPCODE(0x46, o6_byteArrayWrite); + OPCODE(0x47, o6_wordArrayWrite); + /* 48 */ + OPCODE(0x48, o6_invalid); + OPCODE(0x49, o6_invalid); + OPCODE(0x4a, o6_byteArrayIndexedWrite); + OPCODE(0x4b, o6_wordArrayIndexedWrite); + /* 4C */ + OPCODE(0x4c, o6_invalid); + OPCODE(0x4d, o6_invalid); + OPCODE(0x4e, o6_byteVarInc); + OPCODE(0x4f, o6_wordVarInc); + /* 50 */ + OPCODE(0x50, o6_invalid); + OPCODE(0x51, o6_invalid); + OPCODE(0x52, o6_byteArrayInc); + OPCODE(0x53, o6_wordArrayInc); + /* 54 */ + OPCODE(0x54, o6_invalid); + OPCODE(0x55, o6_invalid); + OPCODE(0x56, o6_byteVarDec); + OPCODE(0x57, o6_wordVarDec); + /* 58 */ + OPCODE(0x58, o6_invalid); + OPCODE(0x59, o6_invalid); + OPCODE(0x5a, o6_byteArrayDec); + OPCODE(0x5b, o6_wordArrayDec); + /* 5C */ + OPCODE(0x5c, o6_if); + OPCODE(0x5d, o6_ifNot); + OPCODE(0x5e, o6_startScript); + OPCODE(0x5f, o6_startScriptQuick); + /* 60 */ + OPCODE(0x60, o6_startObject); + OPCODE(0x61, o6_drawObject); + OPCODE(0x62, o6_drawObjectAt); + OPCODE(0x63, o6_invalid); + /* 64 */ + OPCODE(0x64, o6_invalid); + OPCODE(0x65, o6_stopObjectCode); + OPCODE(0x66, o6_stopObjectCode); + OPCODE(0x67, o6_endCutscene); + /* 68 */ + OPCODE(0x68, o6_cutscene); + OPCODE(0x69, o6_stopMusic); + OPCODE(0x6a, o6_freezeUnfreeze); + OPCODE(0x6b, o6_cursorCommand); + /* 6C */ + OPCODE(0x6c, o6_breakHere); + OPCODE(0x6d, o6_ifClassOfIs); + OPCODE(0x6e, o6_setClass); + OPCODE(0x6f, o6_getState); + /* 70 */ + OPCODE(0x70, o60_setState); + OPCODE(0x71, o6_setOwner); + OPCODE(0x72, o6_getOwner); + OPCODE(0x73, o6_jump); + /* 74 */ + OPCODE(0x74, o70_startSound); + OPCODE(0x75, o6_stopSound); + OPCODE(0x76, o6_startMusic); + OPCODE(0x77, o6_stopObjectScript); + /* 78 */ + OPCODE(0x78, o6_panCameraTo); + OPCODE(0x79, o6_actorFollowCamera); + OPCODE(0x7a, o6_setCameraAt); + OPCODE(0x7b, o6_loadRoom); + /* 7C */ + OPCODE(0x7c, o6_stopScript); + OPCODE(0x7d, o6_walkActorToObj); + OPCODE(0x7e, o6_walkActorTo); + OPCODE(0x7f, o6_putActorAtXY); + /* 80 */ + OPCODE(0x80, o6_putActorAtObject); + OPCODE(0x81, o6_faceActor); + OPCODE(0x82, o6_animateActor); + OPCODE(0x83, o6_doSentence); + /* 84 */ + OPCODE(0x84, o70_pickupObject); + OPCODE(0x85, o6_loadRoomWithEgo); + OPCODE(0x86, o6_invalid); + OPCODE(0x87, o6_getRandomNumber); + /* 88 */ + OPCODE(0x88, o6_getRandomNumberRange); + OPCODE(0x89, o6_invalid); + OPCODE(0x8a, o6_getActorMoving); + OPCODE(0x8b, o6_isScriptRunning); + /* 8C */ + OPCODE(0x8c, o70_getActorRoom); + OPCODE(0x8d, o6_getObjectX); + OPCODE(0x8e, o6_getObjectY); + OPCODE(0x8f, o6_getObjectOldDir); + /* 90 */ + OPCODE(0x90, o6_getActorWalkBox); + OPCODE(0x91, o6_getActorCostume); + OPCODE(0x92, o6_findInventory); + OPCODE(0x93, o6_getInventoryCount); + /* 94 */ + OPCODE(0x94, o6_getVerbFromXY); + OPCODE(0x95, o6_beginOverride); + OPCODE(0x96, o6_endOverride); + OPCODE(0x97, o6_setObjectName); + /* 98 */ + OPCODE(0x98, o6_isSoundRunning); + OPCODE(0x99, o6_setBoxFlags); + OPCODE(0x9a, o6_invalid); + OPCODE(0x9b, o70_resourceRoutines); + /* 9C */ + OPCODE(0x9c, o60_roomOps); + OPCODE(0x9d, o60_actorOps); + OPCODE(0x9e, o6_verbOps); + OPCODE(0x9f, o6_getActorFromXY); + /* A0 */ + OPCODE(0xa0, o6_findObject); + OPCODE(0xa1, o6_pseudoRoom); + OPCODE(0xa2, o6_getActorElevation); + OPCODE(0xa3, o6_getVerbEntrypoint); + /* A4 */ + OPCODE(0xa4, o6_arrayOps); + OPCODE(0xa5, o6_saveRestoreVerbs); + OPCODE(0xa6, o6_drawBox); + OPCODE(0xa7, o6_pop); + /* A8 */ + OPCODE(0xa8, o6_getActorWidth); + OPCODE(0xa9, o6_wait); + OPCODE(0xaa, o6_getActorScaleX); + OPCODE(0xab, o6_getActorAnimCounter); + /* AC */ + OPCODE(0xac, o6_invalid); + OPCODE(0xad, o6_isAnyOf); + OPCODE(0xae, o70_systemOps); + OPCODE(0xaf, o6_isActorInBox); + /* B0 */ + OPCODE(0xb0, o6_delay); + OPCODE(0xb1, o6_delaySeconds); + OPCODE(0xb2, o6_delayMinutes); + OPCODE(0xb3, o6_stopSentence); + /* B4 */ + OPCODE(0xb4, o6_printLine); + OPCODE(0xb5, o6_printText); + OPCODE(0xb6, o6_printDebug); + OPCODE(0xb7, o6_printSystem); + /* B8 */ + OPCODE(0xb8, o6_printActor); + OPCODE(0xb9, o6_printEgo); + OPCODE(0xba, o6_talkActor); + OPCODE(0xbb, o6_talkEgo); + /* BC */ + OPCODE(0xbc, o6_dimArray); + OPCODE(0xbd, o6_stopObjectCode); + OPCODE(0xbe, o6_startObjectQuick); + OPCODE(0xbf, o6_startScriptQuick2); + /* C0 */ + OPCODE(0xc0, o6_dim2dimArray); + OPCODE(0xc1, o6_invalid); + OPCODE(0xc2, o6_invalid); + OPCODE(0xc3, o6_invalid); + /* C4 */ + OPCODE(0xc4, o6_abs); + OPCODE(0xc5, o6_distObjectObject); + OPCODE(0xc6, o6_distObjectPt); + OPCODE(0xc7, o6_distPtPt); + /* C8 */ + OPCODE(0xc8, o60_kernelGetFunctions); + OPCODE(0xc9, o60_kernelSetFunctions); + OPCODE(0xca, o6_delayFrames); + OPCODE(0xcb, o6_pickOneOf); + /* CC */ + OPCODE(0xcc, o6_pickOneOfDefault); + OPCODE(0xcd, o6_stampObject); + OPCODE(0xce, o6_invalid); + OPCODE(0xcf, o6_invalid); + /* D0 */ + OPCODE(0xd0, o6_getDateTime); + OPCODE(0xd1, o6_stopTalking); + OPCODE(0xd2, o6_getAnimateVariable); + OPCODE(0xd3, o6_invalid); + /* D4 */ + OPCODE(0xd4, o6_shuffle); + OPCODE(0xd5, o6_jumpToScript); + OPCODE(0xd6, o6_band); + OPCODE(0xd7, o6_bor); + /* D8 */ + OPCODE(0xd8, o6_isRoomScriptRunning); + OPCODE(0xd9, o60_closeFile); + OPCODE(0xda, o60_openFile); + OPCODE(0xdb, o60_readFile); + /* DC */ + OPCODE(0xdc, o60_writeFile); + OPCODE(0xdd, o6_findAllObjects); + OPCODE(0xde, o60_deleteFile); + OPCODE(0xdf, o60_rename); + /* E0 */ + OPCODE(0xe0, o60_soundOps); + OPCODE(0xe1, o6_getPixel); + OPCODE(0xe2, o60_localizeArrayToScript); + OPCODE(0xe3, o6_pickVarRandom); + /* E4 */ + OPCODE(0xe4, o6_setBoxSet); + OPCODE(0xe5, o6_invalid); + OPCODE(0xe6, o6_invalid); + OPCODE(0xe7, o6_invalid); + /* E8 */ + OPCODE(0xe8, o6_invalid); + OPCODE(0xe9, o60_seekFilePos); + OPCODE(0xea, o60_redimArray); + OPCODE(0xeb, o60_readFilePos); + /* EC */ + OPCODE(0xec, o6_invalid); + OPCODE(0xed, o6_invalid); + OPCODE(0xee, o70_getStringLen); + OPCODE(0xef, o6_invalid); + /* F0 */ + OPCODE(0xf0, o6_invalid); + OPCODE(0xf1, o6_invalid); + OPCODE(0xf2, o70_isResourceLoaded); + OPCODE(0xf3, o70_readINI); + /* F4 */ + OPCODE(0xf4, o70_writeINI); + OPCODE(0xf5, o6_invalid); + OPCODE(0xf6, o6_invalid); + OPCODE(0xf7, o6_invalid); + /* F8 */ + OPCODE(0xf8, o6_invalid); + OPCODE(0xf9, o70_createDirectory); + OPCODE(0xfa, o70_setSystemMessage); + OPCODE(0xfb, o6_invalid); + /* FC */ + OPCODE(0xfc, o6_invalid); + OPCODE(0xfd, o6_invalid); + OPCODE(0xfe, o6_invalid); + OPCODE(0xff, o6_invalid); } void ScummEngine_v70he::o70_startSound() { diff --git a/engines/scumm/he/script_v71he.cpp b/engines/scumm/he/script_v71he.cpp index 1338ab3db8..b2dd649264 100644 --- a/engines/scumm/he/script_v71he.cpp +++ b/engines/scumm/he/script_v71he.cpp @@ -30,342 +30,329 @@ namespace Scumm { -#define OPCODE(x) _OPCODE(ScummEngine_v71he, x) +#define OPCODE(i, x) _opcodes[i]._OPCODE(ScummEngine_v71he, x) void ScummEngine_v71he::setupOpcodes() { - static const OpcodeEntryv71he opcodes[256] = { - /* 00 */ - OPCODE(o6_pushByte), - OPCODE(o6_pushWord), - OPCODE(o6_pushByteVar), - OPCODE(o6_pushWordVar), - /* 04 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayRead), - OPCODE(o6_wordArrayRead), - /* 08 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayIndexedRead), - OPCODE(o6_wordArrayIndexedRead), - /* 0C */ - OPCODE(o6_dup), - OPCODE(o6_not), - OPCODE(o6_eq), - OPCODE(o6_neq), - /* 10 */ - OPCODE(o6_gt), - OPCODE(o6_lt), - OPCODE(o6_le), - OPCODE(o6_ge), - /* 14 */ - OPCODE(o6_add), - OPCODE(o6_sub), - OPCODE(o6_mul), - OPCODE(o6_div), - /* 18 */ - OPCODE(o6_land), - OPCODE(o6_lor), - OPCODE(o6_pop), - OPCODE(o6_invalid), - /* 1C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 20 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 24 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 28 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 2C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 30 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 34 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 38 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 3C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 40 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_writeByteVar), - OPCODE(o6_writeWordVar), - /* 44 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayWrite), - OPCODE(o6_wordArrayWrite), - /* 48 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayIndexedWrite), - OPCODE(o6_wordArrayIndexedWrite), - /* 4C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteVarInc), - OPCODE(o6_wordVarInc), - /* 50 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayInc), - OPCODE(o6_wordArrayInc), - /* 54 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteVarDec), - OPCODE(o6_wordVarDec), - /* 58 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_byteArrayDec), - OPCODE(o6_wordArrayDec), - /* 5C */ - OPCODE(o6_if), - OPCODE(o6_ifNot), - OPCODE(o6_startScript), - OPCODE(o6_startScriptQuick), - /* 60 */ - OPCODE(o6_startObject), - OPCODE(o6_drawObject), - OPCODE(o6_drawObjectAt), - OPCODE(o6_invalid), - /* 64 */ - OPCODE(o6_invalid), - OPCODE(o6_stopObjectCode), - OPCODE(o6_stopObjectCode), - OPCODE(o6_endCutscene), - /* 68 */ - OPCODE(o6_cutscene), - OPCODE(o6_stopMusic), - OPCODE(o6_freezeUnfreeze), - OPCODE(o6_cursorCommand), - /* 6C */ - OPCODE(o6_breakHere), - OPCODE(o6_ifClassOfIs), - OPCODE(o6_setClass), - OPCODE(o6_getState), - /* 70 */ - OPCODE(o60_setState), - OPCODE(o6_setOwner), - OPCODE(o6_getOwner), - OPCODE(o6_jump), - /* 74 */ - OPCODE(o70_startSound), - OPCODE(o6_stopSound), - OPCODE(o6_startMusic), - OPCODE(o6_stopObjectScript), - /* 78 */ - OPCODE(o6_panCameraTo), - OPCODE(o6_actorFollowCamera), - OPCODE(o6_setCameraAt), - OPCODE(o6_loadRoom), - /* 7C */ - OPCODE(o6_stopScript), - OPCODE(o6_walkActorToObj), - OPCODE(o6_walkActorTo), - OPCODE(o6_putActorAtXY), - /* 80 */ - OPCODE(o6_putActorAtObject), - OPCODE(o6_faceActor), - OPCODE(o6_animateActor), - OPCODE(o6_doSentence), - /* 84 */ - OPCODE(o70_pickupObject), - OPCODE(o6_loadRoomWithEgo), - OPCODE(o6_invalid), - OPCODE(o6_getRandomNumber), - /* 88 */ - OPCODE(o6_getRandomNumberRange), - OPCODE(o6_invalid), - OPCODE(o6_getActorMoving), - OPCODE(o6_isScriptRunning), - /* 8C */ - OPCODE(o70_getActorRoom), - OPCODE(o6_getObjectX), - OPCODE(o6_getObjectY), - OPCODE(o6_getObjectOldDir), - /* 90 */ - OPCODE(o6_getActorWalkBox), - OPCODE(o6_getActorCostume), - OPCODE(o6_findInventory), - OPCODE(o6_getInventoryCount), - /* 94 */ - OPCODE(o6_getVerbFromXY), - OPCODE(o6_beginOverride), - OPCODE(o6_endOverride), - OPCODE(o6_setObjectName), - /* 98 */ - OPCODE(o6_isSoundRunning), - OPCODE(o6_setBoxFlags), - OPCODE(o6_invalid), - OPCODE(o70_resourceRoutines), - /* 9C */ - OPCODE(o60_roomOps), - OPCODE(o60_actorOps), - OPCODE(o6_verbOps), - OPCODE(o6_getActorFromXY), - /* A0 */ - OPCODE(o6_findObject), - OPCODE(o6_pseudoRoom), - OPCODE(o6_getActorElevation), - OPCODE(o6_getVerbEntrypoint), - /* A4 */ - OPCODE(o6_arrayOps), - OPCODE(o6_saveRestoreVerbs), - OPCODE(o6_drawBox), - OPCODE(o6_pop), - /* A8 */ - OPCODE(o6_getActorWidth), - OPCODE(o6_wait), - OPCODE(o6_getActorScaleX), - OPCODE(o6_getActorAnimCounter), - /* AC */ - OPCODE(o6_invalid), - OPCODE(o6_isAnyOf), - OPCODE(o70_systemOps), - OPCODE(o6_isActorInBox), - /* B0 */ - OPCODE(o6_delay), - OPCODE(o6_delaySeconds), - OPCODE(o6_delayMinutes), - OPCODE(o6_stopSentence), - /* B4 */ - OPCODE(o6_printLine), - OPCODE(o6_printText), - OPCODE(o6_printDebug), - OPCODE(o6_printSystem), - /* B8 */ - OPCODE(o6_printActor), - OPCODE(o6_printEgo), - OPCODE(o6_talkActor), - OPCODE(o6_talkEgo), - /* BC */ - OPCODE(o6_dimArray), - OPCODE(o6_stopObjectCode), - OPCODE(o6_startObjectQuick), - OPCODE(o6_startScriptQuick2), - /* C0 */ - OPCODE(o6_dim2dimArray), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* C4 */ - OPCODE(o6_abs), - OPCODE(o6_distObjectObject), - OPCODE(o6_distObjectPt), - OPCODE(o6_distPtPt), - /* C8 */ - OPCODE(o60_kernelGetFunctions), - OPCODE(o71_kernelSetFunctions), - OPCODE(o6_delayFrames), - OPCODE(o6_pickOneOf), - /* CC */ - OPCODE(o6_pickOneOfDefault), - OPCODE(o6_stampObject), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* D0 */ - OPCODE(o6_getDateTime), - OPCODE(o6_stopTalking), - OPCODE(o6_getAnimateVariable), - OPCODE(o6_invalid), - /* D4 */ - OPCODE(o6_shuffle), - OPCODE(o6_jumpToScript), - OPCODE(o6_band), - OPCODE(o6_bor), - /* D8 */ - OPCODE(o6_isRoomScriptRunning), - OPCODE(o60_closeFile), - OPCODE(o60_openFile), - OPCODE(o60_readFile), - /* DC */ - OPCODE(o60_writeFile), - OPCODE(o6_findAllObjects), - OPCODE(o60_deleteFile), - OPCODE(o60_rename), - /* E0 */ - OPCODE(o60_soundOps), - OPCODE(o6_getPixel), - OPCODE(o60_localizeArrayToScript), - OPCODE(o6_pickVarRandom), - /* E4 */ - OPCODE(o6_setBoxSet), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* E8 */ - OPCODE(o6_invalid), - OPCODE(o60_seekFilePos), - OPCODE(o60_redimArray), - OPCODE(o60_readFilePos), - /* EC */ - OPCODE(o71_copyString), - OPCODE(o71_getStringWidth), - OPCODE(o70_getStringLen), - OPCODE(o71_appendString), - /* F0 */ - OPCODE(o71_concatString), - OPCODE(o71_compareString), - OPCODE(o70_isResourceLoaded), - OPCODE(o70_readINI), - /* F4 */ - OPCODE(o70_writeINI), - OPCODE(o71_getStringLenForWidth), - OPCODE(o71_getCharIndexInString), - OPCODE(o71_findBox), - /* F8 */ - OPCODE(o6_invalid), - OPCODE(o70_createDirectory), - OPCODE(o70_setSystemMessage), - OPCODE(o71_polygonOps), - /* FC */ - OPCODE(o71_polygonHit), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - }; - - _opcodesv71he = opcodes; -} - -void ScummEngine_v71he::executeOpcode(byte i) { - OpcodeProcv71he op = _opcodesv71he[i].proc; - (this->*op) (); -} - -const char *ScummEngine_v71he::getOpcodeDesc(byte i) { - return _opcodesv71he[i].desc; + /* 00 */ + OPCODE(0x00, o6_pushByte); + OPCODE(0x01, o6_pushWord); + OPCODE(0x02, o6_pushByteVar); + OPCODE(0x03, o6_pushWordVar); + /* 04 */ + OPCODE(0x04, o6_invalid); + OPCODE(0x05, o6_invalid); + OPCODE(0x06, o6_byteArrayRead); + OPCODE(0x07, o6_wordArrayRead); + /* 08 */ + OPCODE(0x08, o6_invalid); + OPCODE(0x09, o6_invalid); + OPCODE(0x0a, o6_byteArrayIndexedRead); + OPCODE(0x0b, o6_wordArrayIndexedRead); + /* 0C */ + OPCODE(0x0c, o6_dup); + OPCODE(0x0d, o6_not); + OPCODE(0x0e, o6_eq); + OPCODE(0x0f, o6_neq); + /* 10 */ + OPCODE(0x10, o6_gt); + OPCODE(0x11, o6_lt); + OPCODE(0x12, o6_le); + OPCODE(0x13, o6_ge); + /* 14 */ + OPCODE(0x14, o6_add); + OPCODE(0x15, o6_sub); + OPCODE(0x16, o6_mul); + OPCODE(0x17, o6_div); + /* 18 */ + OPCODE(0x18, o6_land); + OPCODE(0x19, o6_lor); + OPCODE(0x1a, o6_pop); + OPCODE(0x1b, o6_invalid); + /* 1C */ + OPCODE(0x1c, o6_invalid); + OPCODE(0x1d, o6_invalid); + OPCODE(0x1e, o6_invalid); + OPCODE(0x1f, o6_invalid); + /* 20 */ + OPCODE(0x20, o6_invalid); + OPCODE(0x21, o6_invalid); + OPCODE(0x22, o6_invalid); + OPCODE(0x23, o6_invalid); + /* 24 */ + OPCODE(0x24, o6_invalid); + OPCODE(0x25, o6_invalid); + OPCODE(0x26, o6_invalid); + OPCODE(0x27, o6_invalid); + /* 28 */ + OPCODE(0x28, o6_invalid); + OPCODE(0x29, o6_invalid); + OPCODE(0x2a, o6_invalid); + OPCODE(0x2b, o6_invalid); + /* 2C */ + OPCODE(0x2c, o6_invalid); + OPCODE(0x2d, o6_invalid); + OPCODE(0x2e, o6_invalid); + OPCODE(0x2f, o6_invalid); + /* 30 */ + OPCODE(0x30, o6_invalid); + OPCODE(0x31, o6_invalid); + OPCODE(0x32, o6_invalid); + OPCODE(0x33, o6_invalid); + /* 34 */ + OPCODE(0x34, o6_invalid); + OPCODE(0x35, o6_invalid); + OPCODE(0x36, o6_invalid); + OPCODE(0x37, o6_invalid); + /* 38 */ + OPCODE(0x38, o6_invalid); + OPCODE(0x39, o6_invalid); + OPCODE(0x3a, o6_invalid); + OPCODE(0x3b, o6_invalid); + /* 3C */ + OPCODE(0x3c, o6_invalid); + OPCODE(0x3d, o6_invalid); + OPCODE(0x3e, o6_invalid); + OPCODE(0x3f, o6_invalid); + /* 40 */ + OPCODE(0x40, o6_invalid); + OPCODE(0x41, o6_invalid); + OPCODE(0x42, o6_writeByteVar); + OPCODE(0x43, o6_writeWordVar); + /* 44 */ + OPCODE(0x44, o6_invalid); + OPCODE(0x45, o6_invalid); + OPCODE(0x46, o6_byteArrayWrite); + OPCODE(0x47, o6_wordArrayWrite); + /* 48 */ + OPCODE(0x48, o6_invalid); + OPCODE(0x49, o6_invalid); + OPCODE(0x4a, o6_byteArrayIndexedWrite); + OPCODE(0x4b, o6_wordArrayIndexedWrite); + /* 4C */ + OPCODE(0x4c, o6_invalid); + OPCODE(0x4d, o6_invalid); + OPCODE(0x4e, o6_byteVarInc); + OPCODE(0x4f, o6_wordVarInc); + /* 50 */ + OPCODE(0x50, o6_invalid); + OPCODE(0x51, o6_invalid); + OPCODE(0x52, o6_byteArrayInc); + OPCODE(0x53, o6_wordArrayInc); + /* 54 */ + OPCODE(0x54, o6_invalid); + OPCODE(0x55, o6_invalid); + OPCODE(0x56, o6_byteVarDec); + OPCODE(0x57, o6_wordVarDec); + /* 58 */ + OPCODE(0x58, o6_invalid); + OPCODE(0x59, o6_invalid); + OPCODE(0x5a, o6_byteArrayDec); + OPCODE(0x5b, o6_wordArrayDec); + /* 5C */ + OPCODE(0x5c, o6_if); + OPCODE(0x5d, o6_ifNot); + OPCODE(0x5e, o6_startScript); + OPCODE(0x5f, o6_startScriptQuick); + /* 60 */ + OPCODE(0x60, o6_startObject); + OPCODE(0x61, o6_drawObject); + OPCODE(0x62, o6_drawObjectAt); + OPCODE(0x63, o6_invalid); + /* 64 */ + OPCODE(0x64, o6_invalid); + OPCODE(0x65, o6_stopObjectCode); + OPCODE(0x66, o6_stopObjectCode); + OPCODE(0x67, o6_endCutscene); + /* 68 */ + OPCODE(0x68, o6_cutscene); + OPCODE(0x69, o6_stopMusic); + OPCODE(0x6a, o6_freezeUnfreeze); + OPCODE(0x6b, o6_cursorCommand); + /* 6C */ + OPCODE(0x6c, o6_breakHere); + OPCODE(0x6d, o6_ifClassOfIs); + OPCODE(0x6e, o6_setClass); + OPCODE(0x6f, o6_getState); + /* 70 */ + OPCODE(0x70, o60_setState); + OPCODE(0x71, o6_setOwner); + OPCODE(0x72, o6_getOwner); + OPCODE(0x73, o6_jump); + /* 74 */ + OPCODE(0x74, o70_startSound); + OPCODE(0x75, o6_stopSound); + OPCODE(0x76, o6_startMusic); + OPCODE(0x77, o6_stopObjectScript); + /* 78 */ + OPCODE(0x78, o6_panCameraTo); + OPCODE(0x79, o6_actorFollowCamera); + OPCODE(0x7a, o6_setCameraAt); + OPCODE(0x7b, o6_loadRoom); + /* 7C */ + OPCODE(0x7c, o6_stopScript); + OPCODE(0x7d, o6_walkActorToObj); + OPCODE(0x7e, o6_walkActorTo); + OPCODE(0x7f, o6_putActorAtXY); + /* 80 */ + OPCODE(0x80, o6_putActorAtObject); + OPCODE(0x81, o6_faceActor); + OPCODE(0x82, o6_animateActor); + OPCODE(0x83, o6_doSentence); + /* 84 */ + OPCODE(0x84, o70_pickupObject); + OPCODE(0x85, o6_loadRoomWithEgo); + OPCODE(0x86, o6_invalid); + OPCODE(0x87, o6_getRandomNumber); + /* 88 */ + OPCODE(0x88, o6_getRandomNumberRange); + OPCODE(0x89, o6_invalid); + OPCODE(0x8a, o6_getActorMoving); + OPCODE(0x8b, o6_isScriptRunning); + /* 8C */ + OPCODE(0x8c, o70_getActorRoom); + OPCODE(0x8d, o6_getObjectX); + OPCODE(0x8e, o6_getObjectY); + OPCODE(0x8f, o6_getObjectOldDir); + /* 90 */ + OPCODE(0x90, o6_getActorWalkBox); + OPCODE(0x91, o6_getActorCostume); + OPCODE(0x92, o6_findInventory); + OPCODE(0x93, o6_getInventoryCount); + /* 94 */ + OPCODE(0x94, o6_getVerbFromXY); + OPCODE(0x95, o6_beginOverride); + OPCODE(0x96, o6_endOverride); + OPCODE(0x97, o6_setObjectName); + /* 98 */ + OPCODE(0x98, o6_isSoundRunning); + OPCODE(0x99, o6_setBoxFlags); + OPCODE(0x9a, o6_invalid); + OPCODE(0x9b, o70_resourceRoutines); + /* 9C */ + OPCODE(0x9c, o60_roomOps); + OPCODE(0x9d, o60_actorOps); + OPCODE(0x9e, o6_verbOps); + OPCODE(0x9f, o6_getActorFromXY); + /* A0 */ + OPCODE(0xa0, o6_findObject); + OPCODE(0xa1, o6_pseudoRoom); + OPCODE(0xa2, o6_getActorElevation); + OPCODE(0xa3, o6_getVerbEntrypoint); + /* A4 */ + OPCODE(0xa4, o6_arrayOps); + OPCODE(0xa5, o6_saveRestoreVerbs); + OPCODE(0xa6, o6_drawBox); + OPCODE(0xa7, o6_pop); + /* A8 */ + OPCODE(0xa8, o6_getActorWidth); + OPCODE(0xa9, o6_wait); + OPCODE(0xaa, o6_getActorScaleX); + OPCODE(0xab, o6_getActorAnimCounter); + /* AC */ + OPCODE(0xac, o6_invalid); + OPCODE(0xad, o6_isAnyOf); + OPCODE(0xae, o70_systemOps); + OPCODE(0xaf, o6_isActorInBox); + /* B0 */ + OPCODE(0xb0, o6_delay); + OPCODE(0xb1, o6_delaySeconds); + OPCODE(0xb2, o6_delayMinutes); + OPCODE(0xb3, o6_stopSentence); + /* B4 */ + OPCODE(0xb4, o6_printLine); + OPCODE(0xb5, o6_printText); + OPCODE(0xb6, o6_printDebug); + OPCODE(0xb7, o6_printSystem); + /* B8 */ + OPCODE(0xb8, o6_printActor); + OPCODE(0xb9, o6_printEgo); + OPCODE(0xba, o6_talkActor); + OPCODE(0xbb, o6_talkEgo); + /* BC */ + OPCODE(0xbc, o6_dimArray); + OPCODE(0xbd, o6_stopObjectCode); + OPCODE(0xbe, o6_startObjectQuick); + OPCODE(0xbf, o6_startScriptQuick2); + /* C0 */ + OPCODE(0xc0, o6_dim2dimArray); + OPCODE(0xc1, o6_invalid); + OPCODE(0xc2, o6_invalid); + OPCODE(0xc3, o6_invalid); + /* C4 */ + OPCODE(0xc4, o6_abs); + OPCODE(0xc5, o6_distObjectObject); + OPCODE(0xc6, o6_distObjectPt); + OPCODE(0xc7, o6_distPtPt); + /* C8 */ + OPCODE(0xc8, o60_kernelGetFunctions); + OPCODE(0xc9, o71_kernelSetFunctions); + OPCODE(0xca, o6_delayFrames); + OPCODE(0xcb, o6_pickOneOf); + /* CC */ + OPCODE(0xcc, o6_pickOneOfDefault); + OPCODE(0xcd, o6_stampObject); + OPCODE(0xce, o6_invalid); + OPCODE(0xcf, o6_invalid); + /* D0 */ + OPCODE(0xd0, o6_getDateTime); + OPCODE(0xd1, o6_stopTalking); + OPCODE(0xd2, o6_getAnimateVariable); + OPCODE(0xd3, o6_invalid); + /* D4 */ + OPCODE(0xd4, o6_shuffle); + OPCODE(0xd5, o6_jumpToScript); + OPCODE(0xd6, o6_band); + OPCODE(0xd7, o6_bor); + /* D8 */ + OPCODE(0xd8, o6_isRoomScriptRunning); + OPCODE(0xd9, o60_closeFile); + OPCODE(0xda, o60_openFile); + OPCODE(0xdb, o60_readFile); + /* DC */ + OPCODE(0xdc, o60_writeFile); + OPCODE(0xdd, o6_findAllObjects); + OPCODE(0xde, o60_deleteFile); + OPCODE(0xdf, o60_rename); + /* E0 */ + OPCODE(0xe0, o60_soundOps); + OPCODE(0xe1, o6_getPixel); + OPCODE(0xe2, o60_localizeArrayToScript); + OPCODE(0xe3, o6_pickVarRandom); + /* E4 */ + OPCODE(0xe4, o6_setBoxSet); + OPCODE(0xe5, o6_invalid); + OPCODE(0xe6, o6_invalid); + OPCODE(0xe7, o6_invalid); + /* E8 */ + OPCODE(0xe8, o6_invalid); + OPCODE(0xe9, o60_seekFilePos); + OPCODE(0xea, o60_redimArray); + OPCODE(0xeb, o60_readFilePos); + /* EC */ + OPCODE(0xec, o71_copyString); + OPCODE(0xed, o71_getStringWidth); + OPCODE(0xee, o70_getStringLen); + OPCODE(0xef, o71_appendString); + /* F0 */ + OPCODE(0xf0, o71_concatString); + OPCODE(0xf1, o71_compareString); + OPCODE(0xf2, o70_isResourceLoaded); + OPCODE(0xf3, o70_readINI); + /* F4 */ + OPCODE(0xf4, o70_writeINI); + OPCODE(0xf5, o71_getStringLenForWidth); + OPCODE(0xf6, o71_getCharIndexInString); + OPCODE(0xf7, o71_findBox); + /* F8 */ + OPCODE(0xf8, o6_invalid); + OPCODE(0xf9, o70_createDirectory); + OPCODE(0xfa, o70_setSystemMessage); + OPCODE(0xfb, o71_polygonOps); + /* FC */ + OPCODE(0xfc, o71_polygonHit); + OPCODE(0xfd, o6_invalid); + OPCODE(0xfe, o6_invalid); + OPCODE(0xff, o6_invalid); } byte *ScummEngine_v71he::heFindResourceData(uint32 tag, byte *ptr) { diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp index afedcdba22..a9301eb6c0 100644 --- a/engines/scumm/he/script_v72he.cpp +++ b/engines/scumm/he/script_v72he.cpp @@ -42,342 +42,329 @@ namespace Scumm { -#define OPCODE(x) _OPCODE(ScummEngine_v72he, x) +#define OPCODE(i, x) _opcodes[i]._OPCODE(ScummEngine_v72he, x) void ScummEngine_v72he::setupOpcodes() { - static const OpcodeEntryV72he opcodes[256] = { - /* 00 */ - OPCODE(o6_pushByte), - OPCODE(o6_pushWord), - OPCODE(o72_pushDWord), - OPCODE(o6_pushWordVar), - /* 04 */ - OPCODE(o72_getScriptString), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_wordArrayRead), - /* 08 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_wordArrayIndexedRead), - /* 0C */ - OPCODE(o6_dup), - OPCODE(o6_not), - OPCODE(o6_eq), - OPCODE(o6_neq), - /* 10 */ - OPCODE(o6_gt), - OPCODE(o6_lt), - OPCODE(o6_le), - OPCODE(o6_ge), - /* 14 */ - OPCODE(o6_add), - OPCODE(o6_sub), - OPCODE(o6_mul), - OPCODE(o6_div), - /* 18 */ - OPCODE(o6_land), - OPCODE(o6_lor), - OPCODE(o6_pop), - OPCODE(o72_isAnyOf), - /* 1C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 20 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 24 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 28 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 2C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 30 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 34 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 38 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 3C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 40 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_writeWordVar), - /* 44 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_wordArrayWrite), - /* 48 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_wordArrayIndexedWrite), - /* 4C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_wordVarInc), - /* 50 */ - OPCODE(o72_resetCutscene), - OPCODE(o6_invalid), - OPCODE(o72_findObjectWithClassOf), - OPCODE(o6_wordArrayInc), - /* 54 */ - OPCODE(o72_getObjectImageX), - OPCODE(o72_getObjectImageY), - OPCODE(o72_captureWizImage), - OPCODE(o6_wordVarDec), - /* 58 */ - OPCODE(o72_getTimer), - OPCODE(o72_setTimer), - OPCODE(o72_getSoundPosition), - OPCODE(o6_wordArrayDec), - /* 5C */ - OPCODE(o6_if), - OPCODE(o6_ifNot), - OPCODE(o72_startScript), - OPCODE(o6_startScriptQuick), - /* 60 */ - OPCODE(o72_startObject), - OPCODE(o72_drawObject), - OPCODE(o72_printWizImage), - OPCODE(o72_getArrayDimSize), - /* 64 */ - OPCODE(o72_getNumFreeArrays), - OPCODE(o6_stopObjectCode), - OPCODE(o6_stopObjectCode), - OPCODE(o6_endCutscene), - /* 68 */ - OPCODE(o6_cutscene), - OPCODE(o6_stopMusic), - OPCODE(o6_freezeUnfreeze), - OPCODE(o6_cursorCommand), - /* 6C */ - OPCODE(o6_breakHere), - OPCODE(o6_ifClassOfIs), - OPCODE(o6_setClass), - OPCODE(o6_getState), - /* 70 */ - OPCODE(o60_setState), - OPCODE(o6_setOwner), - OPCODE(o6_getOwner), - OPCODE(o6_jump), - /* 74 */ - OPCODE(o70_startSound), - OPCODE(o6_stopSound), - OPCODE(o6_startMusic), - OPCODE(o6_stopObjectScript), - /* 78 */ - OPCODE(o6_panCameraTo), - OPCODE(o6_actorFollowCamera), - OPCODE(o6_setCameraAt), - OPCODE(o6_loadRoom), - /* 7C */ - OPCODE(o6_stopScript), - OPCODE(o6_walkActorToObj), - OPCODE(o6_walkActorTo), - OPCODE(o6_putActorAtXY), - /* 80 */ - OPCODE(o6_putActorAtObject), - OPCODE(o6_faceActor), - OPCODE(o6_animateActor), - OPCODE(o6_doSentence), - /* 84 */ - OPCODE(o70_pickupObject), - OPCODE(o6_loadRoomWithEgo), - OPCODE(o6_invalid), - OPCODE(o6_getRandomNumber), - /* 88 */ - OPCODE(o6_getRandomNumberRange), - OPCODE(o6_invalid), - OPCODE(o6_getActorMoving), - OPCODE(o6_isScriptRunning), - /* 8C */ - OPCODE(o70_getActorRoom), - OPCODE(o6_getObjectX), - OPCODE(o6_getObjectY), - OPCODE(o6_getObjectOldDir), - /* 90 */ - OPCODE(o6_getActorWalkBox), - OPCODE(o6_getActorCostume), - OPCODE(o6_findInventory), - OPCODE(o6_getInventoryCount), - /* 94 */ - OPCODE(o6_getVerbFromXY), - OPCODE(o6_beginOverride), - OPCODE(o6_endOverride), - OPCODE(o6_invalid), - /* 98 */ - OPCODE(o6_isSoundRunning), - OPCODE(o6_setBoxFlags), - OPCODE(o6_invalid), - OPCODE(o70_resourceRoutines), - /* 9C */ - OPCODE(o72_roomOps), - OPCODE(o72_actorOps), - OPCODE(o72_verbOps), - OPCODE(o6_getActorFromXY), - /* A0 */ - OPCODE(o72_findObject), - OPCODE(o6_pseudoRoom), - OPCODE(o6_getActorElevation), - OPCODE(o6_getVerbEntrypoint), - /* A4 */ - OPCODE(o72_arrayOps), - OPCODE(o6_saveRestoreVerbs), - OPCODE(o6_drawBox), - OPCODE(o6_pop), - /* A8 */ - OPCODE(o6_getActorWidth), - OPCODE(o6_wait), - OPCODE(o6_getActorScaleX), - OPCODE(o6_getActorAnimCounter), - /* AC */ - OPCODE(o6_invalid), - OPCODE(o6_isAnyOf), - OPCODE(o72_systemOps), - OPCODE(o6_isActorInBox), - /* B0 */ - OPCODE(o6_delay), - OPCODE(o6_delaySeconds), - OPCODE(o6_delayMinutes), - OPCODE(o6_stopSentence), - /* B4 */ - OPCODE(o6_printLine), - OPCODE(o6_printText), - OPCODE(o6_printDebug), - OPCODE(o6_printSystem), - /* B8 */ - OPCODE(o6_printActor), - OPCODE(o6_printEgo), - OPCODE(o72_talkActor), - OPCODE(o72_talkEgo), - /* BC */ - OPCODE(o72_dimArray), - OPCODE(o6_stopObjectCode), - OPCODE(o6_startObjectQuick), - OPCODE(o6_startScriptQuick2), - /* C0 */ - OPCODE(o72_dim2dimArray), - OPCODE(o72_traceStatus), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* C4 */ - OPCODE(o6_abs), - OPCODE(o6_distObjectObject), - OPCODE(o6_distObjectPt), - OPCODE(o6_distPtPt), - /* C8 */ - OPCODE(o72_kernelGetFunctions), - OPCODE(o71_kernelSetFunctions), - OPCODE(o6_delayFrames), - OPCODE(o6_pickOneOf), - /* CC */ - OPCODE(o6_pickOneOfDefault), - OPCODE(o6_stampObject), - OPCODE(o72_drawWizImage), - OPCODE(o72_debugInput), - /* D0 */ - OPCODE(o6_getDateTime), - OPCODE(o6_stopTalking), - OPCODE(o6_getAnimateVariable), - OPCODE(o6_invalid), - /* D4 */ - OPCODE(o6_shuffle), - OPCODE(o72_jumpToScript), - OPCODE(o6_band), - OPCODE(o6_bor), - /* D8 */ - OPCODE(o6_isRoomScriptRunning), - OPCODE(o60_closeFile), - OPCODE(o72_openFile), - OPCODE(o72_readFile), - /* DC */ - OPCODE(o72_writeFile), - OPCODE(o72_findAllObjects), - OPCODE(o72_deleteFile), - OPCODE(o72_rename), - /* E0 */ - OPCODE(o60_soundOps), - OPCODE(o72_getPixel), - OPCODE(o60_localizeArrayToScript), - OPCODE(o72_pickVarRandom), - /* E4 */ - OPCODE(o6_setBoxSet), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* E8 */ - OPCODE(o6_invalid), - OPCODE(o60_seekFilePos), - OPCODE(o72_redimArray), - OPCODE(o60_readFilePos), - /* EC */ - OPCODE(o71_copyString), - OPCODE(o71_getStringWidth), - OPCODE(o70_getStringLen), - OPCODE(o71_appendString), - /* F0 */ - OPCODE(o71_concatString), - OPCODE(o71_compareString), - OPCODE(o70_isResourceLoaded), - OPCODE(o72_readINI), - /* F4 */ - OPCODE(o72_writeINI), - OPCODE(o71_getStringLenForWidth), - OPCODE(o71_getCharIndexInString), - OPCODE(o71_findBox), - /* F8 */ - OPCODE(o72_getResourceSize), - OPCODE(o72_createDirectory), - OPCODE(o72_setSystemMessage), - OPCODE(o71_polygonOps), - /* FC */ - OPCODE(o71_polygonHit), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - }; - - _opcodesV72he = opcodes; -} - -void ScummEngine_v72he::executeOpcode(byte i) { - OpcodeProcV72he op = _opcodesV72he[i].proc; - (this->*op) (); -} - -const char *ScummEngine_v72he::getOpcodeDesc(byte i) { - return _opcodesV72he[i].desc; + /* 00 */ + OPCODE(0x00, o6_pushByte); + OPCODE(0x01, o6_pushWord); + OPCODE(0x02, o72_pushDWord); + OPCODE(0x03, o6_pushWordVar); + /* 04 */ + OPCODE(0x04, o72_getScriptString); + OPCODE(0x05, o6_invalid); + OPCODE(0x06, o6_invalid); + OPCODE(0x07, o6_wordArrayRead); + /* 08 */ + OPCODE(0x08, o6_invalid); + OPCODE(0x09, o6_invalid); + OPCODE(0x0a, o6_invalid); + OPCODE(0x0b, o6_wordArrayIndexedRead); + /* 0C */ + OPCODE(0x0c, o6_dup); + OPCODE(0x0d, o6_not); + OPCODE(0x0e, o6_eq); + OPCODE(0x0f, o6_neq); + /* 10 */ + OPCODE(0x10, o6_gt); + OPCODE(0x11, o6_lt); + OPCODE(0x12, o6_le); + OPCODE(0x13, o6_ge); + /* 14 */ + OPCODE(0x14, o6_add); + OPCODE(0x15, o6_sub); + OPCODE(0x16, o6_mul); + OPCODE(0x17, o6_div); + /* 18 */ + OPCODE(0x18, o6_land); + OPCODE(0x19, o6_lor); + OPCODE(0x1a, o6_pop); + OPCODE(0x1b, o72_isAnyOf); + /* 1C */ + OPCODE(0x1c, o6_invalid); + OPCODE(0x1d, o6_invalid); + OPCODE(0x1e, o6_invalid); + OPCODE(0x1f, o6_invalid); + /* 20 */ + OPCODE(0x20, o6_invalid); + OPCODE(0x21, o6_invalid); + OPCODE(0x22, o6_invalid); + OPCODE(0x23, o6_invalid); + /* 24 */ + OPCODE(0x24, o6_invalid); + OPCODE(0x25, o6_invalid); + OPCODE(0x26, o6_invalid); + OPCODE(0x27, o6_invalid); + /* 28 */ + OPCODE(0x28, o6_invalid); + OPCODE(0x29, o6_invalid); + OPCODE(0x2a, o6_invalid); + OPCODE(0x2b, o6_invalid); + /* 2C */ + OPCODE(0x2c, o6_invalid); + OPCODE(0x2d, o6_invalid); + OPCODE(0x2e, o6_invalid); + OPCODE(0x2f, o6_invalid); + /* 30 */ + OPCODE(0x30, o6_invalid); + OPCODE(0x31, o6_invalid); + OPCODE(0x32, o6_invalid); + OPCODE(0x33, o6_invalid); + /* 34 */ + OPCODE(0x34, o6_invalid); + OPCODE(0x35, o6_invalid); + OPCODE(0x36, o6_invalid); + OPCODE(0x37, o6_invalid); + /* 38 */ + OPCODE(0x38, o6_invalid); + OPCODE(0x39, o6_invalid); + OPCODE(0x3a, o6_invalid); + OPCODE(0x3b, o6_invalid); + /* 3C */ + OPCODE(0x3c, o6_invalid); + OPCODE(0x3d, o6_invalid); + OPCODE(0x3e, o6_invalid); + OPCODE(0x3f, o6_invalid); + /* 40 */ + OPCODE(0x40, o6_invalid); + OPCODE(0x41, o6_invalid); + OPCODE(0x42, o6_invalid); + OPCODE(0x43, o6_writeWordVar); + /* 44 */ + OPCODE(0x44, o6_invalid); + OPCODE(0x45, o6_invalid); + OPCODE(0x46, o6_invalid); + OPCODE(0x47, o6_wordArrayWrite); + /* 48 */ + OPCODE(0x48, o6_invalid); + OPCODE(0x49, o6_invalid); + OPCODE(0x4a, o6_invalid); + OPCODE(0x4b, o6_wordArrayIndexedWrite); + /* 4C */ + OPCODE(0x4c, o6_invalid); + OPCODE(0x4d, o6_invalid); + OPCODE(0x4e, o6_invalid); + OPCODE(0x4f, o6_wordVarInc); + /* 50 */ + OPCODE(0x50, o72_resetCutscene); + OPCODE(0x51, o6_invalid); + OPCODE(0x52, o72_findObjectWithClassOf); + OPCODE(0x53, o6_wordArrayInc); + /* 54 */ + OPCODE(0x54, o72_getObjectImageX); + OPCODE(0x55, o72_getObjectImageY); + OPCODE(0x56, o72_captureWizImage); + OPCODE(0x57, o6_wordVarDec); + /* 58 */ + OPCODE(0x58, o72_getTimer); + OPCODE(0x59, o72_setTimer); + OPCODE(0x5a, o72_getSoundPosition); + OPCODE(0x5b, o6_wordArrayDec); + /* 5C */ + OPCODE(0x5c, o6_if); + OPCODE(0x5d, o6_ifNot); + OPCODE(0x5e, o72_startScript); + OPCODE(0x5f, o6_startScriptQuick); + /* 60 */ + OPCODE(0x60, o72_startObject); + OPCODE(0x61, o72_drawObject); + OPCODE(0x62, o72_printWizImage); + OPCODE(0x63, o72_getArrayDimSize); + /* 64 */ + OPCODE(0x64, o72_getNumFreeArrays); + OPCODE(0x65, o6_stopObjectCode); + OPCODE(0x66, o6_stopObjectCode); + OPCODE(0x67, o6_endCutscene); + /* 68 */ + OPCODE(0x68, o6_cutscene); + OPCODE(0x69, o6_stopMusic); + OPCODE(0x6a, o6_freezeUnfreeze); + OPCODE(0x6b, o6_cursorCommand); + /* 6C */ + OPCODE(0x6c, o6_breakHere); + OPCODE(0x6d, o6_ifClassOfIs); + OPCODE(0x6e, o6_setClass); + OPCODE(0x6f, o6_getState); + /* 70 */ + OPCODE(0x70, o60_setState); + OPCODE(0x71, o6_setOwner); + OPCODE(0x72, o6_getOwner); + OPCODE(0x73, o6_jump); + /* 74 */ + OPCODE(0x74, o70_startSound); + OPCODE(0x75, o6_stopSound); + OPCODE(0x76, o6_startMusic); + OPCODE(0x77, o6_stopObjectScript); + /* 78 */ + OPCODE(0x78, o6_panCameraTo); + OPCODE(0x79, o6_actorFollowCamera); + OPCODE(0x7a, o6_setCameraAt); + OPCODE(0x7b, o6_loadRoom); + /* 7C */ + OPCODE(0x7c, o6_stopScript); + OPCODE(0x7d, o6_walkActorToObj); + OPCODE(0x7e, o6_walkActorTo); + OPCODE(0x7f, o6_putActorAtXY); + /* 80 */ + OPCODE(0x80, o6_putActorAtObject); + OPCODE(0x81, o6_faceActor); + OPCODE(0x82, o6_animateActor); + OPCODE(0x83, o6_doSentence); + /* 84 */ + OPCODE(0x84, o70_pickupObject); + OPCODE(0x85, o6_loadRoomWithEgo); + OPCODE(0x86, o6_invalid); + OPCODE(0x87, o6_getRandomNumber); + /* 88 */ + OPCODE(0x88, o6_getRandomNumberRange); + OPCODE(0x89, o6_invalid); + OPCODE(0x8a, o6_getActorMoving); + OPCODE(0x8b, o6_isScriptRunning); + /* 8C */ + OPCODE(0x8c, o70_getActorRoom); + OPCODE(0x8d, o6_getObjectX); + OPCODE(0x8e, o6_getObjectY); + OPCODE(0x8f, o6_getObjectOldDir); + /* 90 */ + OPCODE(0x90, o6_getActorWalkBox); + OPCODE(0x91, o6_getActorCostume); + OPCODE(0x92, o6_findInventory); + OPCODE(0x93, o6_getInventoryCount); + /* 94 */ + OPCODE(0x94, o6_getVerbFromXY); + OPCODE(0x95, o6_beginOverride); + OPCODE(0x96, o6_endOverride); + OPCODE(0x97, o6_invalid); + /* 98 */ + OPCODE(0x98, o6_isSoundRunning); + OPCODE(0x99, o6_setBoxFlags); + OPCODE(0x9a, o6_invalid); + OPCODE(0x9b, o70_resourceRoutines); + /* 9C */ + OPCODE(0x9c, o72_roomOps); + OPCODE(0x9d, o72_actorOps); + OPCODE(0x9e, o72_verbOps); + OPCODE(0x9f, o6_getActorFromXY); + /* A0 */ + OPCODE(0xa0, o72_findObject); + OPCODE(0xa1, o6_pseudoRoom); + OPCODE(0xa2, o6_getActorElevation); + OPCODE(0xa3, o6_getVerbEntrypoint); + /* A4 */ + OPCODE(0xa4, o72_arrayOps); + OPCODE(0xa5, o6_saveRestoreVerbs); + OPCODE(0xa6, o6_drawBox); + OPCODE(0xa7, o6_pop); + /* A8 */ + OPCODE(0xa8, o6_getActorWidth); + OPCODE(0xa9, o6_wait); + OPCODE(0xaa, o6_getActorScaleX); + OPCODE(0xab, o6_getActorAnimCounter); + /* AC */ + OPCODE(0xac, o6_invalid); + OPCODE(0xad, o6_isAnyOf); + OPCODE(0xae, o72_systemOps); + OPCODE(0xaf, o6_isActorInBox); + /* B0 */ + OPCODE(0xb0, o6_delay); + OPCODE(0xb1, o6_delaySeconds); + OPCODE(0xb2, o6_delayMinutes); + OPCODE(0xb3, o6_stopSentence); + /* B4 */ + OPCODE(0xb4, o6_printLine); + OPCODE(0xb5, o6_printText); + OPCODE(0xb6, o6_printDebug); + OPCODE(0xb7, o6_printSystem); + /* B8 */ + OPCODE(0xb8, o6_printActor); + OPCODE(0xb9, o6_printEgo); + OPCODE(0xba, o72_talkActor); + OPCODE(0xbb, o72_talkEgo); + /* BC */ + OPCODE(0xbc, o72_dimArray); + OPCODE(0xbd, o6_stopObjectCode); + OPCODE(0xbe, o6_startObjectQuick); + OPCODE(0xbf, o6_startScriptQuick2); + /* C0 */ + OPCODE(0xc0, o72_dim2dimArray); + OPCODE(0xc1, o72_traceStatus); + OPCODE(0xc2, o6_invalid); + OPCODE(0xc3, o6_invalid); + /* C4 */ + OPCODE(0xc4, o6_abs); + OPCODE(0xc5, o6_distObjectObject); + OPCODE(0xc6, o6_distObjectPt); + OPCODE(0xc7, o6_distPtPt); + /* C8 */ + OPCODE(0xc8, o72_kernelGetFunctions); + OPCODE(0xc9, o71_kernelSetFunctions); + OPCODE(0xca, o6_delayFrames); + OPCODE(0xcb, o6_pickOneOf); + /* CC */ + OPCODE(0xcc, o6_pickOneOfDefault); + OPCODE(0xcd, o6_stampObject); + OPCODE(0xce, o72_drawWizImage); + OPCODE(0xcf, o72_debugInput); + /* D0 */ + OPCODE(0xd0, o6_getDateTime); + OPCODE(0xd1, o6_stopTalking); + OPCODE(0xd2, o6_getAnimateVariable); + OPCODE(0xd3, o6_invalid); + /* D4 */ + OPCODE(0xd4, o6_shuffle); + OPCODE(0xd5, o72_jumpToScript); + OPCODE(0xd6, o6_band); + OPCODE(0xd7, o6_bor); + /* D8 */ + OPCODE(0xd8, o6_isRoomScriptRunning); + OPCODE(0xd9, o60_closeFile); + OPCODE(0xda, o72_openFile); + OPCODE(0xdb, o72_readFile); + /* DC */ + OPCODE(0xdc, o72_writeFile); + OPCODE(0xdd, o72_findAllObjects); + OPCODE(0xde, o72_deleteFile); + OPCODE(0xdf, o72_rename); + /* E0 */ + OPCODE(0xe0, o60_soundOps); + OPCODE(0xe1, o72_getPixel); + OPCODE(0xe2, o60_localizeArrayToScript); + OPCODE(0xe3, o72_pickVarRandom); + /* E4 */ + OPCODE(0xe4, o6_setBoxSet); + OPCODE(0xe5, o6_invalid); + OPCODE(0xe6, o6_invalid); + OPCODE(0xe7, o6_invalid); + /* E8 */ + OPCODE(0xe8, o6_invalid); + OPCODE(0xe9, o60_seekFilePos); + OPCODE(0xea, o72_redimArray); + OPCODE(0xeb, o60_readFilePos); + /* EC */ + OPCODE(0xec, o71_copyString); + OPCODE(0xed, o71_getStringWidth); + OPCODE(0xee, o70_getStringLen); + OPCODE(0xef, o71_appendString); + /* F0 */ + OPCODE(0xf0, o71_concatString); + OPCODE(0xf1, o71_compareString); + OPCODE(0xf2, o70_isResourceLoaded); + OPCODE(0xf3, o72_readINI); + /* F4 */ + OPCODE(0xf4, o72_writeINI); + OPCODE(0xf5, o71_getStringLenForWidth); + OPCODE(0xf6, o71_getCharIndexInString); + OPCODE(0xf7, o71_findBox); + /* F8 */ + OPCODE(0xf8, o72_getResourceSize); + OPCODE(0xf9, o72_createDirectory); + OPCODE(0xfa, o72_setSystemMessage); + OPCODE(0xfb, o71_polygonOps); + /* FC */ + OPCODE(0xfc, o71_polygonHit); + OPCODE(0xfd, o6_invalid); + OPCODE(0xfe, o6_invalid); + OPCODE(0xff, o6_invalid); } static const int arrayDataSizes[] = { 0, 1, 4, 8, 8, 16, 32 }; diff --git a/engines/scumm/he/script_v80he.cpp b/engines/scumm/he/script_v80he.cpp index 55dc62c38d..61ccad798b 100644 --- a/engines/scumm/he/script_v80he.cpp +++ b/engines/scumm/he/script_v80he.cpp @@ -39,343 +39,331 @@ namespace Scumm { -#define OPCODE(x) _OPCODE(ScummEngine_v80he, x) +#define OPCODE(i, x) _opcodes[i]._OPCODE(ScummEngine_v80he, x) void ScummEngine_v80he::setupOpcodes() { - static const OpcodeEntryV80he opcodes[256] = { - /* 00 */ - OPCODE(o6_pushByte), - OPCODE(o6_pushWord), - OPCODE(o72_pushDWord), - OPCODE(o6_pushWordVar), - /* 04 */ - OPCODE(o72_getScriptString), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_wordArrayRead), - /* 08 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_wordArrayIndexedRead), - /* 0C */ - OPCODE(o6_dup), - OPCODE(o6_not), - OPCODE(o6_eq), - OPCODE(o6_neq), - /* 10 */ - OPCODE(o6_gt), - OPCODE(o6_lt), - OPCODE(o6_le), - OPCODE(o6_ge), - /* 14 */ - OPCODE(o6_add), - OPCODE(o6_sub), - OPCODE(o6_mul), - OPCODE(o6_div), - /* 18 */ - OPCODE(o6_land), - OPCODE(o6_lor), - OPCODE(o6_pop), - OPCODE(o72_isAnyOf), - /* 1C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 20 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 24 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 28 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 2C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 30 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 34 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 38 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 3C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 40 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_writeWordVar), - /* 44 */ - OPCODE(o6_invalid), - OPCODE(o80_createSound), - OPCODE(o80_getFileSize), - OPCODE(o6_wordArrayWrite), - /* 48 */ - OPCODE(o80_stringToInt), - OPCODE(o80_getSoundVar), - OPCODE(o80_localizeArrayToRoom), - OPCODE(o6_wordArrayIndexedWrite), - /* 4C */ - OPCODE(o80_sourceDebug), - OPCODE(o80_readConfigFile), - OPCODE(o80_writeConfigFile), - OPCODE(o6_wordVarInc), - /* 50 */ - OPCODE(o72_resetCutscene), - OPCODE(o6_invalid), - OPCODE(o72_findObjectWithClassOf), - OPCODE(o6_wordArrayInc), - /* 54 */ - OPCODE(o72_getObjectImageX), - OPCODE(o72_getObjectImageY), - OPCODE(o72_captureWizImage), - OPCODE(o6_wordVarDec), - /* 58 */ - OPCODE(o72_getTimer), - OPCODE(o72_setTimer), - OPCODE(o72_getSoundPosition), - OPCODE(o6_wordArrayDec), - /* 5C */ - OPCODE(o6_if), - OPCODE(o6_ifNot), - OPCODE(o72_startScript), - OPCODE(o6_startScriptQuick), - /* 60 */ - OPCODE(o72_startObject), - OPCODE(o72_drawObject), - OPCODE(o72_printWizImage), - OPCODE(o72_getArrayDimSize), - /* 64 */ - OPCODE(o72_getNumFreeArrays), - OPCODE(o6_stopObjectCode), - OPCODE(o6_stopObjectCode), - OPCODE(o6_endCutscene), - /* 68 */ - OPCODE(o6_cutscene), - OPCODE(o6_invalid), - OPCODE(o6_freezeUnfreeze), - OPCODE(o80_cursorCommand), - /* 6C */ - OPCODE(o6_breakHere), - OPCODE(o6_ifClassOfIs), - OPCODE(o6_setClass), - OPCODE(o6_getState), - /* 70 */ - OPCODE(o80_setState), - OPCODE(o6_setOwner), - OPCODE(o6_getOwner), - OPCODE(o6_jump), - /* 74 */ - OPCODE(o70_startSound), - OPCODE(o6_stopSound), - OPCODE(o6_invalid), - OPCODE(o6_stopObjectScript), - /* 78 */ - OPCODE(o6_panCameraTo), - OPCODE(o6_actorFollowCamera), - OPCODE(o6_setCameraAt), - OPCODE(o6_loadRoom), - /* 7C */ - OPCODE(o6_stopScript), - OPCODE(o6_walkActorToObj), - OPCODE(o6_walkActorTo), - OPCODE(o6_putActorAtXY), - /* 80 */ - OPCODE(o6_putActorAtObject), - OPCODE(o6_faceActor), - OPCODE(o6_animateActor), - OPCODE(o6_doSentence), - /* 84 */ - OPCODE(o70_pickupObject), - OPCODE(o6_loadRoomWithEgo), - OPCODE(o6_invalid), - OPCODE(o6_getRandomNumber), - /* 88 */ - OPCODE(o6_getRandomNumberRange), - OPCODE(o6_invalid), - OPCODE(o6_getActorMoving), - OPCODE(o6_isScriptRunning), - /* 8C */ - OPCODE(o70_getActorRoom), - OPCODE(o6_getObjectX), - OPCODE(o6_getObjectY), - OPCODE(o6_getObjectOldDir), - /* 90 */ - OPCODE(o6_getActorWalkBox), - OPCODE(o6_getActorCostume), - OPCODE(o6_findInventory), - OPCODE(o6_getInventoryCount), - /* 94 */ - OPCODE(o6_invalid), - OPCODE(o6_beginOverride), - OPCODE(o6_endOverride), - OPCODE(o6_invalid), - /* 98 */ - OPCODE(o6_isSoundRunning), - OPCODE(o6_setBoxFlags), - OPCODE(o6_invalid), - OPCODE(o70_resourceRoutines), - /* 9C */ - OPCODE(o72_roomOps), - OPCODE(o72_actorOps), - OPCODE(o6_invalid), - OPCODE(o6_getActorFromXY), - /* A0 */ - OPCODE(o72_findObject), - OPCODE(o6_pseudoRoom), - OPCODE(o6_getActorElevation), - OPCODE(o6_getVerbEntrypoint), - /* A4 */ - OPCODE(o72_arrayOps), - OPCODE(o6_invalid), - OPCODE(o6_drawBox), - OPCODE(o6_pop), - /* A8 */ - OPCODE(o6_getActorWidth), - OPCODE(o6_wait), - OPCODE(o6_getActorScaleX), - OPCODE(o6_getActorAnimCounter), - /* AC */ - OPCODE(o80_drawWizPolygon), - OPCODE(o6_isAnyOf), - OPCODE(o72_systemOps), - OPCODE(o6_isActorInBox), - /* B0 */ - OPCODE(o6_delay), - OPCODE(o6_delaySeconds), - OPCODE(o6_delayMinutes), - OPCODE(o6_stopSentence), - /* B4 */ - OPCODE(o6_printLine), - OPCODE(o6_printText), - OPCODE(o6_printDebug), - OPCODE(o6_printSystem), - /* B8 */ - OPCODE(o6_printActor), - OPCODE(o6_printEgo), - OPCODE(o72_talkActor), - OPCODE(o72_talkEgo), - /* BC */ - OPCODE(o72_dimArray), - OPCODE(o6_stopObjectCode), - OPCODE(o6_startObjectQuick), - OPCODE(o6_startScriptQuick2), - /* C0 */ - OPCODE(o72_dim2dimArray), - OPCODE(o72_traceStatus), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* C4 */ - OPCODE(o6_abs), - OPCODE(o6_distObjectObject), - OPCODE(o6_distObjectPt), - OPCODE(o6_distPtPt), - /* C8 */ - OPCODE(o72_kernelGetFunctions), - OPCODE(o71_kernelSetFunctions), - OPCODE(o6_delayFrames), - OPCODE(o6_pickOneOf), - /* CC */ - OPCODE(o6_pickOneOfDefault), - OPCODE(o6_stampObject), - OPCODE(o72_drawWizImage), - OPCODE(o72_debugInput), - /* D0 */ - OPCODE(o6_getDateTime), - OPCODE(o6_stopTalking), - OPCODE(o6_getAnimateVariable), - OPCODE(o6_invalid), - /* D4 */ - OPCODE(o6_shuffle), - OPCODE(o72_jumpToScript), - OPCODE(o6_band), - OPCODE(o6_bor), - /* D8 */ - OPCODE(o6_isRoomScriptRunning), - OPCODE(o60_closeFile), - OPCODE(o72_openFile), - OPCODE(o72_readFile), - /* DC */ - OPCODE(o72_writeFile), - OPCODE(o72_findAllObjects), - OPCODE(o72_deleteFile), - OPCODE(o72_rename), - /* E0 */ - OPCODE(o80_drawLine), - OPCODE(o72_getPixel), - OPCODE(o60_localizeArrayToScript), - OPCODE(o80_pickVarRandom), - /* E4 */ - OPCODE(o6_setBoxSet), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* E8 */ - OPCODE(o6_invalid), - OPCODE(o60_seekFilePos), - OPCODE(o72_redimArray), - OPCODE(o60_readFilePos), - /* EC */ - OPCODE(o71_copyString), - OPCODE(o71_getStringWidth), - OPCODE(o70_getStringLen), - OPCODE(o71_appendString), - /* F0 */ - OPCODE(o71_concatString), - OPCODE(o71_compareString), - OPCODE(o70_isResourceLoaded), - OPCODE(o72_readINI), - /* F4 */ - OPCODE(o72_writeINI), - OPCODE(o71_getStringLenForWidth), - OPCODE(o71_getCharIndexInString), - OPCODE(o71_findBox), - /* F8 */ - OPCODE(o72_getResourceSize), - OPCODE(o72_createDirectory), - OPCODE(o72_setSystemMessage), - OPCODE(o71_polygonOps), - /* FC */ - OPCODE(o71_polygonHit), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - }; - - _opcodesV80he = opcodes; + /* 00 */ + OPCODE(0x00, o6_pushByte); + OPCODE(0x01, o6_pushWord); + OPCODE(0x02, o72_pushDWord); + OPCODE(0x03, o6_pushWordVar); + /* 04 */ + OPCODE(0x04, o72_getScriptString); + OPCODE(0x05, o6_invalid); + OPCODE(0x06, o6_invalid); + OPCODE(0x07, o6_wordArrayRead); + /* 08 */ + OPCODE(0x08, o6_invalid); + OPCODE(0x09, o6_invalid); + OPCODE(0x0a, o6_invalid); + OPCODE(0x0b, o6_wordArrayIndexedRead); + /* 0C */ + OPCODE(0x0c, o6_dup); + OPCODE(0x0d, o6_not); + OPCODE(0x0e, o6_eq); + OPCODE(0x0f, o6_neq); + /* 10 */ + OPCODE(0x10, o6_gt); + OPCODE(0x11, o6_lt); + OPCODE(0x12, o6_le); + OPCODE(0x13, o6_ge); + /* 14 */ + OPCODE(0x14, o6_add); + OPCODE(0x15, o6_sub); + OPCODE(0x16, o6_mul); + OPCODE(0x17, o6_div); + /* 18 */ + OPCODE(0x18, o6_land); + OPCODE(0x19, o6_lor); + OPCODE(0x1a, o6_pop); + OPCODE(0x1b, o72_isAnyOf); + /* 1C */ + OPCODE(0x1c, o6_invalid); + OPCODE(0x1d, o6_invalid); + OPCODE(0x1e, o6_invalid); + OPCODE(0x1f, o6_invalid); + /* 20 */ + OPCODE(0x20, o6_invalid); + OPCODE(0x21, o6_invalid); + OPCODE(0x22, o6_invalid); + OPCODE(0x23, o6_invalid); + /* 24 */ + OPCODE(0x24, o6_invalid); + OPCODE(0x25, o6_invalid); + OPCODE(0x26, o6_invalid); + OPCODE(0x27, o6_invalid); + /* 28 */ + OPCODE(0x28, o6_invalid); + OPCODE(0x29, o6_invalid); + OPCODE(0x2a, o6_invalid); + OPCODE(0x2b, o6_invalid); + /* 2C */ + OPCODE(0x2c, o6_invalid); + OPCODE(0x2d, o6_invalid); + OPCODE(0x2e, o6_invalid); + OPCODE(0x2f, o6_invalid); + /* 30 */ + OPCODE(0x30, o6_invalid); + OPCODE(0x31, o6_invalid); + OPCODE(0x32, o6_invalid); + OPCODE(0x33, o6_invalid); + /* 34 */ + OPCODE(0x34, o6_invalid); + OPCODE(0x35, o6_invalid); + OPCODE(0x36, o6_invalid); + OPCODE(0x37, o6_invalid); + /* 38 */ + OPCODE(0x38, o6_invalid); + OPCODE(0x39, o6_invalid); + OPCODE(0x3a, o6_invalid); + OPCODE(0x3b, o6_invalid); + /* 3C */ + OPCODE(0x3c, o6_invalid); + OPCODE(0x3d, o6_invalid); + OPCODE(0x3e, o6_invalid); + OPCODE(0x3f, o6_invalid); + /* 40 */ + OPCODE(0x40, o6_invalid); + OPCODE(0x41, o6_invalid); + OPCODE(0x42, o6_invalid); + OPCODE(0x43, o6_writeWordVar); + /* 44 */ + OPCODE(0x44, o6_invalid); + OPCODE(0x45, o80_createSound); + OPCODE(0x46, o80_getFileSize); + OPCODE(0x47, o6_wordArrayWrite); + /* 48 */ + OPCODE(0x48, o80_stringToInt); + OPCODE(0x49, o80_getSoundVar); + OPCODE(0x4a, o80_localizeArrayToRoom); + OPCODE(0x4b, o6_wordArrayIndexedWrite); + /* 4C */ + OPCODE(0x4c, o80_sourceDebug); + OPCODE(0x4d, o80_readConfigFile); + OPCODE(0x4e, o80_writeConfigFile); + OPCODE(0x4f, o6_wordVarInc); + /* 50 */ + OPCODE(0x50, o72_resetCutscene); + OPCODE(0x51, o6_invalid); + OPCODE(0x52, o72_findObjectWithClassOf); + OPCODE(0x53, o6_wordArrayInc); + /* 54 */ + OPCODE(0x54, o72_getObjectImageX); + OPCODE(0x55, o72_getObjectImageY); + OPCODE(0x56, o72_captureWizImage); + OPCODE(0x57, o6_wordVarDec); + /* 58 */ + OPCODE(0x58, o72_getTimer); + OPCODE(0x59, o72_setTimer); + OPCODE(0x5a, o72_getSoundPosition); + OPCODE(0x5b, o6_wordArrayDec); + /* 5C */ + OPCODE(0x5c, o6_if); + OPCODE(0x5d, o6_ifNot); + OPCODE(0x5e, o72_startScript); + OPCODE(0x5f, o6_startScriptQuick); + /* 60 */ + OPCODE(0x60, o72_startObject); + OPCODE(0x61, o72_drawObject); + OPCODE(0x62, o72_printWizImage); + OPCODE(0x63, o72_getArrayDimSize); + /* 64 */ + OPCODE(0x64, o72_getNumFreeArrays); + OPCODE(0x65, o6_stopObjectCode); + OPCODE(0x66, o6_stopObjectCode); + OPCODE(0x67, o6_endCutscene); + /* 68 */ + OPCODE(0x68, o6_cutscene); + OPCODE(0x69, o6_invalid); + OPCODE(0x6a, o6_freezeUnfreeze); + OPCODE(0x6b, o80_cursorCommand); + /* 6C */ + OPCODE(0x6c, o6_breakHere); + OPCODE(0x6d, o6_ifClassOfIs); + OPCODE(0x6e, o6_setClass); + OPCODE(0x6f, o6_getState); + /* 70 */ + OPCODE(0x70, o80_setState); + OPCODE(0x71, o6_setOwner); + OPCODE(0x72, o6_getOwner); + OPCODE(0x73, o6_jump); + /* 74 */ + OPCODE(0x74, o70_startSound); + OPCODE(0x75, o6_stopSound); + OPCODE(0x76, o6_invalid); + OPCODE(0x77, o6_stopObjectScript); + /* 78 */ + OPCODE(0x78, o6_panCameraTo); + OPCODE(0x79, o6_actorFollowCamera); + OPCODE(0x7a, o6_setCameraAt); + OPCODE(0x7b, o6_loadRoom); + /* 7C */ + OPCODE(0x7c, o6_stopScript); + OPCODE(0x7d, o6_walkActorToObj); + OPCODE(0x7e, o6_walkActorTo); + OPCODE(0x7f, o6_putActorAtXY); + /* 80 */ + OPCODE(0x80, o6_putActorAtObject); + OPCODE(0x81, o6_faceActor); + OPCODE(0x82, o6_animateActor); + OPCODE(0x83, o6_doSentence); + /* 84 */ + OPCODE(0x84, o70_pickupObject); + OPCODE(0x85, o6_loadRoomWithEgo); + OPCODE(0x86, o6_invalid); + OPCODE(0x87, o6_getRandomNumber); + /* 88 */ + OPCODE(0x88, o6_getRandomNumberRange); + OPCODE(0x89, o6_invalid); + OPCODE(0x8a, o6_getActorMoving); + OPCODE(0x8b, o6_isScriptRunning); + /* 8C */ + OPCODE(0x8c, o70_getActorRoom); + OPCODE(0x8d, o6_getObjectX); + OPCODE(0x8e, o6_getObjectY); + OPCODE(0x8f, o6_getObjectOldDir); + /* 90 */ + OPCODE(0x90, o6_getActorWalkBox); + OPCODE(0x91, o6_getActorCostume); + OPCODE(0x92, o6_findInventory); + OPCODE(0x93, o6_getInventoryCount); + /* 94 */ + OPCODE(0x94, o6_invalid); + OPCODE(0x95, o6_beginOverride); + OPCODE(0x96, o6_endOverride); + OPCODE(0x97, o6_invalid); + /* 98 */ + OPCODE(0x98, o6_isSoundRunning); + OPCODE(0x99, o6_setBoxFlags); + OPCODE(0x9a, o6_invalid); + OPCODE(0x9b, o70_resourceRoutines); + /* 9C */ + OPCODE(0x9c, o72_roomOps); + OPCODE(0x9d, o72_actorOps); + OPCODE(0x9e, o6_invalid); + OPCODE(0x9f, o6_getActorFromXY); + /* A0 */ + OPCODE(0xa0, o72_findObject); + OPCODE(0xa1, o6_pseudoRoom); + OPCODE(0xa2, o6_getActorElevation); + OPCODE(0xa3, o6_getVerbEntrypoint); + /* A4 */ + OPCODE(0xa4, o72_arrayOps); + OPCODE(0xa5, o6_invalid); + OPCODE(0xa6, o6_drawBox); + OPCODE(0xa7, o6_pop); + /* A8 */ + OPCODE(0xa8, o6_getActorWidth); + OPCODE(0xa9, o6_wait); + OPCODE(0xaa, o6_getActorScaleX); + OPCODE(0xab, o6_getActorAnimCounter); + /* AC */ + OPCODE(0xac, o80_drawWizPolygon); + OPCODE(0xad, o6_isAnyOf); + OPCODE(0xae, o72_systemOps); + OPCODE(0xaf, o6_isActorInBox); + /* B0 */ + OPCODE(0xb0, o6_delay); + OPCODE(0xb1, o6_delaySeconds); + OPCODE(0xb2, o6_delayMinutes); + OPCODE(0xb3, o6_stopSentence); + /* B4 */ + OPCODE(0xb4, o6_printLine); + OPCODE(0xb5, o6_printText); + OPCODE(0xb6, o6_printDebug); + OPCODE(0xb7, o6_printSystem); + /* B8 */ + OPCODE(0xb8, o6_printActor); + OPCODE(0xb9, o6_printEgo); + OPCODE(0xba, o72_talkActor); + OPCODE(0xbb, o72_talkEgo); + /* BC */ + OPCODE(0xbc, o72_dimArray); + OPCODE(0xbd, o6_stopObjectCode); + OPCODE(0xbe, o6_startObjectQuick); + OPCODE(0xbf, o6_startScriptQuick2); + /* C0 */ + OPCODE(0xc0, o72_dim2dimArray); + OPCODE(0xc1, o72_traceStatus); + OPCODE(0xc2, o6_invalid); + OPCODE(0xc3, o6_invalid); + /* C4 */ + OPCODE(0xc4, o6_abs); + OPCODE(0xc5, o6_distObjectObject); + OPCODE(0xc6, o6_distObjectPt); + OPCODE(0xc7, o6_distPtPt); + /* C8 */ + OPCODE(0xc8, o72_kernelGetFunctions); + OPCODE(0xc9, o71_kernelSetFunctions); + OPCODE(0xca, o6_delayFrames); + OPCODE(0xcb, o6_pickOneOf); + /* CC */ + OPCODE(0xcc, o6_pickOneOfDefault); + OPCODE(0xcd, o6_stampObject); + OPCODE(0xce, o72_drawWizImage); + OPCODE(0xcf, o72_debugInput); + /* D0 */ + OPCODE(0xd0, o6_getDateTime); + OPCODE(0xd1, o6_stopTalking); + OPCODE(0xd2, o6_getAnimateVariable); + OPCODE(0xd3, o6_invalid); + /* D4 */ + OPCODE(0xd4, o6_shuffle); + OPCODE(0xd5, o72_jumpToScript); + OPCODE(0xd6, o6_band); + OPCODE(0xd7, o6_bor); + /* D8 */ + OPCODE(0xd8, o6_isRoomScriptRunning); + OPCODE(0xd9, o60_closeFile); + OPCODE(0xda, o72_openFile); + OPCODE(0xdb, o72_readFile); + /* DC */ + OPCODE(0xdc, o72_writeFile); + OPCODE(0xdd, o72_findAllObjects); + OPCODE(0xde, o72_deleteFile); + OPCODE(0xdf, o72_rename); + /* E0 */ + OPCODE(0xe0, o80_drawLine); + OPCODE(0xe1, o72_getPixel); + OPCODE(0xe2, o60_localizeArrayToScript); + OPCODE(0xe3, o80_pickVarRandom); + /* E4 */ + OPCODE(0xe4, o6_setBoxSet); + OPCODE(0xe5, o6_invalid); + OPCODE(0xe6, o6_invalid); + OPCODE(0xe7, o6_invalid); + /* E8 */ + OPCODE(0xe8, o6_invalid); + OPCODE(0xe9, o60_seekFilePos); + OPCODE(0xea, o72_redimArray); + OPCODE(0xeb, o60_readFilePos); + /* EC */ + OPCODE(0xec, o71_copyString); + OPCODE(0xed, o71_getStringWidth); + OPCODE(0xee, o70_getStringLen); + OPCODE(0xef, o71_appendString); + /* F0 */ + OPCODE(0xf0, o71_concatString); + OPCODE(0xf1, o71_compareString); + OPCODE(0xf2, o70_isResourceLoaded); + OPCODE(0xf3, o72_readINI); + /* F4 */ + OPCODE(0xf4, o72_writeINI); + OPCODE(0xf5, o71_getStringLenForWidth); + OPCODE(0xf6, o71_getCharIndexInString); + OPCODE(0xf7, o71_findBox); + /* F8 */ + OPCODE(0xf8, o72_getResourceSize); + OPCODE(0xf9, o72_createDirectory); + OPCODE(0xfa, o72_setSystemMessage); + OPCODE(0xfb, o71_polygonOps); + /* FC */ + OPCODE(0xfc, o71_polygonHit); + OPCODE(0xfd, o6_invalid); + OPCODE(0xfe, o6_invalid); + OPCODE(0xff, o6_invalid); } -void ScummEngine_v80he::executeOpcode(byte i) { - OpcodeProcV80he op = _opcodesV80he[i].proc; - (this->*op) (); -} - -const char *ScummEngine_v80he::getOpcodeDesc(byte i) { - return _opcodesV80he[i].desc; -} void ScummEngine_v80he::o80_createSound() { byte subOp = fetchScriptByte(); diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp index 832a61f85e..933cffa2ec 100644 --- a/engines/scumm/he/script_v90he.cpp +++ b/engines/scumm/he/script_v90he.cpp @@ -38,342 +38,329 @@ namespace Scumm { -#define OPCODE(x) _OPCODE(ScummEngine_v90he, x) +#define OPCODE(i, x) _opcodes[i]._OPCODE(ScummEngine_v90he, x) void ScummEngine_v90he::setupOpcodes() { - static const OpcodeEntryV90he opcodes[256] = { - /* 00 */ - OPCODE(o6_pushByte), - OPCODE(o6_pushWord), - OPCODE(o72_pushDWord), - OPCODE(o6_pushWordVar), - /* 04 */ - OPCODE(o72_getScriptString), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_wordArrayRead), - /* 08 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o90_dup_n), - OPCODE(o6_wordArrayIndexedRead), - /* 0C */ - OPCODE(o6_dup), - OPCODE(o6_not), - OPCODE(o6_eq), - OPCODE(o6_neq), - /* 10 */ - OPCODE(o6_gt), - OPCODE(o6_lt), - OPCODE(o6_le), - OPCODE(o6_ge), - /* 14 */ - OPCODE(o6_add), - OPCODE(o6_sub), - OPCODE(o6_mul), - OPCODE(o6_div), - /* 18 */ - OPCODE(o6_land), - OPCODE(o6_lor), - OPCODE(o6_pop), - OPCODE(o72_isAnyOf), - /* 1C */ - OPCODE(o90_wizImageOps), - OPCODE(o90_min), - OPCODE(o90_max), - OPCODE(o90_sin), - /* 20 */ - OPCODE(o90_cos), - OPCODE(o90_sqrt), - OPCODE(o90_atan2), - OPCODE(o90_getSegmentAngle), - /* 24 */ - OPCODE(o90_getDistanceBetweenPoints), - OPCODE(o90_getSpriteInfo), - OPCODE(o90_setSpriteInfo), - OPCODE(o90_getSpriteGroupInfo), - /* 28 */ - OPCODE(o90_setSpriteGroupInfo), - OPCODE(o90_getWizData), - OPCODE(o90_getActorData), - OPCODE(o90_startScriptUnk), - /* 2C */ - OPCODE(o90_jumpToScriptUnk), - OPCODE(o90_videoOps), - OPCODE(o90_getVideoData), - OPCODE(o90_floodFill), - /* 30 */ - OPCODE(o90_mod), - OPCODE(o90_shl), - OPCODE(o90_shr), - OPCODE(o90_xor), - /* 34 */ - OPCODE(o90_findAllObjectsWithClassOf), - OPCODE(o90_getPolygonOverlap), - OPCODE(o90_cond), - OPCODE(o90_dim2dim2Array), - /* 38 */ - OPCODE(o90_redim2dimArray), - OPCODE(o90_getLinesIntersectionPoint), - OPCODE(o90_sortArray), - OPCODE(o6_invalid), - /* 3C */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* 40 */ - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_writeWordVar), - /* 44 */ - OPCODE(o90_getObjectData), - OPCODE(o80_createSound), - OPCODE(o80_getFileSize), - OPCODE(o6_wordArrayWrite), - /* 48 */ - OPCODE(o80_stringToInt), - OPCODE(o80_getSoundVar), - OPCODE(o80_localizeArrayToRoom), - OPCODE(o6_wordArrayIndexedWrite), - /* 4C */ - OPCODE(o80_sourceDebug), - OPCODE(o80_readConfigFile), - OPCODE(o80_writeConfigFile), - OPCODE(o6_wordVarInc), - /* 50 */ - OPCODE(o72_resetCutscene), - OPCODE(o6_invalid), - OPCODE(o72_findObjectWithClassOf), - OPCODE(o6_wordArrayInc), - /* 54 */ - OPCODE(o72_getObjectImageX), - OPCODE(o72_getObjectImageY), - OPCODE(o72_captureWizImage), - OPCODE(o6_wordVarDec), - /* 58 */ - OPCODE(o72_getTimer), - OPCODE(o72_setTimer), - OPCODE(o72_getSoundPosition), - OPCODE(o6_wordArrayDec), - /* 5C */ - OPCODE(o6_if), - OPCODE(o6_ifNot), - OPCODE(o72_startScript), - OPCODE(o6_startScriptQuick), - /* 60 */ - OPCODE(o72_startObject), - OPCODE(o72_drawObject), - OPCODE(o72_printWizImage), - OPCODE(o72_getArrayDimSize), - /* 64 */ - OPCODE(o72_getNumFreeArrays), - OPCODE(o6_stopObjectCode), - OPCODE(o6_stopObjectCode), - OPCODE(o6_endCutscene), - /* 68 */ - OPCODE(o6_cutscene), - OPCODE(o6_invalid), - OPCODE(o6_freezeUnfreeze), - OPCODE(o80_cursorCommand), - /* 6C */ - OPCODE(o6_breakHere), - OPCODE(o6_ifClassOfIs), - OPCODE(o6_setClass), - OPCODE(o6_getState), - /* 70 */ - OPCODE(o80_setState), - OPCODE(o6_setOwner), - OPCODE(o6_getOwner), - OPCODE(o6_jump), - /* 74 */ - OPCODE(o70_startSound), - OPCODE(o6_stopSound), - OPCODE(o6_invalid), - OPCODE(o6_stopObjectScript), - /* 78 */ - OPCODE(o6_panCameraTo), - OPCODE(o6_actorFollowCamera), - OPCODE(o6_setCameraAt), - OPCODE(o6_loadRoom), - /* 7C */ - OPCODE(o6_stopScript), - OPCODE(o6_walkActorToObj), - OPCODE(o6_walkActorTo), - OPCODE(o6_putActorAtXY), - /* 80 */ - OPCODE(o6_putActorAtObject), - OPCODE(o6_faceActor), - OPCODE(o6_animateActor), - OPCODE(o6_doSentence), - /* 84 */ - OPCODE(o70_pickupObject), - OPCODE(o6_loadRoomWithEgo), - OPCODE(o6_invalid), - OPCODE(o6_getRandomNumber), - /* 88 */ - OPCODE(o6_getRandomNumberRange), - OPCODE(o6_invalid), - OPCODE(o6_getActorMoving), - OPCODE(o6_isScriptRunning), - /* 8C */ - OPCODE(o70_getActorRoom), - OPCODE(o6_getObjectX), - OPCODE(o6_getObjectY), - OPCODE(o6_getObjectOldDir), - /* 90 */ - OPCODE(o6_getActorWalkBox), - OPCODE(o6_getActorCostume), - OPCODE(o6_findInventory), - OPCODE(o6_getInventoryCount), - /* 94 */ - OPCODE(o90_getPaletteData), - OPCODE(o6_beginOverride), - OPCODE(o6_endOverride), - OPCODE(o6_invalid), - /* 98 */ - OPCODE(o6_isSoundRunning), - OPCODE(o6_setBoxFlags), - OPCODE(o6_invalid), - OPCODE(o70_resourceRoutines), - /* 9C */ - OPCODE(o72_roomOps), - OPCODE(o72_actorOps), - OPCODE(o90_paletteOps), - OPCODE(o6_getActorFromXY), - /* A0 */ - OPCODE(o72_findObject), - OPCODE(o6_pseudoRoom), - OPCODE(o6_getActorElevation), - OPCODE(o6_getVerbEntrypoint), - /* A4 */ - OPCODE(o72_arrayOps), - OPCODE(o90_fontUnk), - OPCODE(o6_drawBox), - OPCODE(o6_pop), - /* A8 */ - OPCODE(o6_getActorWidth), - OPCODE(o6_wait), - OPCODE(o6_getActorScaleX), - OPCODE(o90_getActorAnimProgress), - /* AC */ - OPCODE(o80_drawWizPolygon), - OPCODE(o6_isAnyOf), - OPCODE(o72_systemOps), - OPCODE(o6_isActorInBox), - /* B0 */ - OPCODE(o6_delay), - OPCODE(o6_delaySeconds), - OPCODE(o6_delayMinutes), - OPCODE(o6_stopSentence), - /* B4 */ - OPCODE(o6_printLine), - OPCODE(o6_printText), - OPCODE(o6_printDebug), - OPCODE(o6_printSystem), - /* B8 */ - OPCODE(o6_printActor), - OPCODE(o6_printEgo), - OPCODE(o72_talkActor), - OPCODE(o72_talkEgo), - /* BC */ - OPCODE(o72_dimArray), - OPCODE(o6_stopObjectCode), - OPCODE(o6_startObjectQuick), - OPCODE(o6_startScriptQuick2), - /* C0 */ - OPCODE(o72_dim2dimArray), - OPCODE(o72_traceStatus), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* C4 */ - OPCODE(o6_abs), - OPCODE(o6_distObjectObject), - OPCODE(o6_distObjectPt), - OPCODE(o6_distPtPt), - /* C8 */ - OPCODE(o90_kernelGetFunctions), - OPCODE(o90_kernelSetFunctions), - OPCODE(o6_delayFrames), - OPCODE(o6_pickOneOf), - /* CC */ - OPCODE(o6_pickOneOfDefault), - OPCODE(o6_stampObject), - OPCODE(o72_drawWizImage), - OPCODE(o72_debugInput), - /* D0 */ - OPCODE(o6_getDateTime), - OPCODE(o6_stopTalking), - OPCODE(o6_getAnimateVariable), - OPCODE(o6_invalid), - /* D4 */ - OPCODE(o6_shuffle), - OPCODE(o72_jumpToScript), - OPCODE(o6_band), - OPCODE(o6_bor), - /* D8 */ - OPCODE(o6_isRoomScriptRunning), - OPCODE(o60_closeFile), - OPCODE(o72_openFile), - OPCODE(o72_readFile), - /* DC */ - OPCODE(o72_writeFile), - OPCODE(o72_findAllObjects), - OPCODE(o72_deleteFile), - OPCODE(o72_rename), - /* E0 */ - OPCODE(o80_drawLine), - OPCODE(o72_getPixel), - OPCODE(o60_localizeArrayToScript), - OPCODE(o80_pickVarRandom), - /* E4 */ - OPCODE(o6_setBoxSet), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - /* E8 */ - OPCODE(o6_invalid), - OPCODE(o60_seekFilePos), - OPCODE(o72_redimArray), - OPCODE(o60_readFilePos), - /* EC */ - OPCODE(o71_copyString), - OPCODE(o71_getStringWidth), - OPCODE(o70_getStringLen), - OPCODE(o71_appendString), - /* F0 */ - OPCODE(o71_concatString), - OPCODE(o71_compareString), - OPCODE(o70_isResourceLoaded), - OPCODE(o72_readINI), - /* F4 */ - OPCODE(o72_writeINI), - OPCODE(o71_getStringLenForWidth), - OPCODE(o71_getCharIndexInString), - OPCODE(o71_findBox), - /* F8 */ - OPCODE(o72_getResourceSize), - OPCODE(o72_createDirectory), - OPCODE(o72_setSystemMessage), - OPCODE(o71_polygonOps), - /* FC */ - OPCODE(o71_polygonHit), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - OPCODE(o6_invalid), - }; - - _opcodesV90he = opcodes; -} - -void ScummEngine_v90he::executeOpcode(byte i) { - OpcodeProcV90he op = _opcodesV90he[i].proc; - (this->*op) (); -} - -const char *ScummEngine_v90he::getOpcodeDesc(byte i) { - return _opcodesV90he[i].desc; + /* 00 */ + OPCODE(0x00, o6_pushByte); + OPCODE(0x01, o6_pushWord); + OPCODE(0x02, o72_pushDWord); + OPCODE(0x03, o6_pushWordVar); + /* 04 */ + OPCODE(0x04, o72_getScriptString); + OPCODE(0x05, o6_invalid); + OPCODE(0x06, o6_invalid); + OPCODE(0x07, o6_wordArrayRead); + /* 08 */ + OPCODE(0x08, o6_invalid); + OPCODE(0x09, o6_invalid); + OPCODE(0x0a, o90_dup_n); + OPCODE(0x0b, o6_wordArrayIndexedRead); + /* 0C */ + OPCODE(0x0c, o6_dup); + OPCODE(0x0d, o6_not); + OPCODE(0x0e, o6_eq); + OPCODE(0x0f, o6_neq); + /* 10 */ + OPCODE(0x10, o6_gt); + OPCODE(0x11, o6_lt); + OPCODE(0x12, o6_le); + OPCODE(0x13, o6_ge); + /* 14 */ + OPCODE(0x14, o6_add); + OPCODE(0x15, o6_sub); + OPCODE(0x16, o6_mul); + OPCODE(0x17, o6_div); + /* 18 */ + OPCODE(0x18, o6_land); + OPCODE(0x19, o6_lor); + OPCODE(0x1a, o6_pop); + OPCODE(0x1b, o72_isAnyOf); + /* 1C */ + OPCODE(0x1c, o90_wizImageOps); + OPCODE(0x1d, o90_min); + OPCODE(0x1e, o90_max); + OPCODE(0x1f, o90_sin); + /* 20 */ + OPCODE(0x20, o90_cos); + OPCODE(0x21, o90_sqrt); + OPCODE(0x22, o90_atan2); + OPCODE(0x23, o90_getSegmentAngle); + /* 24 */ + OPCODE(0x24, o90_getDistanceBetweenPoints); + OPCODE(0x25, o90_getSpriteInfo); + OPCODE(0x26, o90_setSpriteInfo); + OPCODE(0x27, o90_getSpriteGroupInfo); + /* 28 */ + OPCODE(0x28, o90_setSpriteGroupInfo); + OPCODE(0x29, o90_getWizData); + OPCODE(0x2a, o90_getActorData); + OPCODE(0x2b, o90_startScriptUnk); + /* 2C */ + OPCODE(0x2c, o90_jumpToScriptUnk); + OPCODE(0x2d, o90_videoOps); + OPCODE(0x2e, o90_getVideoData); + OPCODE(0x2f, o90_floodFill); + /* 30 */ + OPCODE(0x30, o90_mod); + OPCODE(0x31, o90_shl); + OPCODE(0x32, o90_shr); + OPCODE(0x33, o90_xor); + /* 34 */ + OPCODE(0x34, o90_findAllObjectsWithClassOf); + OPCODE(0x35, o90_getPolygonOverlap); + OPCODE(0x36, o90_cond); + OPCODE(0x37, o90_dim2dim2Array); + /* 38 */ + OPCODE(0x38, o90_redim2dimArray); + OPCODE(0x39, o90_getLinesIntersectionPoint); + OPCODE(0x3a, o90_sortArray); + OPCODE(0x3b, o6_invalid); + /* 3C */ + OPCODE(0x3c, o6_invalid); + OPCODE(0x3d, o6_invalid); + OPCODE(0x3e, o6_invalid); + OPCODE(0x3f, o6_invalid); + /* 40 */ + OPCODE(0x40, o6_invalid); + OPCODE(0x41, o6_invalid); + OPCODE(0x42, o6_invalid); + OPCODE(0x43, o6_writeWordVar); + /* 44 */ + OPCODE(0x44, o90_getObjectData); + OPCODE(0x45, o80_createSound); + OPCODE(0x46, o80_getFileSize); + OPCODE(0x47, o6_wordArrayWrite); + /* 48 */ + OPCODE(0x48, o80_stringToInt); + OPCODE(0x49, o80_getSoundVar); + OPCODE(0x4a, o80_localizeArrayToRoom); + OPCODE(0x4b, o6_wordArrayIndexedWrite); + /* 4C */ + OPCODE(0x4c, o80_sourceDebug); + OPCODE(0x4d, o80_readConfigFile); + OPCODE(0x4e, o80_writeConfigFile); + OPCODE(0x4f, o6_wordVarInc); + /* 50 */ + OPCODE(0x50, o72_resetCutscene); + OPCODE(0x51, o6_invalid); + OPCODE(0x52, o72_findObjectWithClassOf); + OPCODE(0x53, o6_wordArrayInc); + /* 54 */ + OPCODE(0x54, o72_getObjectImageX); + OPCODE(0x55, o72_getObjectImageY); + OPCODE(0x56, o72_captureWizImage); + OPCODE(0x57, o6_wordVarDec); + /* 58 */ + OPCODE(0x58, o72_getTimer); + OPCODE(0x59, o72_setTimer); + OPCODE(0x5a, o72_getSoundPosition); + OPCODE(0x5b, o6_wordArrayDec); + /* 5C */ + OPCODE(0x5c, o6_if); + OPCODE(0x5d, o6_ifNot); + OPCODE(0x5e, o72_startScript); + OPCODE(0x5f, o6_startScriptQuick); + /* 60 */ + OPCODE(0x60, o72_startObject); + OPCODE(0x61, o72_drawObject); + OPCODE(0x62, o72_printWizImage); + OPCODE(0x63, o72_getArrayDimSize); + /* 64 */ + OPCODE(0x64, o72_getNumFreeArrays); + OPCODE(0x65, o6_stopObjectCode); + OPCODE(0x66, o6_stopObjectCode); + OPCODE(0x67, o6_endCutscene); + /* 68 */ + OPCODE(0x68, o6_cutscene); + OPCODE(0x69, o6_invalid); + OPCODE(0x6a, o6_freezeUnfreeze); + OPCODE(0x6b, o80_cursorCommand); + /* 6C */ + OPCODE(0x6c, o6_breakHere); + OPCODE(0x6d, o6_ifClassOfIs); + OPCODE(0x6e, o6_setClass); + OPCODE(0x6f, o6_getState); + /* 70 */ + OPCODE(0x70, o80_setState); + OPCODE(0x71, o6_setOwner); + OPCODE(0x72, o6_getOwner); + OPCODE(0x73, o6_jump); + /* 74 */ + OPCODE(0x74, o70_startSound); + OPCODE(0x75, o6_stopSound); + OPCODE(0x76, o6_invalid); + OPCODE(0x77, o6_stopObjectScript); + /* 78 */ + OPCODE(0x78, o6_panCameraTo); + OPCODE(0x79, o6_actorFollowCamera); + OPCODE(0x7a, o6_setCameraAt); + OPCODE(0x7b, o6_loadRoom); + /* 7C */ + OPCODE(0x7c, o6_stopScript); + OPCODE(0x7d, o6_walkActorToObj); + OPCODE(0x7e, o6_walkActorTo); + OPCODE(0x7f, o6_putActorAtXY); + /* 80 */ + OPCODE(0x80, o6_putActorAtObject); + OPCODE(0x81, o6_faceActor); + OPCODE(0x82, o6_animateActor); + OPCODE(0x83, o6_doSentence); + /* 84 */ + OPCODE(0x84, o70_pickupObject); + OPCODE(0x85, o6_loadRoomWithEgo); + OPCODE(0x86, o6_invalid); + OPCODE(0x87, o6_getRandomNumber); + /* 88 */ + OPCODE(0x88, o6_getRandomNumberRange); + OPCODE(0x89, o6_invalid); + OPCODE(0x8a, o6_getActorMoving); + OPCODE(0x8b, o6_isScriptRunning); + /* 8C */ + OPCODE(0x8c, o70_getActorRoom); + OPCODE(0x8d, o6_getObjectX); + OPCODE(0x8e, o6_getObjectY); + OPCODE(0x8f, o6_getObjectOldDir); + /* 90 */ + OPCODE(0x90, o6_getActorWalkBox); + OPCODE(0x91, o6_getActorCostume); + OPCODE(0x92, o6_findInventory); + OPCODE(0x93, o6_getInventoryCount); + /* 94 */ + OPCODE(0x94, o90_getPaletteData); + OPCODE(0x95, o6_beginOverride); + OPCODE(0x96, o6_endOverride); + OPCODE(0x97, o6_invalid); + /* 98 */ + OPCODE(0x98, o6_isSoundRunning); + OPCODE(0x99, o6_setBoxFlags); + OPCODE(0x9a, o6_invalid); + OPCODE(0x9b, o70_resourceRoutines); + /* 9C */ + OPCODE(0x9c, o72_roomOps); + OPCODE(0x9d, o72_actorOps); + OPCODE(0x9e, o90_paletteOps); + OPCODE(0x9f, o6_getActorFromXY); + /* A0 */ + OPCODE(0xa0, o72_findObject); + OPCODE(0xa1, o6_pseudoRoom); + OPCODE(0xa2, o6_getActorElevation); + OPCODE(0xa3, o6_getVerbEntrypoint); + /* A4 */ + OPCODE(0xa4, o72_arrayOps); + OPCODE(0xa5, o90_fontUnk); + OPCODE(0xa6, o6_drawBox); + OPCODE(0xa7, o6_pop); + /* A8 */ + OPCODE(0xa8, o6_getActorWidth); + OPCODE(0xa9, o6_wait); + OPCODE(0xaa, o6_getActorScaleX); + OPCODE(0xab, o90_getActorAnimProgress); + /* AC */ + OPCODE(0xac, o80_drawWizPolygon); + OPCODE(0xad, o6_isAnyOf); + OPCODE(0xae, o72_systemOps); + OPCODE(0xaf, o6_isActorInBox); + /* B0 */ + OPCODE(0xb0, o6_delay); + OPCODE(0xb1, o6_delaySeconds); + OPCODE(0xb2, o6_delayMinutes); + OPCODE(0xb3, o6_stopSentence); + /* B4 */ + OPCODE(0xb4, o6_printLine); + OPCODE(0xb5, o6_printText); + OPCODE(0xb6, o6_printDebug); + OPCODE(0xb7, o6_printSystem); + /* B8 */ + OPCODE(0xb8, o6_printActor); + OPCODE(0xb9, o6_printEgo); + OPCODE(0xba, o72_talkActor); + OPCODE(0xbb, o72_talkEgo); + /* BC */ + OPCODE(0xbc, o72_dimArray); + OPCODE(0xbd, o6_stopObjectCode); + OPCODE(0xbe, o6_startObjectQuick); + OPCODE(0xbf, o6_startScriptQuick2); + /* C0 */ + OPCODE(0xc0, o72_dim2dimArray); + OPCODE(0xc1, o72_traceStatus); + OPCODE(0xc2, o6_invalid); + OPCODE(0xc3, o6_invalid); + /* C4 */ + OPCODE(0xc4, o6_abs); + OPCODE(0xc5, o6_distObjectObject); + OPCODE(0xc6, o6_distObjectPt); + OPCODE(0xc7, o6_distPtPt); + /* C8 */ + OPCODE(0xc8, o90_kernelGetFunctions); + OPCODE(0xc9, o90_kernelSetFunctions); + OPCODE(0xca, o6_delayFrames); + OPCODE(0xcb, o6_pickOneOf); + /* CC */ + OPCODE(0xcc, o6_pickOneOfDefault); + OPCODE(0xcd, o6_stampObject); + OPCODE(0xce, o72_drawWizImage); + OPCODE(0xcf, o72_debugInput); + /* D0 */ + OPCODE(0xd0, o6_getDateTime); + OPCODE(0xd1, o6_stopTalking); + OPCODE(0xd2, o6_getAnimateVariable); + OPCODE(0xd3, o6_invalid); + /* D4 */ + OPCODE(0xd4, o6_shuffle); + OPCODE(0xd5, o72_jumpToScript); + OPCODE(0xd6, o6_band); + OPCODE(0xd7, o6_bor); + /* D8 */ + OPCODE(0xd8, o6_isRoomScriptRunning); + OPCODE(0xd9, o60_closeFile); + OPCODE(0xda, o72_openFile); + OPCODE(0xdb, o72_readFile); + /* DC */ + OPCODE(0xdc, o72_writeFile); + OPCODE(0xdd, o72_findAllObjects); + OPCODE(0xde, o72_deleteFile); + OPCODE(0xdf, o72_rename); + /* E0 */ + OPCODE(0xe0, o80_drawLine); + OPCODE(0xe1, o72_getPixel); + OPCODE(0xe2, o60_localizeArrayToScript); + OPCODE(0xe3, o80_pickVarRandom); + /* E4 */ + OPCODE(0xe4, o6_setBoxSet); + OPCODE(0xe5, o6_invalid); + OPCODE(0xe6, o6_invalid); + OPCODE(0xe7, o6_invalid); + /* E8 */ + OPCODE(0xe8, o6_invalid); + OPCODE(0xe9, o60_seekFilePos); + OPCODE(0xea, o72_redimArray); + OPCODE(0xeb, o60_readFilePos); + /* EC */ + OPCODE(0xec, o71_copyString); + OPCODE(0xed, o71_getStringWidth); + OPCODE(0xee, o70_getStringLen); + OPCODE(0xef, o71_appendString); + /* F0 */ + OPCODE(0xf0, o71_concatString); + OPCODE(0xf1, o71_compareString); + OPCODE(0xf2, o70_isResourceLoaded); + OPCODE(0xf3, o72_readINI); + /* F4 */ + OPCODE(0xf4, o72_writeINI); + OPCODE(0xf5, o71_getStringLenForWidth); + OPCODE(0xf6, o71_getCharIndexInString); + OPCODE(0xf7, o71_findBox); + /* F8 */ + OPCODE(0xf8, o72_getResourceSize); + OPCODE(0xf9, o72_createDirectory); + OPCODE(0xfa, o72_setSystemMessage); + OPCODE(0xfb, o71_polygonOps); + /* FC */ + OPCODE(0xfc, o71_polygonHit); + OPCODE(0xfd, o6_invalid); + OPCODE(0xfe, o6_invalid); + OPCODE(0xff, o6_invalid); } void ScummEngine_v90he::o90_dup_n() { |