diff options
author | Max Horn | 2002-11-06 16:44:57 +0000 |
---|---|---|
committer | Max Horn | 2002-11-06 16:44:57 +0000 |
commit | 18153f22c9c45d03ed5a3b77d17d7b7a9c602b58 (patch) | |
tree | de2f5f8699674ed4eb9fe4c16a38bae1dd9c3253 /scumm/script_v1.cpp | |
parent | 004afead33bceab805bde3c6ca6d299f582612af (diff) | |
download | scummvm-rg350-18153f22c9c45d03ed5a3b77d17d7b7a9c602b58.tar.gz scummvm-rg350-18153f22c9c45d03ed5a3b77d17d7b7a9c602b58.tar.bz2 scummvm-rg350-18153f22c9c45d03ed5a3b77d17d7b7a9c602b58.zip |
why keep a seperate opcode entry & opcode description table if we can have it both in one (note that the descriptions were in fact outdated in some cases! also note, this is really just a refactoring, no functionality is changed except that opcode descriptions are now in sync with the opcode procs, that's why I am commiting this at all)
svn-id: r5445
Diffstat (limited to 'scumm/script_v1.cpp')
-rw-r--r-- | scumm/script_v1.cpp | 857 |
1 files changed, 272 insertions, 585 deletions
diff --git a/scumm/script_v1.cpp b/scumm/script_v1.cpp index 992891cfba..214d795b8f 100644 --- a/scumm/script_v1.cpp +++ b/scumm/script_v1.cpp @@ -25,657 +25,334 @@ #include "actor.h" #include "scumm/sound.h" +#define OPCODE(x) { &Scumm::x, #x } + void Scumm::setupOpcodes() { - static const OpcodeProc opcode_list[] = { + static const OpcodeEntry opcodes[256] = { /* 00 */ - &Scumm::o5_stopObjectCode, - &Scumm::o5_putActor, - &Scumm::o5_startMusic, - &Scumm::o5_getActorRoom, + OPCODE(o5_stopObjectCode), + OPCODE(o5_putActor), + OPCODE(o5_startMusic), + OPCODE(o5_getActorRoom), /* 04 */ - &Scumm::o5_isGreaterEqual, - &Scumm::o5_drawObject, - &Scumm::o5_getActorElevation, - &Scumm::o5_setState, + OPCODE(o5_isGreaterEqual), + OPCODE(o5_drawObject), + OPCODE(o5_getActorElevation), + OPCODE(o5_setState), /* 08 */ - &Scumm::o5_isNotEqual, - &Scumm::o5_faceActor, - &Scumm::o5_startScript, - &Scumm::o5_getVerbEntrypoint, + OPCODE(o5_isNotEqual), + OPCODE(o5_faceActor), + OPCODE(o5_startScript), + OPCODE(o5_getVerbEntrypoint), /* 0C */ - &Scumm::o5_resourceRoutines, - &Scumm::o5_walkActorToActor, - &Scumm::o5_putActorAtObject, - &Scumm::o5_getObjectState, + OPCODE(o5_resourceRoutines), + OPCODE(o5_walkActorToActor), + OPCODE(o5_putActorAtObject), + OPCODE(o5_getObjectState), /* 10 */ - &Scumm::o5_getObjectOwner, - &Scumm::o5_animateActor, - &Scumm::o5_panCameraTo, - &Scumm::o5_actorSet, + OPCODE(o5_getObjectOwner), + OPCODE(o5_animateActor), + OPCODE(o5_panCameraTo), + OPCODE(o5_actorSet), /* 14 */ - &Scumm::o5_print, - &Scumm::o5_actorFromPos, - &Scumm::o5_getRandomNr, - &Scumm::o5_and, + OPCODE(o5_print), + OPCODE(o5_actorFromPos), + OPCODE(o5_getRandomNr), + OPCODE(o5_and), /* 18 */ - &Scumm::o5_jumpRelative, - &Scumm::o5_doSentence, - &Scumm::o5_move, - &Scumm::o5_multiply, + OPCODE(o5_jumpRelative), + OPCODE(o5_doSentence), + OPCODE(o5_move), + OPCODE(o5_multiply), /* 1C */ - &Scumm::o5_startSound, - &Scumm::o5_ifClassOfIs, - &Scumm::o5_walkActorTo, - &Scumm::o5_isActorInBox, + OPCODE(o5_startSound), + OPCODE(o5_ifClassOfIs), + OPCODE(o5_walkActorTo), + OPCODE(o5_isActorInBox), /* 20 */ - &Scumm::o5_stopMusic, - &Scumm::o5_putActor, - &Scumm::o5_getAnimCounter, - &Scumm::o5_getActorY, + OPCODE(o5_stopMusic), + OPCODE(o5_putActor), + OPCODE(o5_getAnimCounter), + OPCODE(o5_getActorY), /* 24 */ - &Scumm::o5_loadRoomWithEgo, - &Scumm::o5_pickupObject, - &Scumm::o5_setVarRange, - &Scumm::o5_stringOps, + OPCODE(o5_loadRoomWithEgo), + OPCODE(o5_pickupObject), + OPCODE(o5_setVarRange), + OPCODE(o5_stringOps), /* 28 */ - &Scumm::o5_equalZero, - &Scumm::o5_setOwnerOf, - &Scumm::o5_startScript, - &Scumm::o5_delayVariable, + OPCODE(o5_equalZero), + OPCODE(o5_setOwnerOf), + OPCODE(o5_startScript), + OPCODE(o5_delayVariable), /* 2C */ - &Scumm::o5_cursorCommand, - &Scumm::o5_putActorInRoom, - &Scumm::o5_delay, - &Scumm::o5_ifState, + OPCODE(o5_cursorCommand), + OPCODE(o5_putActorInRoom), + OPCODE(o5_delay), + OPCODE(o5_ifNotState), /* 30 */ - &Scumm::o5_matrixOps, - &Scumm::o5_getInventoryCount, - &Scumm::o5_setCameraAt, - &Scumm::o5_roomOps, + OPCODE(o5_matrixOps), + OPCODE(o5_getInventoryCount), + OPCODE(o5_setCameraAt), + OPCODE(o5_roomOps), /* 34 */ - &Scumm::o5_getDist, - &Scumm::o5_findObject, - &Scumm::o5_walkActorToObject, - &Scumm::o5_startObject, + OPCODE(o5_getDist), + OPCODE(o5_findObject), + OPCODE(o5_walkActorToObject), + OPCODE(o5_startObject), /* 38 */ - &Scumm::o5_lessOrEqual, - &Scumm::o5_doSentence, - &Scumm::o5_subtract, - &Scumm::o5_getActorScale, + OPCODE(o5_lessOrEqual), + OPCODE(o5_doSentence), + OPCODE(o5_subtract), + OPCODE(o5_getActorScale), /* 3C */ - &Scumm::o5_stopSound, - &Scumm::o5_findInventory, - &Scumm::o5_walkActorTo, - &Scumm::o5_drawBox, + OPCODE(o5_stopSound), + OPCODE(o5_findInventory), + OPCODE(o5_walkActorTo), + OPCODE(o5_drawBox), /* 40 */ - &Scumm::o5_cutscene, - &Scumm::o5_putActor, - &Scumm::o5_chainScript, - &Scumm::o5_getActorX, + OPCODE(o5_cutscene), + OPCODE(o5_putActor), + OPCODE(o5_chainScript), + OPCODE(o5_getActorX), /* 44 */ - &Scumm::o5_isLess, - &Scumm::o5_drawObject, - &Scumm::o5_increment, - &Scumm::o5_setState, + OPCODE(o5_isLess), + OPCODE(o5_drawObject), + OPCODE(o5_increment), + OPCODE(o5_setState), /* 48 */ - &Scumm::o5_isEqual, - &Scumm::o5_faceActor, - &Scumm::o5_startScript, - &Scumm::o5_getVerbEntrypoint, + OPCODE(o5_isEqual), + OPCODE(o5_faceActor), + OPCODE(o5_startScript), + OPCODE(o5_getVerbEntrypoint), /* 4C */ - &Scumm::o5_soundKludge, - &Scumm::o5_walkActorToActor, - &Scumm::o5_putActorAtObject, - &Scumm::o5_ifState, + OPCODE(o5_soundKludge), + OPCODE(o5_walkActorToActor), + OPCODE(o5_putActorAtObject), + OPCODE(o5_ifState), /* 50 */ - &Scumm::o5_pickupObjectOld, - &Scumm::o5_animateActor, - &Scumm::o5_actorFollowCamera, - &Scumm::o5_actorSet, + OPCODE(o5_pickupObjectOld), + OPCODE(o5_animateActor), + OPCODE(o5_actorFollowCamera), + OPCODE(o5_actorSet), /* 54 */ - &Scumm::o5_setObjectName, - &Scumm::o5_actorFromPos, - &Scumm::o5_getActorMoving, - &Scumm::o5_or, + OPCODE(o5_setObjectName), + OPCODE(o5_actorFromPos), + OPCODE(o5_getActorMoving), + OPCODE(o5_or), /* 58 */ - &Scumm::o5_overRide, - &Scumm::o5_doSentence, - &Scumm::o5_add, - &Scumm::o5_divide, + OPCODE(o5_overRide), + OPCODE(o5_doSentence), + OPCODE(o5_add), + OPCODE(o5_divide), /* 5C */ - &Scumm::o5_oldRoomEffect, - &Scumm::o5_setClass, - &Scumm::o5_walkActorTo, - &Scumm::o5_isActorInBox, + OPCODE(o5_oldRoomEffect), + OPCODE(o5_setClass), + OPCODE(o5_walkActorTo), + OPCODE(o5_isActorInBox), /* 60 */ - &Scumm::o5_freezeScripts, - &Scumm::o5_putActor, - &Scumm::o5_stopScript, - &Scumm::o5_getActorFacing, + OPCODE(o5_freezeScripts), + OPCODE(o5_putActor), + OPCODE(o5_stopScript), + OPCODE(o5_getActorFacing), /* 64 */ - &Scumm::o5_loadRoomWithEgo, - &Scumm::o5_pickupObject, - &Scumm::o5_getClosestObjActor, - &Scumm::o5_dummy, + OPCODE(o5_loadRoomWithEgo), + OPCODE(o5_pickupObject), + OPCODE(o5_getClosestObjActor), + OPCODE(o5_dummy), /* 68 */ - &Scumm::o5_getScriptRunning, - &Scumm::o5_setOwnerOf, - &Scumm::o5_startScript, - &Scumm::o5_debug, + OPCODE(o5_getScriptRunning), + OPCODE(o5_setOwnerOf), + OPCODE(o5_startScript), + OPCODE(o5_debug), /* 6C */ - &Scumm::o5_getActorWidth, - &Scumm::o5_putActorInRoom, - &Scumm::o5_stopObjectScript, - &Scumm::o5_ifState, + OPCODE(o5_getActorWidth), + OPCODE(o5_putActorInRoom), + OPCODE(o5_stopObjectScript), + OPCODE(o5_ifNotState), /* 70 */ - &Scumm::o5_lights, - &Scumm::o5_getActorCostume, - &Scumm::o5_loadRoom, - &Scumm::o5_roomOps, + OPCODE(o5_lights), + OPCODE(o5_getActorCostume), + OPCODE(o5_loadRoom), + OPCODE(o5_roomOps), /* 74 */ - &Scumm::o5_getDist, - &Scumm::o5_findObject, - &Scumm::o5_walkActorToObject, - &Scumm::o5_startObject, + OPCODE(o5_getDist), + OPCODE(o5_findObject), + OPCODE(o5_walkActorToObject), + OPCODE(o5_startObject), /* 78 */ - &Scumm::o5_isGreater, /* less? */ - &Scumm::o5_doSentence, - &Scumm::o5_verbOps, - &Scumm::o5_getActorWalkBox, + OPCODE(o5_isGreater), /* less? */ + OPCODE(o5_doSentence), + OPCODE(o5_verbOps), + OPCODE(o5_getActorWalkBox), /* 7C */ - &Scumm::o5_isSoundRunning, - &Scumm::o5_findInventory, - &Scumm::o5_walkActorTo, - &Scumm::o5_drawBox, + OPCODE(o5_isSoundRunning), + OPCODE(o5_findInventory), + OPCODE(o5_walkActorTo), + OPCODE(o5_drawBox), /* 80 */ - &Scumm::o5_breakHere, - &Scumm::o5_putActor, - &Scumm::o5_startMusic, - &Scumm::o5_getActorRoom, + OPCODE(o5_breakHere), + OPCODE(o5_putActor), + OPCODE(o5_startMusic), + OPCODE(o5_getActorRoom), /* 84 */ - &Scumm::o5_isGreaterEqual, /* less equal? */ - &Scumm::o5_drawObject, - &Scumm::o5_getActorElevation, - &Scumm::o5_setState, + OPCODE(o5_isGreaterEqual), /* less equal? */ + OPCODE(o5_drawObject), + OPCODE(o5_getActorElevation), + OPCODE(o5_setState), /* 88 */ - &Scumm::o5_isNotEqual, - &Scumm::o5_faceActor, - &Scumm::o5_startScript, - &Scumm::o5_getVerbEntrypoint, + OPCODE(o5_isNotEqual), + OPCODE(o5_faceActor), + OPCODE(o5_startScript), + OPCODE(o5_getVerbEntrypoint), /* 8C */ - &Scumm::o5_resourceRoutines, - &Scumm::o5_walkActorToActor, - &Scumm::o5_putActorAtObject, - &Scumm::o5_getObjectState, + OPCODE(o5_resourceRoutines), + OPCODE(o5_walkActorToActor), + OPCODE(o5_putActorAtObject), + OPCODE(o5_getObjectState), /* 90 */ - &Scumm::o5_getObjectOwner, - &Scumm::o5_animateActor, - &Scumm::o5_panCameraTo, - &Scumm::o5_actorSet, + OPCODE(o5_getObjectOwner), + OPCODE(o5_animateActor), + OPCODE(o5_panCameraTo), + OPCODE(o5_actorSet), /* 94 */ - &Scumm::o5_print, - &Scumm::o5_actorFromPos, - &Scumm::o5_getRandomNr, - &Scumm::o5_and, + OPCODE(o5_print), + OPCODE(o5_actorFromPos), + OPCODE(o5_getRandomNr), + OPCODE(o5_and), /* 98 */ - &Scumm::o5_quitPauseRestart, - &Scumm::o5_doSentence, - &Scumm::o5_move, - &Scumm::o5_multiply, + OPCODE(o5_quitPauseRestart), + OPCODE(o5_doSentence), + OPCODE(o5_move), + OPCODE(o5_multiply), /* 9C */ - &Scumm::o5_startSound, - &Scumm::o5_ifClassOfIs, - &Scumm::o5_walkActorTo, - &Scumm::o5_isActorInBox, + OPCODE(o5_startSound), + OPCODE(o5_ifClassOfIs), + OPCODE(o5_walkActorTo), + OPCODE(o5_isActorInBox), /* A0 */ - &Scumm::o5_stopObjectCode, - &Scumm::o5_putActor, - &Scumm::o5_getAnimCounter, - &Scumm::o5_getActorY, + OPCODE(o5_stopObjectCode), + OPCODE(o5_putActor), + OPCODE(o5_getAnimCounter), + OPCODE(o5_getActorY), /* A4 */ - &Scumm::o5_loadRoomWithEgo, - &Scumm::o5_pickupObject, - &Scumm::o5_setVarRange, - &Scumm::o5_dummy, + OPCODE(o5_loadRoomWithEgo), + OPCODE(o5_pickupObject), + OPCODE(o5_setVarRange), + OPCODE(o5_dummy), /* A8 */ - &Scumm::o5_notEqualZero, - &Scumm::o5_setOwnerOf, - &Scumm::o5_startScript, - &Scumm::o5_saveRestoreVerbs, + OPCODE(o5_notEqualZero), + OPCODE(o5_setOwnerOf), + OPCODE(o5_startScript), + OPCODE(o5_saveRestoreVerbs), /* AC */ - &Scumm::o5_expression, - &Scumm::o5_putActorInRoom, - &Scumm::o5_wait, - &Scumm::o5_ifState, + OPCODE(o5_expression), + OPCODE(o5_putActorInRoom), + OPCODE(o5_wait), + OPCODE(o5_ifNotState), /* B0 */ - &Scumm::o5_matrixOps, - &Scumm::o5_getInventoryCount, - &Scumm::o5_setCameraAt, - &Scumm::o5_roomOps, + OPCODE(o5_matrixOps), + OPCODE(o5_getInventoryCount), + OPCODE(o5_setCameraAt), + OPCODE(o5_roomOps), /* B4 */ - &Scumm::o5_getDist, - &Scumm::o5_findObject, - &Scumm::o5_walkActorToObject, - &Scumm::o5_startObject, + OPCODE(o5_getDist), + OPCODE(o5_findObject), + OPCODE(o5_walkActorToObject), + OPCODE(o5_startObject), /* B8 */ - &Scumm::o5_lessOrEqual, - &Scumm::o5_doSentence, - &Scumm::o5_subtract, - &Scumm::o5_getActorScale, + OPCODE(o5_lessOrEqual), + OPCODE(o5_doSentence), + OPCODE(o5_subtract), + OPCODE(o5_getActorScale), /* BC */ - &Scumm::o5_stopSound, - &Scumm::o5_findInventory, - &Scumm::o5_walkActorTo, - &Scumm::o5_drawBox, + OPCODE(o5_stopSound), + OPCODE(o5_findInventory), + OPCODE(o5_walkActorTo), + OPCODE(o5_drawBox), /* C0 */ - &Scumm::o5_endCutscene, - &Scumm::o5_putActor, - &Scumm::o5_chainScript, - &Scumm::o5_getActorX, + OPCODE(o5_endCutscene), + OPCODE(o5_putActor), + OPCODE(o5_chainScript), + OPCODE(o5_getActorX), /* C4 */ - &Scumm::o5_isLess, - &Scumm::o5_drawObject, - &Scumm::o5_decrement, - &Scumm::o5_setState, + OPCODE(o5_isLess), + OPCODE(o5_drawObject), + OPCODE(o5_decrement), + OPCODE(o5_setState), /* C8 */ - &Scumm::o5_isEqual, - &Scumm::o5_faceActor, - &Scumm::o5_startScript, - &Scumm::o5_getVerbEntrypoint, + OPCODE(o5_isEqual), + OPCODE(o5_faceActor), + OPCODE(o5_startScript), + OPCODE(o5_getVerbEntrypoint), /* CC */ - &Scumm::o5_pseudoRoom, - &Scumm::o5_walkActorToActor, - &Scumm::o5_putActorAtObject, - &Scumm::o5_ifState, + OPCODE(o5_pseudoRoom), + OPCODE(o5_walkActorToActor), + OPCODE(o5_putActorAtObject), + OPCODE(o5_ifState), /* D0 */ - &Scumm::o5_pickupObjectOld, - &Scumm::o5_animateActor, - &Scumm::o5_actorFollowCamera, - &Scumm::o5_actorSet, + OPCODE(o5_pickupObjectOld), + OPCODE(o5_animateActor), + OPCODE(o5_actorFollowCamera), + OPCODE(o5_actorSet), /* D4 */ - &Scumm::o5_setObjectName, - &Scumm::o5_actorFromPos, - &Scumm::o5_getActorMoving, - &Scumm::o5_or, + OPCODE(o5_setObjectName), + OPCODE(o5_actorFromPos), + OPCODE(o5_getActorMoving), + OPCODE(o5_or), /* D8 */ - &Scumm::o5_printEgo, - &Scumm::o5_doSentence, - &Scumm::o5_add, - &Scumm::o5_divide, + OPCODE(o5_printEgo), + OPCODE(o5_doSentence), + OPCODE(o5_add), + OPCODE(o5_divide), /* DC */ - &Scumm::o5_oldRoomEffect, - &Scumm::o5_setClass, - &Scumm::o5_walkActorTo, - &Scumm::o5_isActorInBox, + OPCODE(o5_oldRoomEffect), + OPCODE(o5_setClass), + OPCODE(o5_walkActorTo), + OPCODE(o5_isActorInBox), /* E0 */ - &Scumm::o5_freezeScripts, - &Scumm::o5_putActor, - &Scumm::o5_stopScript, - &Scumm::o5_getActorFacing, + OPCODE(o5_freezeScripts), + OPCODE(o5_putActor), + OPCODE(o5_stopScript), + OPCODE(o5_getActorFacing), /* E4 */ - &Scumm::o5_loadRoomWithEgo, - &Scumm::o5_pickupObject, - &Scumm::o5_getClosestObjActor, - &Scumm::o5_dummy, + OPCODE(o5_loadRoomWithEgo), + OPCODE(o5_pickupObject), + OPCODE(o5_getClosestObjActor), + OPCODE(o5_dummy), /* E8 */ - &Scumm::o5_getScriptRunning, - &Scumm::o5_setOwnerOf, - &Scumm::o5_startScript, - &Scumm::o5_debug, + OPCODE(o5_getScriptRunning), + OPCODE(o5_setOwnerOf), + OPCODE(o5_startScript), + OPCODE(o5_debug), /* EC */ - &Scumm::o5_getActorWidth, - &Scumm::o5_putActorInRoom, - &Scumm::o5_stopObjectScript, - &Scumm::o5_ifState, + OPCODE(o5_getActorWidth), + OPCODE(o5_putActorInRoom), + OPCODE(o5_stopObjectScript), + OPCODE(o5_ifNotState), /* F0 */ - &Scumm::o5_lights, - &Scumm::o5_getActorCostume, - &Scumm::o5_loadRoom, - &Scumm::o5_roomOps, + OPCODE(o5_lights), + OPCODE(o5_getActorCostume), + OPCODE(o5_loadRoom), + OPCODE(o5_roomOps), /* F4 */ - &Scumm::o5_getDist, - &Scumm::o5_findObject, - &Scumm::o5_walkActorToObject, - &Scumm::o5_startObject, + OPCODE(o5_getDist), + OPCODE(o5_findObject), + OPCODE(o5_walkActorToObject), + OPCODE(o5_startObject), /* F8 */ - &Scumm::o5_isGreater, - &Scumm::o5_doSentence, - &Scumm::o5_verbOps, - &Scumm::o5_getActorWalkBox, + OPCODE(o5_isGreater), + OPCODE(o5_doSentence), + OPCODE(o5_verbOps), + OPCODE(o5_getActorWalkBox), /* FC */ - &Scumm::o5_isSoundRunning, - &Scumm::o5_findInventory, - &Scumm::o5_walkActorTo, - &Scumm::o5_drawBox + OPCODE(o5_isSoundRunning), + OPCODE(o5_findInventory), + OPCODE(o5_walkActorTo), + OPCODE(o5_drawBox) }; - static const char *opcode_lookup[] = { - /* 00 */ - "o5_stopObjectCode", - "o5_putActor", - "o5_startMusic", - "o5_getActorRoom", - /* 04 */ - "o5_isGreaterEqual", - "o5_drawObject", - "o5_getActorElevation", - "o5_setState", - /* 08 */ - "o5_isNotEqual", - "o5_faceActor", - "o5_startScript", - "o5_getVerbEntrypoint", - /* 0C */ - "o5_resourceRoutines", - "o5_walkActorToActor", - "o5_putActorAtObject", - "o5_getObjectState", - /* 10 */ - "o5_getObjectOwner", - "o5_animateActor", - "o5_panCameraTo", - "o5_actorSet", - /* 14 */ - "o5_print", - "o5_actorFromPos", - "o5_getRandomNr", - "o5_and", - /* 18 */ - "o5_jumpRelative", - "o5_doSentence", - "o5_move", - "o5_multiply", - /* 1C */ - "o5_startSound", - "o5_ifClassOfIs", - "o5_walkActorTo", - "o5_isActorInBox", - /* 20 */ - "o5_stopMusic", - "o5_putActor", - "o5_getAnimCounter", - "o5_getActorY", - /* 24 */ - "o5_loadRoomWithEgo", - "o5_pickupObject", - "o5_setVarRange", - "o5_stringOps", - /* 28 */ - "o5_equalZero", - "o5_setOwnerOf", - "o5_startScript", - "o5_delayVariable", - /* 2C */ - "o5_cursorCommand", - "o5_putActorInRoom", - "o5_delay", - "o5_ifNotState", - /* 30 */ - "o5_matrixOps", - "o5_getInventoryCount", - "o5_setCameraAt", - "o5_roomOps", - /* 34 */ - "o5_getDist", - "o5_findObject", - "o5_walkActorToObject", - "o5_startObject", - /* 38 */ - "o5_lessOrEqual", - "o5_doSentence", - "o5_subtract", - "o5_getActorScale", - /* 3C */ - "o5_stopSound", - "o5_findInventory", - "o5_walkActorTo", - "o5_drawBox", - /* 40 */ - "o5_cutscene", - "o5_putActor", - "o5_chainScript", - "o5_getActorX", - /* 44 */ - "o5_isLess", - "o5_drawObject", - "o5_increment", - "o5_setState", - /* 48 */ - "o5_isEqual", - "o5_faceActor", - "o5_startScript", - "o5_getVerbEntrypoint", - /* 4C */ - "o5_soundKludge", - "o5_walkActorToActor", - "o5_putActorAtObject", - "o5_ifState", - /* 50 */ - "o5_pickupObjectOld", - "o5_animateActor", - "o5_actorFollowCamera", - "o5_actorSet", - /* 54 */ - "o5_setObjectName", - "o5_actorFromPos", - "o5_getActorMoving", - "o5_or", - /* 58 */ - "o5_overRide", - "o5_doSentence", - "o5_add", - "o5_divide", - /* 5C */ - "o5_oldRoomEffect", - "o5_setClass", - "o5_walkActorTo", - "o5_isActorInBox", - /* 60 */ - "o5_freezeScripts", - "o5_putActor", - "o5_stopScript", - "o5_getActorFacing", - /* 64 */ - "o5_loadRoomWithEgo", - "o5_pickupObject", - "o5_getClosestObjActor", - "o5_dummy", - /* 68 */ - "o5_getScriptRunning", - "o5_setOwnerOf", - "o5_startScript", - "o5_debug", - /* 6C */ - "o5_getActorWidth", - "o5_putActorInRoom", - "o5_stopObjectScript", - "o5_ifNotState", - /* 70 */ - "o5_lights", - "o5_getActorCostume", - "o5_loadRoom", - "o5_roomOps", - /* 74 */ - "o5_getDist", - "o5_findObject", - "o5_walkActorToObject", - "o5_startObject", - /* 78 */ - "o5_isGreater", /* less? */ - "o5_doSentence", - "o5_verbOps", - "o5_getActorWalkBox", - /* 7C */ - "o5_isSoundRunning", - "o5_findInventory", - "o5_walkActorTo", - "o5_drawBox", - /* 80 */ - "o5_breakHere", - "o5_putActor", - "o5_startMusic", - "o5_getActorRoom", - /* 84 */ - "o5_isGreaterEqual", /* less equal? */ - "o5_drawObject", - "o5_getActorElevation", - "o5_setState", - /* 88 */ - "o5_isNotEqual", - "o5_faceActor", - "o5_startScript", - "o5_getVerbEntrypoint", - /* 8C */ - "o5_resourceRoutines", - "o5_walkActorToActor", - "o5_putActorAtObject", - "o5_getObjectState", - /* 90 */ - "o5_getObjectOwner", - "o5_animateActor", - "o5_panCameraTo", - "o5_actorSet", - /* 94 */ - "o5_print", - "o5_actorFromPos", - "o5_getRandomNr", - "o5_and", - /* 98 */ - "o5_quitPauseRestart", - "o5_doSentence", - "o5_move", - "o5_multiply", - /* 9C */ - "o5_startSound", - "o5_ifClassOfIs", - "o5_walkActorTo", - "o5_isActorInBox", - /* A0 */ - "o5_stopObjectCode", - "o5_putActor", - "o5_getAnimCounter", - "o5_getActorY", - /* A4 */ - "o5_loadRoomWithEgo", - "o5_pickupObject", - "o5_setVarRange", - "o5_dummy", - /* A8 */ - "o5_notEqualZero", - "o5_setOwnerOf", - "o5_startScript", - "o5_saveRestoreVerbs", - /* AC */ - "o5_expression", - "o5_putActorInRoom", - "o5_wait", - "o5_ifNotState", - /* B0 */ - "o5_matrixOps", - "o5_getInventoryCount", - "o5_setCameraAt", - "o5_roomOps", - /* B4 */ - "o5_getDist", - "o5_findObject", - "o5_walkActorToObject", - "o5_startObject", - /* B8 */ - "o5_lessOrEqual", - "o5_doSentence", - "o5_subtract", - "o5_getActorScale", - /* BC */ - "o5_stopSound", - "o5_findInventory", - "o5_walkActorTo", - "o5_drawBox", - /* C0 */ - "o5_endCutscene", - "o5_putActor", - "o5_chainScript", - "o5_getActorX", - /* C4 */ - "o5_isLess", - "o5_drawObject", - "o5_decrement", - "o5_setState", - /* C8 */ - "o5_isEqual", - "o5_faceActor", - "o5_startScript", - "o5_getVerbEntrypoint", - /* CC */ - "o5_pseudoRoom", - "o5_walkActorToActor", - "o5_putActorAtObject", - "o5_ifState", - /* D0 */ - "o5_pickupObjectOld", - "o5_animateActor", - "o5_actorFollowCamera", - "o5_actorSet", - /* D4 */ - "o5_setObjectName", - "o5_actorFromPos", - "o5_getActorMoving", - "o5_or", - /* D8 */ - "o5_printEgo", - "o5_doSentence", - "o5_add", - "o5_divide", - /* DC */ - "o5_oldRoomEffect", - "o5_setClass", - "o5_walkActorTo", - "o5_isActorInBox", - /* E0 */ - "o5_freezeScripts", - "o5_putActor", - "o5_stopScript", - "o5_getActorFacing", - /* E4 */ - "o5_loadRoomWithEgo", - "o5_pickupObject", - "o5_getClosestObjActor", - "o5_dummy", - /* E8 */ - "o5_getScriptRunning", - "o5_setOwnerOf", - "o5_startScript", - "o5_debug", - /* EC */ - "o5_getActorWidth", - "o5_putActorInRoom", - "o5_stopObjectScript", - "o5_ifNotState", - /* F0 */ - "o5_lights", - "o5_getActorCostume", - "o5_loadRoom", - "o5_roomOps", - /* F4 */ - "o5_getDist", - "o5_findObject", - "o5_walkActorToObject", - "o5_startObject", - /* F8 */ - "o5_isGreater", - "o5_doSentence", - "o5_verbOps", - "o5_getActorWalkBox", - /* FC */ - "o5_isSoundRunning", - "o5_findInventory", - "o5_walkActorTo", - "o5_drawBox", - }; - - - _opcodes = opcode_list; - _opcodes_lookup = opcode_lookup; + _opcodes = opcodes; } void Scumm::o5_actorFollowCamera() @@ -1383,9 +1060,19 @@ void Scumm::o5_ifState() { int a = getVarOrDirectWord(0x80); int b = getVarOrDirectByte(0x40); - bool isNegated = (_opcode & 0x20) ? true : false; - if ((getState(a) != b) ^ isNegated) + if (getState(a) != b) + o5_jumpRelative(); + else + ignoreScriptWord(); +} + +void Scumm::o5_ifNotState() +{ + int a = getVarOrDirectWord(0x80); + int b = getVarOrDirectByte(0x40); + + if (getState(a) == b) o5_jumpRelative(); else ignoreScriptWord(); |