Add HE 80/90 classes, will be filled up over time.
svn-id: r14914
This commit is contained in:
parent
d21525d7fe
commit
f1c0202e7c
6 changed files with 843 additions and 28 deletions
|
@ -575,7 +575,7 @@ protected:
|
|||
virtual void decodeParseString(int a, int b);
|
||||
void swapObjects(int object1, int object2);
|
||||
|
||||
/* Version 6 script opcodes */
|
||||
/* HE version 60 script opcodes */
|
||||
void o6_setState();
|
||||
void o6_roomOps();
|
||||
void o6_actorOps();
|
||||
|
@ -618,7 +618,7 @@ protected:
|
|||
byte stringLen(byte *);
|
||||
int getCharsetOffset(int letter);
|
||||
|
||||
/* Version 7 script opcodes */
|
||||
/* HE version 70 script opcodes */
|
||||
void o7_cursorCommand();
|
||||
void o7_startSound();
|
||||
void o7_pickupObject();
|
||||
|
@ -704,7 +704,7 @@ protected:
|
|||
void decodeScriptString(byte *dst, bool scriptString = false);
|
||||
int copyScriptString(byte *dst);
|
||||
|
||||
/* Version 7 script opcodes */
|
||||
/* HE version 72 script opcodes */
|
||||
void o72_pushDWord();
|
||||
void o72_addMessageToStack();
|
||||
void o72_wordArrayRead();
|
||||
|
@ -712,7 +712,6 @@ protected:
|
|||
void o72_wordArrayWrite();
|
||||
void o72_wordArrayIndexedWrite();
|
||||
void o72_compareStackList();
|
||||
void o72_unknown1C();
|
||||
void o72_unknown50();
|
||||
void o72_findObject();
|
||||
void o72_wordArrayInc();
|
||||
|
@ -760,6 +759,50 @@ protected:
|
|||
void o72_unknownFB();
|
||||
};
|
||||
|
||||
class ScummEngine_v80he : public ScummEngine_v72he {
|
||||
protected:
|
||||
typedef void (ScummEngine_v80he::*OpcodeProcV80he)();
|
||||
struct OpcodeEntryV80he {
|
||||
OpcodeProcV80he proc;
|
||||
const char *desc;
|
||||
};
|
||||
|
||||
const OpcodeEntryV80he *_opcodesV80he;
|
||||
|
||||
public:
|
||||
ScummEngine_v80he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine_v72he(detector, syst, gs) {}
|
||||
|
||||
protected:
|
||||
virtual void setupOpcodes();
|
||||
virtual void executeOpcode(byte i);
|
||||
virtual const char *getOpcodeDesc(byte i);
|
||||
|
||||
/* HE version 80 script opcodes */
|
||||
};
|
||||
|
||||
class ScummEngine_v90he : public ScummEngine_v80he {
|
||||
protected:
|
||||
typedef void (ScummEngine_v90he::*OpcodeProcV90he)();
|
||||
struct OpcodeEntryV90he {
|
||||
OpcodeProcV90he proc;
|
||||
const char *desc;
|
||||
};
|
||||
|
||||
const OpcodeEntryV90he *_opcodesV90he;
|
||||
|
||||
public:
|
||||
ScummEngine_v90he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine_v80he(detector, syst, gs) {}
|
||||
|
||||
protected:
|
||||
virtual void setupOpcodes();
|
||||
virtual void executeOpcode(byte i);
|
||||
virtual const char *getOpcodeDesc(byte i);
|
||||
|
||||
/* HE version 90 script opcodes */
|
||||
void o90_unknown1C();
|
||||
void o90_unknown26();
|
||||
};
|
||||
|
||||
class ScummEngine_v7 : public ScummEngine_v6 {
|
||||
public:
|
||||
ScummEngine_v7(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine_v6(detector, syst, gs) {}
|
||||
|
|
|
@ -40,6 +40,8 @@ MODULE_OBJS := \
|
|||
scumm/script_v6he.o \
|
||||
scumm/script_v7he.o \
|
||||
scumm/script_v72he.o \
|
||||
scumm/script_v80he.o \
|
||||
scumm/script_v90he.o \
|
||||
scumm/script_v8.o \
|
||||
scumm/scumm.o \
|
||||
scumm/sound.o \
|
||||
|
|
|
@ -81,7 +81,7 @@ void ScummEngine_v72he::setupOpcodes() {
|
|||
OPCODE(o6_pop),
|
||||
OPCODE(o72_compareStackList),
|
||||
/* 1C */
|
||||
OPCODE(o72_unknown1C),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
|
@ -616,27 +616,6 @@ void ScummEngine_v72he::o72_compareStackList() {
|
|||
}
|
||||
}
|
||||
|
||||
void ScummEngine_v72he::o72_unknown1C() {
|
||||
// HE 90+ specific
|
||||
if (_heversion < 90)
|
||||
error("Invalid opcode '%x' at %x", _opcode, _scriptPointer - _scriptOrgPointer);
|
||||
|
||||
// For Pajame Sam 2 demo
|
||||
// Incomplete
|
||||
int value = fetchScriptByte();
|
||||
value -= 46;
|
||||
|
||||
if (value == 10) {
|
||||
pop();
|
||||
pop();
|
||||
pop();
|
||||
pop();
|
||||
pop();
|
||||
}
|
||||
|
||||
warning("o72_unknown1C stub (%d)", value);
|
||||
}
|
||||
|
||||
void ScummEngine_v72he::o72_wordArrayWrite() {
|
||||
int a = pop();
|
||||
writeArray(fetchScriptWord(), 0, pop(), a);
|
||||
|
|
381
scumm/script_v80he.cpp
Normal file
381
scumm/script_v80he.cpp
Normal file
|
@ -0,0 +1,381 @@
|
|||
/* ScummVM - Scumm Interpreter
|
||||
* Copyright (C) 2001 Ludvig Strigeus
|
||||
* Copyright (C) 2001-2004 The ScummVM project
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Header$
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "common/config-manager.h"
|
||||
|
||||
#include "scumm/actor.h"
|
||||
#include "scumm/charset.h"
|
||||
#include "scumm/intern.h"
|
||||
#include "scumm/object.h"
|
||||
#include "scumm/resource.h"
|
||||
#include "scumm/resource_v7he.h"
|
||||
#include "scumm/scumm.h"
|
||||
#include "scumm/sound.h"
|
||||
#include "scumm/verbs.h"
|
||||
|
||||
#include "sound/mididrv.h"
|
||||
#include "sound/mixer.h"
|
||||
|
||||
namespace Scumm {
|
||||
|
||||
#define OPCODE(x) { &ScummEngine_v80he::x, #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_addMessageToStack),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o72_wordArrayRead),
|
||||
/* 08 */
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o72_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_compareStackList),
|
||||
/* 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(o72_wordArrayWrite),
|
||||
/* 48 */
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o72_wordArrayIndexedWrite),
|
||||
/* 4C */
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_wordVarInc),
|
||||
/* 50 */
|
||||
OPCODE(o72_unknown50),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o72_findObject),
|
||||
OPCODE(o72_wordArrayInc),
|
||||
/* 54 */
|
||||
OPCODE(o72_objectX),
|
||||
OPCODE(o72_objectY),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_wordVarDec),
|
||||
/* 58 */
|
||||
OPCODE(o72_getTimer),
|
||||
OPCODE(o72_setTimer),
|
||||
OPCODE(o72_unknown5A),
|
||||
OPCODE(o72_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(o7_cursorCommand),
|
||||
/* 6C */
|
||||
OPCODE(o6_breakHere),
|
||||
OPCODE(o6_ifClassOfIs),
|
||||
OPCODE(o6_setClass),
|
||||
OPCODE(o6_getState),
|
||||
/* 70 */
|
||||
OPCODE(o6_setState),
|
||||
OPCODE(o6_setOwner),
|
||||
OPCODE(o6_getOwner),
|
||||
OPCODE(o6_jump),
|
||||
/* 74 */
|
||||
OPCODE(o7_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(o72_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(o7_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(o7_resourceRoutines),
|
||||
/* 9C */
|
||||
OPCODE(o6_roomOps),
|
||||
OPCODE(o72_actorOps),
|
||||
OPCODE(o72_verbOps),
|
||||
OPCODE(o6_getActorFromXY),
|
||||
/* A0 */
|
||||
OPCODE(o6_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_getActorAnimCounter1),
|
||||
/* AC */
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_isAnyOf),
|
||||
OPCODE(o7_quitPauseRestart),
|
||||
OPCODE(o6_isActorInBox),
|
||||
/* B0 */
|
||||
OPCODE(o6_delay),
|
||||
OPCODE(o6_delaySeconds),
|
||||
OPCODE(o6_delayMinutes),
|
||||
OPCODE(o6_stopSentence),
|
||||
/* B4 */
|
||||
OPCODE(o6_printLine),
|
||||
OPCODE(o6_printCursor),
|
||||
OPCODE(o6_printDebug),
|
||||
OPCODE(o6_printSystem),
|
||||
/* B8 */
|
||||
OPCODE(o6_printActor),
|
||||
OPCODE(o6_printEgo),
|
||||
OPCODE(o6_talkActor),
|
||||
OPCODE(o6_talkEgo),
|
||||
/* BC */
|
||||
OPCODE(o72_dimArray),
|
||||
OPCODE(o6_dummy),
|
||||
OPCODE(o6_startObjectQuick),
|
||||
OPCODE(o6_startScriptQuick2),
|
||||
/* C0 */
|
||||
OPCODE(o72_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(o6_kernelGetFunctions),
|
||||
OPCODE(o7_kernelSetFunctions),
|
||||
OPCODE(o6_delayFrames),
|
||||
OPCODE(o6_pickOneOf),
|
||||
/* CC */
|
||||
OPCODE(o6_pickOneOfDefault),
|
||||
OPCODE(o6_stampObject),
|
||||
OPCODE(o72_drawWizImage),
|
||||
OPCODE(o6_invalid),
|
||||
/* D0 */
|
||||
OPCODE(o6_getDateTime),
|
||||
OPCODE(o6_stopTalking),
|
||||
OPCODE(o6_getAnimateVariable),
|
||||
OPCODE(o6_invalid),
|
||||
/* D4 */
|
||||
OPCODE(o72_shuffle),
|
||||
OPCODE(o72_jumpToScript),
|
||||
OPCODE(o6_band),
|
||||
OPCODE(o6_bor),
|
||||
/* D8 */
|
||||
OPCODE(o6_isRoomScriptRunning),
|
||||
OPCODE(o6_closeFile),
|
||||
OPCODE(o72_openFile),
|
||||
OPCODE(o72_readFile),
|
||||
/* DC */
|
||||
OPCODE(o72_writeFile),
|
||||
OPCODE(o72_findAllObjects),
|
||||
OPCODE(o72_deleteFile),
|
||||
OPCODE(o6_rename),
|
||||
/* E0 */
|
||||
OPCODE(o6_soundOps),
|
||||
OPCODE(o72_getPixel),
|
||||
OPCODE(o6_localizeArray),
|
||||
OPCODE(o72_pickVarRandom),
|
||||
/* E4 */
|
||||
OPCODE(o6_setBoxSet),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
/* E8 */
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_seekFilePos),
|
||||
OPCODE(o72_redimArray),
|
||||
OPCODE(o6_readFilePos),
|
||||
/* EC */
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o72_unknownED),
|
||||
OPCODE(o7_stringLen),
|
||||
OPCODE(o72_unknownEF),
|
||||
/* F0 */
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o72_unknownF1),
|
||||
OPCODE(o72_unknownF2),
|
||||
OPCODE(o72_readINI),
|
||||
/* F4 */
|
||||
OPCODE(o72_writeINI),
|
||||
OPCODE(o72_unknownF5),
|
||||
OPCODE(o72_unknownF6),
|
||||
OPCODE(o6_invalid),
|
||||
/* F8 */
|
||||
OPCODE(o72_unknownF8),
|
||||
OPCODE(o72_unknownF9),
|
||||
OPCODE(o72_unknownFA),
|
||||
OPCODE(o72_unknownFB),
|
||||
/* FC */
|
||||
OPCODE(o7_unknownFC),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
};
|
||||
|
||||
_opcodesV80he = opcodes;
|
||||
}
|
||||
|
||||
void ScummEngine_v80he::executeOpcode(byte i) {
|
||||
OpcodeProcV80he op = _opcodesV80he[i].proc;
|
||||
(this->*op) ();
|
||||
}
|
||||
|
||||
const char *ScummEngine_v80he::getOpcodeDesc(byte i) {
|
||||
return _opcodesV80he[i].desc;
|
||||
}
|
||||
|
||||
} // End of namespace Scumm
|
406
scumm/script_v90he.cpp
Normal file
406
scumm/script_v90he.cpp
Normal file
|
@ -0,0 +1,406 @@
|
|||
/* ScummVM - Scumm Interpreter
|
||||
* Copyright (C) 2001 Ludvig Strigeus
|
||||
* Copyright (C) 2001-2004 The ScummVM project
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Header$
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "common/config-manager.h"
|
||||
|
||||
#include "scumm/actor.h"
|
||||
#include "scumm/charset.h"
|
||||
#include "scumm/intern.h"
|
||||
#include "scumm/object.h"
|
||||
#include "scumm/resource.h"
|
||||
#include "scumm/resource_v7he.h"
|
||||
#include "scumm/scumm.h"
|
||||
#include "scumm/sound.h"
|
||||
#include "scumm/verbs.h"
|
||||
|
||||
#include "sound/mididrv.h"
|
||||
#include "sound/mixer.h"
|
||||
|
||||
namespace Scumm {
|
||||
|
||||
#define OPCODE(x) { &ScummEngine_v90he::x, #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_addMessageToStack),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o72_wordArrayRead),
|
||||
/* 08 */
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o72_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_compareStackList),
|
||||
/* 1C */
|
||||
OPCODE(o90_unknown1C),
|
||||
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(o90_unknown26),
|
||||
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(o72_wordArrayWrite),
|
||||
/* 48 */
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o72_wordArrayIndexedWrite),
|
||||
/* 4C */
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_wordVarInc),
|
||||
/* 50 */
|
||||
OPCODE(o72_unknown50),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o72_findObject),
|
||||
OPCODE(o72_wordArrayInc),
|
||||
/* 54 */
|
||||
OPCODE(o72_objectX),
|
||||
OPCODE(o72_objectY),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_wordVarDec),
|
||||
/* 58 */
|
||||
OPCODE(o72_getTimer),
|
||||
OPCODE(o72_setTimer),
|
||||
OPCODE(o72_unknown5A),
|
||||
OPCODE(o72_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(o7_cursorCommand),
|
||||
/* 6C */
|
||||
OPCODE(o6_breakHere),
|
||||
OPCODE(o6_ifClassOfIs),
|
||||
OPCODE(o6_setClass),
|
||||
OPCODE(o6_getState),
|
||||
/* 70 */
|
||||
OPCODE(o6_setState),
|
||||
OPCODE(o6_setOwner),
|
||||
OPCODE(o6_getOwner),
|
||||
OPCODE(o6_jump),
|
||||
/* 74 */
|
||||
OPCODE(o7_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(o72_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(o7_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(o7_resourceRoutines),
|
||||
/* 9C */
|
||||
OPCODE(o6_roomOps),
|
||||
OPCODE(o72_actorOps),
|
||||
OPCODE(o72_verbOps),
|
||||
OPCODE(o6_getActorFromXY),
|
||||
/* A0 */
|
||||
OPCODE(o6_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_getActorAnimCounter1),
|
||||
/* AC */
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_isAnyOf),
|
||||
OPCODE(o7_quitPauseRestart),
|
||||
OPCODE(o6_isActorInBox),
|
||||
/* B0 */
|
||||
OPCODE(o6_delay),
|
||||
OPCODE(o6_delaySeconds),
|
||||
OPCODE(o6_delayMinutes),
|
||||
OPCODE(o6_stopSentence),
|
||||
/* B4 */
|
||||
OPCODE(o6_printLine),
|
||||
OPCODE(o6_printCursor),
|
||||
OPCODE(o6_printDebug),
|
||||
OPCODE(o6_printSystem),
|
||||
/* B8 */
|
||||
OPCODE(o6_printActor),
|
||||
OPCODE(o6_printEgo),
|
||||
OPCODE(o6_talkActor),
|
||||
OPCODE(o6_talkEgo),
|
||||
/* BC */
|
||||
OPCODE(o72_dimArray),
|
||||
OPCODE(o6_dummy),
|
||||
OPCODE(o6_startObjectQuick),
|
||||
OPCODE(o6_startScriptQuick2),
|
||||
/* C0 */
|
||||
OPCODE(o72_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(o6_kernelGetFunctions),
|
||||
OPCODE(o7_kernelSetFunctions),
|
||||
OPCODE(o6_delayFrames),
|
||||
OPCODE(o6_pickOneOf),
|
||||
/* CC */
|
||||
OPCODE(o6_pickOneOfDefault),
|
||||
OPCODE(o6_stampObject),
|
||||
OPCODE(o72_drawWizImage),
|
||||
OPCODE(o6_invalid),
|
||||
/* D0 */
|
||||
OPCODE(o6_getDateTime),
|
||||
OPCODE(o6_stopTalking),
|
||||
OPCODE(o6_getAnimateVariable),
|
||||
OPCODE(o6_invalid),
|
||||
/* D4 */
|
||||
OPCODE(o72_shuffle),
|
||||
OPCODE(o72_jumpToScript),
|
||||
OPCODE(o6_band),
|
||||
OPCODE(o6_bor),
|
||||
/* D8 */
|
||||
OPCODE(o6_isRoomScriptRunning),
|
||||
OPCODE(o6_closeFile),
|
||||
OPCODE(o72_openFile),
|
||||
OPCODE(o72_readFile),
|
||||
/* DC */
|
||||
OPCODE(o72_writeFile),
|
||||
OPCODE(o72_findAllObjects),
|
||||
OPCODE(o72_deleteFile),
|
||||
OPCODE(o6_rename),
|
||||
/* E0 */
|
||||
OPCODE(o6_soundOps),
|
||||
OPCODE(o72_getPixel),
|
||||
OPCODE(o6_localizeArray),
|
||||
OPCODE(o72_pickVarRandom),
|
||||
/* E4 */
|
||||
OPCODE(o6_setBoxSet),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_invalid),
|
||||
/* E8 */
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o6_seekFilePos),
|
||||
OPCODE(o72_redimArray),
|
||||
OPCODE(o6_readFilePos),
|
||||
/* EC */
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o72_unknownED),
|
||||
OPCODE(o7_stringLen),
|
||||
OPCODE(o72_unknownEF),
|
||||
/* F0 */
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o72_unknownF1),
|
||||
OPCODE(o72_unknownF2),
|
||||
OPCODE(o72_readINI),
|
||||
/* F4 */
|
||||
OPCODE(o72_writeINI),
|
||||
OPCODE(o72_unknownF5),
|
||||
OPCODE(o72_unknownF6),
|
||||
OPCODE(o6_invalid),
|
||||
/* F8 */
|
||||
OPCODE(o72_unknownF8),
|
||||
OPCODE(o72_unknownF9),
|
||||
OPCODE(o72_unknownFA),
|
||||
OPCODE(o72_unknownFB),
|
||||
/* FC */
|
||||
OPCODE(o7_unknownFC),
|
||||
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;
|
||||
}
|
||||
|
||||
void ScummEngine_v90he::o90_unknown1C() {
|
||||
// For Pajame Sam 2 demo
|
||||
// Incomplete
|
||||
int value = fetchScriptByte();
|
||||
value -= 46;
|
||||
|
||||
if (value == 10) {
|
||||
pop();
|
||||
pop();
|
||||
pop();
|
||||
pop();
|
||||
pop();
|
||||
}
|
||||
|
||||
warning("o90_unknown1C stub (%d)", value);
|
||||
}
|
||||
|
||||
void ScummEngine_v90he::o90_unknown26() {
|
||||
// Incomplete
|
||||
int value = fetchScriptByte();
|
||||
value -= 34;
|
||||
|
||||
warning("o90_unknown26 stub (%d)", value);
|
||||
}
|
||||
|
||||
} // End of namespace Scumm
|
|
@ -3336,10 +3336,14 @@ Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) {
|
|||
case 6:
|
||||
switch (game.heversion) {
|
||||
#ifndef __PALM_OS__
|
||||
case 72:
|
||||
case 80:
|
||||
case 90:
|
||||
case 98:
|
||||
engine = new ScummEngine_v90he(detector, syst, game);
|
||||
break;
|
||||
case 80:
|
||||
engine = new ScummEngine_v80he(detector, syst, game);
|
||||
break;
|
||||
case 72:
|
||||
engine = new ScummEngine_v72he(detector, syst, game);
|
||||
break;
|
||||
case 71:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue