diff options
author | Paweł Kołodziejski | 2002-12-23 09:14:58 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2002-12-23 09:14:58 +0000 |
commit | af86ee50322270cadbc9458bb9c55ae1a919472a (patch) | |
tree | 3808830ea65c9ec25a5cdde6de939dee82968061 | |
parent | 1af90fe06ac7b2d648feb9b65e7b48279ddaface (diff) | |
download | scummvm-rg350-af86ee50322270cadbc9458bb9c55ae1a919472a.tar.gz scummvm-rg350-af86ee50322270cadbc9458bb9c55ae1a919472a.tar.bz2 scummvm-rg350-af86ee50322270cadbc9458bb9c55ae1a919472a.zip |
updated list opcode script v8
svn-id: r6066
-rw-r--r-- | scumm/intern.h | 157 | ||||
-rw-r--r-- | scumm/script_v8.cpp | 1353 |
2 files changed, 971 insertions, 539 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 60d311e791..e65152caf4 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -396,23 +396,162 @@ protected: virtual void executeOpcode(int i); virtual const char *getOpcodeDesc(int i); - virtual uint fetchScriptWord(); - virtual int fetchScriptWordSigned(); + virtual uint32 fetchScriptDword(); + virtual int fetchScriptDwordSigned(); /* Version 8 script opcodes */ void o8_unknown(); void o8_invalid(); + void o8_pushNumber(); + void o8_pushVariable(); + void o8_pushArrayValue(); + void o8_pushArrayValueIndexed(); + void o8_dup(); void o8_pop(); + void o8_not(); + void o8_eq(); + void o8_neq(); + void o8_gt(); + void o8_lt(); + void o8_leq(); + void o8_geq(); + void o8_add(); + void o8_sub(); + void o8_mul(); + void o8_div(); + void o8_land(); + void o8_lor(); + void o8_band(); + void o8_bor(); void o8_mod(); - void o8_wait(); - void o8_cursorCommand(); - void o8_resourceRoutines(); - void o8_roomOps(); - void o8_actorSet(); + void o8_if(); + void o8_ifNot(); + void o8_jump(); + void o8_breakHere(); + void o8_breakHereVar(); + void o8_waitForStuff(); + void o8_sleepJiffies(); + void o8_sleepSeconds(); + void o8_sleepMinutes(); + void o8_storeVariable(); + void o8_incVariable(); + void o8_decVariable(); + void o8_arrayDim(); + void o8_storeArray(); + void o8_incArray(); + void o8_decArray(); + void o8_arrayDim2(); + void o8_storeArrayIndexed(); + void o8_assignArray(); + void o8_arrayShuffle(); + void o8_arrayLocalize(); + void o8_startScript(); + void o8_startScriptQuick(); + void o8_endScript(); + void o8_stopScript(); + void o8_chainScript(); + void o8_return(); + void o8_startObject(); + void o8_stopObject(); + void o8_cutscene(); + void o8_endCutscene(); + void o8_freezeScripts(); + void o8_beginOverride(); + void o8_endOverride(); + void o8_stopSentence(); + void o8_debug(); + void o8_debugWin(); + void o8_cameraPanTo(); + void o8_cameraFollow(); + void o8_cameraAt(); + void o8_sayLine(); + void o8_sayLineDefault(); + void o8_sayLineSimple(); + void o8_sayLineSimpleDefault(); + void o8_printLine(); + void o8_printCursor(); + void o8_printDebug(); + void o8_printSystem(); + void o8_blastText(); + void o8_drawObject(); + void o8_blastObject(); + void o8_userFace(); + void o8_currentRoom(); + void o8_comeOutDoor(); + void o8_walkActorToObject(); + void o8_walkActorToXY(); + void o8_putActorAtXY(); + void o8_putActorAtObject(); + void o8_faceTowards(); + void o8_doAnimation(); + void o8_doSentence(); + void o8_pickUpObject(); + void o8_setBox(); + void o8_setBoxPath(); + void o8_setBoxSet(); + void o8_heapStuff(); + void o8_roomStuff(); + void o8_actorStuff(); void o8_cameraStuff(); - void o8_verbOps(); + void o8_verbStuff(); + void o8_startSfx(); + void o8_startMusic(); + void o8_stopSound(); + void o8_soundKludge(); + void o8_system(); + void o8_verbSets(); + void o8_newNameOf(); + void o8_getTimeDate(); + void o8_drawBox(); + void o8_actObjStamp(); + void o8_startVideo(); + void o8_kludge(); + void o8_pick(); + void o8_pickDefault(); + void o8_pickRandom(); + void o8_inSet(); + void o8_getRandomNumber(); + void o8_getRandomNumberRange(); + void o8_classOf(); + void o8_stateOf(); + void o8_ownerOf(); + void o8_scriptRunning(); + void o8_objectRunning(); + void o8_soundRunning(); + void o8_abs(); + void o8_pixel(); + void o8_inBox(); + void o8_validVerb(); + void o8_findActor(); + void o8_findObject(); + void o8_findVerb(); + void o8_findAllObjects(); + void o8_actorInvertory(); + void o8_actorInvertoryCount(); + void o8_actorVariable(); + void o8_actorRoom(); + void o8_actorBox(); + void o8_actorMoving(); + void o8_actorCostume(); + void o8_actorScale(); + void o8_actorDepth(); + void o8_actorElevation(); + void o8_actorWidth(); + void o8_actObjFacing(); + void o8_actObjX(); + void o8_actObjY(); + void o8_actorChore(); + void o8_proximity2ActObjs(); + void o8_proximity2Points(); + void o8_objectImageX(); + void o8_objectImageY(); + void o8_objectImageWidth(); + void o8_objectImageHeight(); + void o8_verbX(); + void o8_verbY(); + void o8_stringWidth(); + void o8_actorZPlane(); }; - #endif diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index 6e88455807..a6e5934ea1 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -33,328 +33,327 @@ void Scumm_v8::setupOpcodes() { - // TODO: any of the o6_ entries are potentially wrong and pure guesses :-) static const OpcodeEntryV8 opcodes[256] = { /* 00 */ - OPCODE(o8_unknown), - OPCODE(o6_pushWord), - OPCODE(o6_pushWordVar), - OPCODE(o6_wordArrayRead), + OPCODE(o8_invalid), + OPCODE(o8_pushNumber), + OPCODE(o8_pushVariable), + OPCODE(o8_pushArrayValue), /* 04 */ - OPCODE(o6_wordArrayIndexedRead), - OPCODE(o6_dup), + OPCODE(o8_pushArrayValueIndexed), + OPCODE(o8_dup), OPCODE(o8_pop), OPCODE(o6_not), /* 08 */ - OPCODE(o6_eq), - OPCODE(o6_neq), - OPCODE(o6_gt), - OPCODE(o6_lt), + OPCODE(o8_eq), + OPCODE(o8_neq), + OPCODE(o8_gt), + OPCODE(o8_lt), /* 0C */ - OPCODE(o6_le), - OPCODE(o6_ge), - OPCODE(o6_add), - OPCODE(o6_sub), + OPCODE(o8_leq), + OPCODE(o8_geq), + OPCODE(o8_add), + OPCODE(o8_sub), /* 10 */ - OPCODE(o6_mul), - OPCODE(o6_div), - OPCODE(o6_land), - OPCODE(o6_lor), + OPCODE(o8_mul), + OPCODE(o8_div), + OPCODE(o8_land), + OPCODE(o8_lor), /* 14 */ - OPCODE(o6_band), - OPCODE(o6_bor), + OPCODE(o8_band), + OPCODE(o8_bor), OPCODE(o8_mod), - OPCODE(o8_unknown), + OPCODE(o8_invalid), /* 18 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 1C */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 20 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 24 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 28 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 2C */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 30 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 34 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 38 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 3C */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 40 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 44 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 48 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 4C */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 50 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 54 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 58 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 5C */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 60 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* 64 */ - OPCODE(o6_jumpFalse), // Not sure about which of these two is which (false==if or true==if ?!?)... - OPCODE(o6_jumpTrue), // ... since "if" could mean 'jump "if"' or 'execute following code "if", otherwise jump'. - OPCODE(o6_jump), - OPCODE(o6_breakHere), + OPCODE(o8_if), + OPCODE(o8_ifNot), + OPCODE(o8_jump), + OPCODE(o8_breakHere), /* 68 */ - OPCODE(o8_unknown), - OPCODE(o8_wait), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_breakHereVar), + OPCODE(o8_waitForStuff), + OPCODE(o8_sleepJiffies), + OPCODE(o8_sleepSeconds), /* 6C */ - OPCODE(o8_unknown), - OPCODE(o6_writeWordVar), - OPCODE(o6_wordVarInc), - OPCODE(o6_wordVarDec), + OPCODE(o8_sleepMinutes), + OPCODE(o8_storeVariable), + OPCODE(o8_incVariable), + OPCODE(o8_decVariable), /* 70 */ - OPCODE(o6_dim), - OPCODE(o6_wordArrayWrite), - OPCODE(o6_wordArrayInc), - OPCODE(o6_wordArrayDec), + OPCODE(o8_arrayDim), + OPCODE(o8_storeArray), + OPCODE(o8_incArray), + OPCODE(o8_decArray), /* 74 */ - OPCODE(o6_dim2), - OPCODE(o6_wordArrayIndexedWrite), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_arrayDim2), + OPCODE(o8_storeArrayIndexed), + OPCODE(o8_assignArray), + OPCODE(o8_arrayShuffle), /* 78 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_arrayLocalize), + OPCODE(o8_startScript), + OPCODE(o8_startScriptQuick), + OPCODE(o8_endScript), /* 7C */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_stopScript), + OPCODE(o8_chainScript), + OPCODE(o8_return), + OPCODE(o8_startObject), /* 80 */ - OPCODE(o8_unknown), - OPCODE(o6_cutscene), - OPCODE(o6_endCutscene), - OPCODE(o8_unknown), + OPCODE(o8_stopObject), + OPCODE(o8_cutscene), + OPCODE(o8_endCutscene), + OPCODE(o8_freezeScripts), /* 84 */ - OPCODE(o6_beginOverride), - OPCODE(o6_endOverride), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_beginOverride), + OPCODE(o8_endOverride), + OPCODE(o8_stopSentence), + OPCODE(o8_debug), /* 88 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_debugWin), + OPCODE(o8_classOf), + OPCODE(o8_stateOf), + OPCODE(o8_ownerOf), /* 8C */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_cameraPanTo), + OPCODE(o8_cameraFollow), + OPCODE(o8_cameraAt), + OPCODE(o8_sayLine), /* 90 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_sayLineDefault), + OPCODE(o8_sayLineSimple), + OPCODE(o8_sayLineSimpleDefault), + OPCODE(o8_printLine), /* 94 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_printCursor), + OPCODE(o8_printDebug), + OPCODE(o8_printSystem), + OPCODE(o8_blastText), /* 98 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_drawObject), + OPCODE(o8_invalid), + OPCODE(o8_blastObject), + OPCODE(o8_invalid), /* 9C */ - OPCODE(o8_cursorCommand), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_userFace), + OPCODE(o8_currentRoom), + OPCODE(o8_comeOutDoor), + OPCODE(o8_walkActorToObject), /* A0 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_walkActorToXY), + OPCODE(o8_putActorAtXY), + OPCODE(o8_putActorAtObject), + OPCODE(o8_faceTowards), /* A4 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_doAnimation), + OPCODE(o8_doSentence), + OPCODE(o8_pickUpObject), + OPCODE(o8_setBox), /* A8 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_resourceRoutines), - OPCODE(o8_roomOps), + OPCODE(o8_setBoxPath), + OPCODE(o8_setBoxSet), + OPCODE(o8_heapStuff), + OPCODE(o8_roomStuff), /* AC */ - OPCODE(o8_actorSet), + OPCODE(o8_actorStuff), OPCODE(o8_cameraStuff), - OPCODE(o8_verbOps), - OPCODE(o8_unknown), + OPCODE(o8_verbStuff), + OPCODE(o8_startSfx), /* B0 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_startMusic), + OPCODE(o8_stopSound), + OPCODE(o8_soundKludge), + OPCODE(o8_system), /* B4 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_verbSets), + OPCODE(o8_newNameOf), + OPCODE(o8_getTimeDate), + OPCODE(o8_drawBox), /* B8 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_actObjStamp), + OPCODE(o8_startVideo), + OPCODE(o8_kludge), + OPCODE(o8_invalid), /* BC */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* C0 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* C4 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* C8 */ OPCODE(o6_startScript), OPCODE(o6_startObject), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_pick), + OPCODE(o8_pickDefault), /* CC */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o6_getRandomNumber), - OPCODE(o6_getRandomNumberRange), + OPCODE(o8_pickRandom), + OPCODE(o8_inSet), + OPCODE(o8_getRandomNumber), + OPCODE(o8_getRandomNumberRange), /* D0 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_classOf), + OPCODE(o8_stateOf), + OPCODE(o8_ownerOf), + OPCODE(o8_scriptRunning), /* D4 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_objectRunning), + OPCODE(o8_soundRunning), + OPCODE(o8_abs), + OPCODE(o8_pixel), /* D8 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_kludge), + OPCODE(o8_inBox), + OPCODE(o8_validVerb), + OPCODE(o8_findActor), /* DC */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_findObject), + OPCODE(o8_findVerb), + OPCODE(o8_findAllObjects), + OPCODE(o8_actorInvertory), /* E0 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_actorInvertoryCount), + OPCODE(o8_actorVariable), + OPCODE(o8_actorRoom), + OPCODE(o8_actorBox), /* E4 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_actorMoving), + OPCODE(o8_actorCostume), + OPCODE(o8_actorScale), + OPCODE(o8_actorDepth), /* E8 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_actorElevation), + OPCODE(o8_actorWidth), + OPCODE(o8_actObjFacing), + OPCODE(o8_actObjX), /* EC */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_actObjY), + OPCODE(o8_actorChore), + OPCODE(o8_proximity2ActObjs), + OPCODE(o8_proximity2Points), /* F0 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_objectImageX), + OPCODE(o8_objectImageY), + OPCODE(o8_objectImageWidth), + OPCODE(o8_objectImageHeight), /* F4 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_verbX), + OPCODE(o8_verbY), + OPCODE(o8_stringWidth), + OPCODE(o8_actorZPlane), /* F8 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), /* FC */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), + OPCODE(o8_invalid), }; _opcodesV8 = opcodes; @@ -371,8 +370,7 @@ const char *Scumm_v8::getOpcodeDesc(int i) return _opcodesV8[i].desc; } -// In V8, the word size is 4 byte, not 2 bytes as in V6/V7 games -uint Scumm_v8::fetchScriptWord() +uint32 Scumm_v8::fetchScriptDword() { int a; if (*_lastCodePtr + sizeof(MemBlkHeader) != _scriptOrgPointer) { @@ -385,33 +383,125 @@ uint Scumm_v8::fetchScriptWord() return a; } -int Scumm_v8::fetchScriptWordSigned() +int Scumm_v8::fetchScriptDwordSigned() { - return (int32)fetchScriptWord(); + return (int32)fetchScriptDword(); } -void Scumm_v8::o8_unknown() +void Scumm_v8::o8_invalid() { - warning("Unknown opcode '%x' at %x", _opcode, _scriptPointer - _scriptOrgPointer); + error("Invalid opcode '%x' at %x", _opcode, _scriptPointer - _scriptOrgPointer); } -void Scumm_v8::o8_invalid() +void Scumm_v8::o8_pushNumber() +{ +} + +void Scumm_v8::o8_pushVariable() +{ +} + +void Scumm_v8::o8_pushArrayValue() +{ +} + +void Scumm_v8::o8_pushArrayValueIndexed() +{ +} + +void Scumm_v8::o8_dup() { - error("Invalid opcode '%x' at %x", _opcode, _scriptPointer - _scriptOrgPointer); } void Scumm_v8::o8_pop() { - pop(); +} + +void Scumm_v8::o8_not() +{ +} + +void Scumm_v8::o8_eq() +{ +} + +void Scumm_v8::o8_neq() +{ +} + +void Scumm_v8::o8_gt() +{ +} + +void Scumm_v8::o8_lt() +{ +} + +void Scumm_v8::o8_leq() +{ +} + +void Scumm_v8::o8_geq() +{ +} + +void Scumm_v8::o8_add() +{ +} + +void Scumm_v8::o8_sub() +{ +} + +void Scumm_v8::o8_mul() +{ +} + +void Scumm_v8::o8_div() +{ +} + +void Scumm_v8::o8_land() +{ +} + +void Scumm_v8::o8_lor() +{ +} + +void Scumm_v8::o8_band() +{ } void Scumm_v8::o8_mod() { - int a = pop(); - push(pop() % a); } -void Scumm_v8::o8_wait() +void Scumm_v8::o8_bor() +{ +} + +void Scumm_v8::o8_if() +{ +} + +void Scumm_v8::o8_ifNot() +{ +} + +void Scumm_v8::o8_jump() +{ +} + +void Scumm_v8::o8_breakHere() +{ +} + +void Scumm_v8::o8_breakHereVar() +{ +} + +void Scumm_v8::o8_waitForStuff() { // TODO byte subOp = fetchScriptByte(); @@ -427,7 +517,187 @@ void Scumm_v8::o8_wait() } } -void Scumm_v8::o8_cursorCommand() +void Scumm_v8::o8_sleepJiffies() +{ +} + +void Scumm_v8::o8_sleepSeconds() +{ +} + +void Scumm_v8::o8_sleepMinutes() +{ +} + +void Scumm_v8::o8_storeVariable() +{ +} + +void Scumm_v8::o8_incVariable() +{ +} + +void Scumm_v8::o8_decVariable() +{ +} + +void Scumm_v8::o8_arrayDim() +{ +} + +void Scumm_v8::o8_storeArray() +{ +} + +void Scumm_v8::o8_incArray() +{ +} + +void Scumm_v8::o8_decArray() +{ +} + +void Scumm_v8::o8_arrayDim2() +{ +} + +void Scumm_v8::o8_storeArrayIndexed() +{ +} + +void Scumm_v8::o8_assignArray() +{ +} + +void Scumm_v8::o8_arrayShuffle() +{ +} + +void Scumm_v8::o8_arrayLocalize() +{ +} + +void Scumm_v8::o8_startScript() +{ +} + +void Scumm_v8::o8_startScriptQuick() +{ +} + +void Scumm_v8::o8_endScript() +{ +} + +void Scumm_v8::o8_stopScript() +{ +} + +void Scumm_v8::o8_chainScript() +{ +} + +void Scumm_v8::o8_return() +{ +} + +void Scumm_v8::o8_startObject() +{ +} + +void Scumm_v8::o8_stopObject() +{ +} + +void Scumm_v8::o8_cutscene() +{ +} + +void Scumm_v8::o8_endCutscene() +{ +} + +void Scumm_v8::o8_freezeScripts() +{ +} + +void Scumm_v8::o8_beginOverride() +{ +} + +void Scumm_v8::o8_endOverride() +{ +} + +void Scumm_v8::o8_stopSentence() +{ +} + +void Scumm_v8::o8_debug() +{ +} + +void Scumm_v8::o8_debugWin() +{ +} + +void Scumm_v8::o8_cameraPanTo() +{ +} + +void Scumm_v8::o8_cameraFollow() +{ +} + +void Scumm_v8::o8_cameraAt() +{ +} + +void Scumm_v8::o8_sayLine() +{ +} + +void Scumm_v8::o8_sayLineDefault() +{ +} + +void Scumm_v8::o8_sayLineSimple() +{ +} + +void Scumm_v8::o8_sayLineSimpleDefault() +{ +} + +void Scumm_v8::o8_printLine() +{ +} + +void Scumm_v8::o8_printCursor() +{ +} + +void Scumm_v8::o8_printDebug() +{ +} + +void Scumm_v8::o8_printSystem() +{ +} + +void Scumm_v8::o8_blastText() +{ +} + +void Scumm_v8::o8_drawObject() +{ +} + +void Scumm_v8::o8_blastObject() +{ +} + +void Scumm_v8::o8_userFace() { // TODO byte subOp = fetchScriptByte(); @@ -451,7 +721,59 @@ void Scumm_v8::o8_cursorCommand() } } -void Scumm_v8::o8_resourceRoutines() +void Scumm_v8::o8_currentRoom() +{ +} + +void Scumm_v8::o8_comeOutDoor() +{ +} + +void Scumm_v8::o8_walkActorToObject() +{ +} + +void Scumm_v8::o8_walkActorToXY() +{ +} + +void Scumm_v8::o8_putActorAtXY() +{ +} + +void Scumm_v8::o8_putActorAtObject() +{ +} + +void Scumm_v8::o8_faceTowards() +{ +} + +void Scumm_v8::o8_doAnimation() +{ +} + +void Scumm_v8::o8_doSentence() +{ +} + +void Scumm_v8::o8_pickUpObject() +{ +} + +void Scumm_v8::o8_setBox() +{ +} + +void Scumm_v8::o8_setBoxPath() +{ +} + +void Scumm_v8::o8_setBoxSet() +{ +} + +void Scumm_v8::o8_heapStuff() { // TODO byte subOp = fetchScriptByte(); @@ -475,11 +797,11 @@ void Scumm_v8::o8_resourceRoutines() case 0x4C: // SO_HEAP_NUKE_SCRIPT Remove script from heap case 0x4D: // SO_HEAP_NUKE_SOUND Remove sound from heap default: - error("o8_resourceRoutines: default case %d", subOp); + error("o8_heapStuff: default case %d", subOp); } } -void Scumm_v8::o8_roomOps() +void Scumm_v8::o8_roomStuff() { // TODO byte subOp = fetchScriptByte(); @@ -499,17 +821,17 @@ void Scumm_v8::o8_roomOps() case 0x5E: // SO_ROOM_LOAD_GAME Load game case 0x5F: // SO_ROOM_SATURATION Set saturation of room colors default: - error("o8_roomOps: default case %d", subOp); + error("o8_roomStuff: default case %d", subOp); } } -void Scumm_v8::o8_actorSet() +void Scumm_v8::o8_actorStuff() { // TODO byte subOp = fetchScriptByte(); Actor *a; - a = derefActorSafe(_curActor, "o8_actorSet"); + a = derefActorSafe(_curActor, "o8_actorStuff"); if (!a) return; @@ -553,7 +875,7 @@ void Scumm_v8::o8_actorSet() case 0x88: // SO_ACTOR_FREQUENCY Set frequency of actor speech case 0x89: // SO_ACTOR_PAN default: - error("o8_actorset: default case %d", subOp); + error("o8_actorStuff: default case %d", subOp); } } @@ -569,7 +891,7 @@ void Scumm_v8::o8_cameraStuff() } } -void Scumm_v8::o8_verbOps() +void Scumm_v8::o8_verbStuff() { // TODO byte subOp = fetchScriptByte(); @@ -593,271 +915,242 @@ void Scumm_v8::o8_verbOps() case 0xA6: // SO_VERB_CHARSET Choose charset for verb case 0xA7: // SO_VERB_LINE_SPACING Choose linespacing for verb default: - error("o8_verbops: default case %d", subOp); + error("o8_verbStuff: default case %d", subOp); } } +void Scumm_v8::o8_startSfx() +{ +} + +void Scumm_v8::o8_startMusic() +{ +} + +void Scumm_v8::o8_stopSound() +{ +} + +void Scumm_v8::o8_soundKludge() +{ +} + +void Scumm_v8::o8_system() +{ +} + +void Scumm_v8::o8_verbSets() +{ +} + +void Scumm_v8::o8_newNameOf() +{ +} + +void Scumm_v8::o8_getTimeDate() +{ +} + +void Scumm_v8::o8_drawBox() +{ +} + +void Scumm_v8::o8_actObjStamp() +{ +} + +void Scumm_v8::o8_startVideo() +{ +} + +void Scumm_v8::o8_pick() +{ +} + +void Scumm_v8::o8_pickDefault() +{ +} + +void Scumm_v8::o8_pickRandom() +{ +} + +void Scumm_v8::o8_inSet() +{ +} + +void Scumm_v8::o8_getRandomNumber() +{ +} + +void Scumm_v8::o8_getRandomNumberRange() +{ +} + +void Scumm_v8::o8_classOf() +{ +} + +void Scumm_v8::o8_stateOf() +{ +} + +void Scumm_v8::o8_ownerOf() +{ +} + +void Scumm_v8::o8_scriptRunning() +{ +} + +void Scumm_v8::o8_objectRunning() +{ +} + +void Scumm_v8::o8_soundRunning() +{ +} + +void Scumm_v8::o8_abs() +{ +} + +void Scumm_v8::o8_pixel() +{ +} + +void Scumm_v8::o8_kludge() +{ +} + +void Scumm_v8::o8_inBox() +{ +} + +void Scumm_v8::o8_validVerb() +{ +} + +void Scumm_v8::o8_findActor() +{ +} + +void Scumm_v8::o8_findObject() +{ +} + +void Scumm_v8::o8_findVerb() +{ +} + +void Scumm_v8::o8_findAllObjects() +{ +} + +void Scumm_v8::o8_actorInvertory() +{ +} + +void Scumm_v8::o8_actorInvertoryCount() +{ +} + +void Scumm_v8::o8_actorVariable() +{ +} + +void Scumm_v8::o8_actorRoom() +{ +} + +void Scumm_v8::o8_actorBox() +{ +} + +void Scumm_v8::o8_actorMoving() +{ +} + +void Scumm_v8::o8_actorCostume() +{ +} + +void Scumm_v8::o8_actorScale() +{ +} + +void Scumm_v8::o8_actorDepth() +{ +} + +void Scumm_v8::o8_actorElevation() +{ +} + +void Scumm_v8::o8_actorWidth() +{ +} + +void Scumm_v8::o8_actObjFacing() +{ +} + +void Scumm_v8::o8_actObjX() +{ +} + +void Scumm_v8::o8_actObjY() +{ +} + +void Scumm_v8::o8_actorChore() +{ +} + +void Scumm_v8::o8_proximity2ActObjs() +{ +} + +void Scumm_v8::o8_proximity2Points() +{ +} + +void Scumm_v8::o8_objectImageX() +{ +} + +void Scumm_v8::o8_objectImageY() +{ +} + +void Scumm_v8::o8_objectImageWidth() +{ +} + +void Scumm_v8::o8_objectImageHeight() +{ +} + +void Scumm_v8::o8_verbX() +{ +} + +void Scumm_v8::o8_verbY() +{ +} + +void Scumm_v8::o8_stringWidth() +{ +} + +void Scumm_v8::o8_actorZPlane() +{ +} + /* From http://scummrev.mixnmojo.com/specs/CMIOpcodes.shtml -000 O_0 -001 O_PUSH_NUMBER Push number onto stack. -002 O_PUSH_VARIABLE Push variable value onto stack. -003 O_PUSH_ARRAY_VALUE Push array value onto stack. -004 O_PUSH_ARRAY2_VALUE ? -005 O_DUP Duplicate stack value -006 O_POP Pop value from stack. -007 O_NOT NOT (!) -008 O_EQ Equals (==) -009 O_NEQ Does not equal (!=) -00A O_GT Greater than (>) -00B O_LT Less than (<) -00C O_LEQ Less than or equal (<=) -00D O_GEQ Greater than or equal (>=) -00E O_ADD Add (+) -00F O_SUB Subtract (-) -010 O_MUL Multiply (*) -011 O_DIV Divide (/) -012 O_LAND Logical AND -013 O_LOR Logical OR -014 O_BAND Binary AND -015 O_BOR Binary OR -016 O_MOD Modulus (%) -017 O_23 -018 O_24 -019 O_25 -01A O_26 -01B O_27 -01C O_28 -01D O_29 -01E O_30 -01F O_31 -020 O_32 -021 O_33 -022 O_34 -023 O_35 -024 O_36 -025 O_37 -026 O_38 -027 O_39 -028 O_40 -029 O_41 -02A O_42 -02B O_43 -02C O_44 -02D O_45 -02E O_46 -02F O_47 -030 O_48 -031 O_49 -032 O_50 -033 O_51 -034 O_52 -035 O_53 -036 O_54 -037 O_55 -038 O_56 -039 O_57 -03A O_58 -03B O_59 -03C O_60 -03D O_61 -03E O_62 -03F O_63 -040 O_64 -041 O_65 -042 O_66 -043 O_67 -044 O_68 -045 O_69 -046 O_70 -047 O_71 -048 O_72 -049 O_73 -04A O_74 -04B O_75 -04C O_76 -04D O_77 -04E O_78 -04F O_79 -050 O_80 -051 O_81 -052 O_82 -053 O_83 -054 O_84 -055 O_85 -056 O_86 -057 O_87 -058 O_88 -059 O_89 -05A O_90 -05B O_91 -05C O_92 -05D O_93 -05E O_94 -05F O_95 -060 O_96 -061 O_97 -062 O_98 -063 O_99 -064 O_IF if () -065 O_IF_NOT if not () -066 O_JUMP jump/goto -067 O_BREAK_HERE Break out of script -068 O_BREAK_HERE_VAR -069 O_WAIT_FOR_STUFF Wait Sub opcodes -06A O_SLEEP_JIFFIES Sleep for jiffies (10ths of a second) -06B O_SLEEP_SECONDS Sleep for seconds -06C O_SLEEP_MINUTES Sleep for minutes -06D O_STORE_VARIABLE Assign value to variable -06E O_INC_VARIABLE Increase variable value (++) -06F O_DEC_VARIABLE Decrease variable value (--) -070 O_ARRAY_DIM Set dimension of array -071 O_STORE_ARRAY Assign value to array -072 O_INC_ARRAY Increase array value -073 O_DEC_ARRAY Decrease array value -074 O_ARRAY_DIM2 Set dimensions of 2 dimensional array -075 O_STORE_ARRAY2 Assign value to 2 dimensional array -076 O_ASSIGN_ARRAY ? -077 O_ARRAY_SHUFFLE Shuffle array -078 O_ARRAY_LOCALIZE ? -079 O_START_SCRIPT Start script -07A O_START_SCRIPT_QUICK ? -07B O_END_SCRIPT End script -07C O_STOP_SCRIPT Stop script from running -07D O_CHAIN_SCRIPT ? -07E O_RETURN Return -07F O_START_OBJECT ? -080 O_STOP_OBJECT ? -081 O_CUT_SCENE Start of cutscene (interface off) -082 O_END_CUT_SCENE End of cutscene (interface on) -083 O_FREEZE_SCRIPTS ? -084 O_OVERRIDE ? -085 O_OVERRIDE_OFF ? -086 O_STOP_SENTENCE ? -087 O_DEBUG Set debug mode -088 O_DEBUG_WINDEX Set debug mode with output to external window -089 O_CLASS_OF Set class of script -08A O_STATE_OF ? -08B O_OWNER_OF Set owner of object -08C O_CAMERA_PAN_TO Pan camera to (X,Y) -08D O_CAMERA_FOLLOW Make camera follow character/object -08E O_CAMERA_AT Place camera at specific (X,Y) -08F O_SAY_LINE Talk -090 O_SAY_LINE_DEFAULT Talk using default actor -091 O_SAY_LINE_SIMPLE Talk with less arguments -092 O_SAY_LINE_SIMPLE_DEFAULT Talk with less arguments using default actor -093 O_PRINT_LINE Print a line on screen -094 O_PRINT_CURSOR -095 O_PRINT_DEBUG -096 O_PRINT_SYSTEM -097 O_BLAST_TEXT Text to output to screen -098 O_DRAW_OBJECT Draw object -099 O_153 -09A O_BLAST_OBJECT -09B O_155 -09C O_USERFACE ? -09D O_CURRENT_ROOM Set current room -09E O_COME_OUT_DOOR -09F O_WALK_ACTOR_TO_OBJECT Walk to object -0A0 O_WALK_ACTOR_TO_XY Walk to coordinate -0A1 O_PUT_ACTOR_AT_XY Put at coordinate -0A2 O_PUT_ACTOR_AT_OBJECT Put at object -0A3 O_FACE_TOWARDS Change facing -0A4 O_DO_ANIMATION Animate -0A5 O_DO_SENTENCE -0A6 O_PICK_UP_OBJECT Pick up object -0A7 O_SET_BOX -0A8 O_SET_BOX_PATH -0A9 O_SET_BOX_SET -0AA O_HEAP_STUFF Heap sub opcodes -0AB O_ROOM_STUFF Room sub opcodes -0AC O_ACTOR_STUFF Actor sub opcodes -0AD O_CAMERA_STUFF Camera sub opcodes -0AE O_VERB_STUFF Verb sub opcodes -0AF O_START_SFX Start sound effect -0B0 O_START_MUSIC Start music -0B1 O_STOP_SOUND Stop sound (effect or music) -0B2 O_SOUND_KLUDGE ? -0B3 O_SYSTEM System sub opcodes -0B4 O_VERB_SETS -0B5 O_NEW_NAME_OF Set new name of object -0B6 O_GET_TIME_DATE Get time and/or date -0B7 O_DRAW_BOX -0B8 O_ACTOBJ_STAMP -0B9 O_START_VIDEO Start cutscene video -0BA O_KLUDGE -0BB O_187 -0BC O_188 -0BD O_189 -0BE O_190 -0BF O_191 -0C0 O_192 -0C1 O_193 -0C2 O_194 -0C3 O_195 -0C4 O_196 -0C5 O_197 -0C6 O_198 -0C7 O_199 -0C8 F_START_SCRIPT Start script -0C9 F_START_OBJECT Start object script -0CA F_PICK -0CB F_PICK_DEFAULT -0CC F_PICK_RANDOM -0CD F_IN_SET -0CE F_RANDOM Get random number -0CF F_RANDOM_BETWEEN Get random number between two values -0D0 F_CLASS_OF Get class of script -0D1 F_STATE_OF -0D2 F_OWNER_OF Get owner of object -0D3 F_SCRIPT_RUNNING Test if script is running -0D4 F_OBJECT_RUNNING Test if object is running -0D5 F_SOUND_RUNNING Test if sound is running -0D6 F_ABS Get absolute value -0D7 F_PIXEL -0D8 F_KLUDGE -0D9 F_IN_BOX Test if object is in box -0DA F_VALID_VERB -0DB F_FIND_ACTOR -0DC F_FIND_OBJECT -0DD F_FIND_VERB -0DE F_FIND_ALL_OBJECTS -0DF F_ACTOR_INVENTORY -0E0 F_ACTOR_INVENTORY_COUNT Get number of items in inventory -0E1 F_ACTOR_VARIABLE Get actor variable (property) -0E2 F_ACTOR_ROOM Get current room for actor -0E3 F_ACTOR_BOX Get current box for actor -0E4 F_ACTOR_MOVING Test if actor is moving -0E5 F_ACTOR_COSTUME Get current costume for actor -0E6 F_ACTOR_SCALE Get current scale of actor -0E7 F_ACTOR_DEPTH Get current Z position of actor -0E8 F_ACTOR_ELEVATION Get current actor elevation -0E9 F_ACTOR_WIDTH Get current actor width -0EA F_ACTOBJ_FACING Get current actor/object facing -0EB F_ACTOBJ_X Get X position of actor/object -0EC F_ACTOBJ_Y Get Y position of actor/object -0ED F_ACTOR_CHORE -0EE F_PROXIMITY_2ACTOBJS Get distance between 2 actors/objects -0EF F_PROXIMITY_2POINTS Get distance between 2 points -0F0 F_OBJECT_IMAGE_X Get X position of object image -0F1 F_OBJECT_IMAGE_Y Get Y position of object image -0F2 F_OBJECT_IMAGE_WIDTH Get width of object image -0F3 F_OBJECT_IMAGE_HEIGHT Get height of object image -0F4 F_VERB_X Get X position of verb -0F5 F_VERB_Y Get Y position of verb -0F6 F_STRING_WIDTH -0F7 F_ACTOR_ZPLANE -0F8 O_248 -0F9 O_249 -0FA O_250 -0FB O_251 -0FC O_252 -0FD O_253 -0FE O_254 -0FF O_255 - The following are subopcodes - just strip the leading 1 100 SO_256 |