aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he/script_v80he.cpp
diff options
context:
space:
mode:
authorMax Horn2009-04-16 09:27:22 +0000
committerMax Horn2009-04-16 09:27:22 +0000
commitcbe9e520d3b2b515428d33a4da8726e1a2dd82f1 (patch)
treec137855c759e3044fd22ff05cbe8969f408603f6 /engines/scumm/he/script_v80he.cpp
parent99df028d35a80a8cf932415a9e6bfc09179adf3e (diff)
downloadscummvm-rg350-cbe9e520d3b2b515428d33a4da8726e1a2dd82f1.tar.gz
scummvm-rg350-cbe9e520d3b2b515428d33a4da8726e1a2dd82f1.tar.bz2
scummvm-rg350-cbe9e520d3b2b515428d33a4da8726e1a2dd82f1.zip
SCUMM: Compacted various setupOpcodes() implementations by using the fact that opcode tables tend not to change much between most SCUMM versions
svn-id: r39958
Diffstat (limited to 'engines/scumm/he/script_v80he.cpp')
-rw-r--r--engines/scumm/he/script_v80he.cpp250
1 files changed, 7 insertions, 243 deletions
diff --git a/engines/scumm/he/script_v80he.cpp b/engines/scumm/he/script_v80he.cpp
index fccc81c499..b71a0f9e10 100644
--- a/engines/scumm/he/script_v80he.cpp
+++ b/engines/scumm/he/script_v80he.cpp
@@ -42,264 +42,28 @@ namespace Scumm {
#define OPCODE(i, x) _opcodes[i]._OPCODE(ScummEngine_v80he, x)
void ScummEngine_v80he::setupOpcodes() {
- /* 00 */
- OPCODE(0x00, o6_pushByte);
- OPCODE(0x01, o6_pushWord);
- OPCODE(0x02, o72_pushDWord);
- OPCODE(0x03, o6_pushWordVar);
- /* 04 */
- OPCODE(0x04, o72_getScriptString);
- OPCODE(0x07, o6_wordArrayRead);
- /* 08 */
- 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 */
- /* 20 */
- /* 24 */
- /* 28 */
- /* 2C */
- /* 30 */
- /* 34 */
- /* 38 */
- /* 3C */
- /* 40 */
- OPCODE(0x43, o6_writeWordVar);
- /* 44 */
+ ScummEngine_v72he::setupOpcodes();
+
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(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(0x6a, o6_freezeUnfreeze);
+ _opcodes[0x69].setProc(0, 0);
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(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(0x87, o6_getRandomNumber);
- /* 88 */
- OPCODE(0x88, o6_getRandomNumberRange);
- 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(0x95, o6_beginOverride);
- OPCODE(0x96, o6_endOverride);
- /* 98 */
- OPCODE(0x98, o6_isSoundRunning);
- OPCODE(0x99, o6_setBoxFlags);
- OPCODE(0x9b, o70_resourceRoutines);
- /* 9C */
- OPCODE(0x9c, o72_roomOps);
- OPCODE(0x9d, o72_actorOps);
- 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(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 */
+ _opcodes[0x76].setProc(0, 0);
+ _opcodes[0x94].setProc(0, 0);
+ _opcodes[0x9e].setProc(0, 0);
+ _opcodes[0xa5].setProc(0, 0);
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);
- /* 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);
- /* 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);
- /* E8 */
- 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);
}
-
void ScummEngine_v80he::o80_createSound() {
byte subOp = fetchScriptByte();