aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/inter_v6.cpp
diff options
context:
space:
mode:
authorSven Hesse2009-06-17 04:16:21 +0000
committerSven Hesse2009-06-17 04:16:21 +0000
commit8615c5779184d1715b1eefa6cc5477ce7c7eebaf (patch)
tree138086d438a4a0ab05ffec479506408f66d223b5 /engines/gob/inter_v6.cpp
parent25c92dfdef52d6e6ebbd16e6ba8966272246fb45 (diff)
downloadscummvm-rg350-8615c5779184d1715b1eefa6cc5477ce7c7eebaf.tar.gz
scummvm-rg350-8615c5779184d1715b1eefa6cc5477ce7c7eebaf.tar.bz2
scummvm-rg350-8615c5779184d1715b1eefa6cc5477ce7c7eebaf.zip
Changed opcodeFunc to be functor-based
svn-id: r41602
Diffstat (limited to 'engines/gob/inter_v6.cpp')
-rw-r--r--engines/gob/inter_v6.cpp148
1 files changed, 13 insertions, 135 deletions
diff --git a/engines/gob/inter_v6.cpp b/engines/gob/inter_v6.cpp
index 587e2d9e0e..883ecfcd8a 100644
--- a/engines/gob/inter_v6.cpp
+++ b/engines/gob/inter_v6.cpp
@@ -40,7 +40,9 @@
namespace Gob {
#define OPCODE(x) _OPCODE(Inter_v6, x)
-#define OPCODEDRAW(i, x) _opcodesDraw[i]._OPCODEDRAW(Inter_v6, x)
+#define OPCODEVER Inter_v6
+#define OPCODEDRAW(i, x) _opcodesDraw[i]._OPCODEDRAW(OPCODEVER, x)
+#define OPCODEFUNC(i, x) _opcodesFunc[i]._OPCODEFUNC(OPCODEVER, x)
const int Inter_v6::_goblinFuncLookUp[][2] = {
{0, 0},
@@ -61,110 +63,17 @@ void Inter_v6::setupOpcodesDraw() {
OPCODEDRAW(0x85, o6_openItk);
}
-void Inter_v6::setupOpcodes() {
- static const OpcodeFuncEntryV6 opcodesFunc[80] = {
- /* 00 */
- OPCODE(o1_callSub),
- OPCODE(o1_callSub),
- OPCODE(o1_printTotText),
- OPCODE(o6_loadCursor),
- /* 04 */
- {0, ""},
- OPCODE(o1_switch),
- OPCODE(o1_repeatUntil),
- OPCODE(o1_whileDo),
- /* 08 */
- OPCODE(o1_if),
- OPCODE(o6_assign),
- OPCODE(o1_loadSpriteToPos),
- {0, ""},
- /* 0C */
- {0, ""},
- {0, ""},
- {0, ""},
- {0, ""},
- /* 10 */
- {0, ""},
- OPCODE(o2_printText),
- OPCODE(o1_loadTot),
- OPCODE(o6_palLoad),
- /* 14 */
- OPCODE(o1_keyFunc),
- OPCODE(o1_capturePush),
- OPCODE(o1_capturePop),
- OPCODE(o2_animPalInit),
- /* 18 */
- OPCODE(o2_addCollision),
- OPCODE(o6_freeCollision),
- OPCODE(o3_getTotTextItemPart),
- {0, ""},
- /* 1C */
- {0, ""},
- {0, ""},
- OPCODE(o1_drawOperations),
- OPCODE(o1_setcmdCount),
- /* 20 */
- OPCODE(o1_return),
- OPCODE(o1_renewTimeInVars),
- OPCODE(o1_speakerOn),
- OPCODE(o1_speakerOff),
- /* 24 */
- OPCODE(o1_putPixel),
- OPCODE(o2_goblinFunc),
- OPCODE(o1_createSprite),
- OPCODE(o1_freeSprite),
- /* 28 */
- {0, ""},
- {0, ""},
- {0, ""},
- {0, ""},
- /* 2C */
- {0, ""},
- {0, ""},
- {0, ""},
- {0, ""},
- /* 30 */
- OPCODE(o1_returnTo),
- OPCODE(o1_loadSpriteContent),
- OPCODE(o1_copySprite),
- OPCODE(o6_fillRect),
- /* 34 */
- OPCODE(o1_drawLine),
- OPCODE(o1_strToLong),
- OPCODE(o1_invalidate),
- OPCODE(o1_setBackDelta),
- /* 38 */
- OPCODE(o1_playSound),
- OPCODE(o2_stopSound),
- OPCODE(o2_loadSound),
- OPCODE(o1_freeSoundSlot),
- /* 3C */
- OPCODE(o1_waitEndPlay),
- OPCODE(o1_playComposition),
- OPCODE(o2_getFreeMem),
- OPCODE(o2_checkData),
- /* 40 */
- {0, ""},
- OPCODE(o1_prepareStr),
- OPCODE(o1_insertStr),
- OPCODE(o1_cutStr),
- /* 44 */
- OPCODE(o1_strstr),
- OPCODE(o5_istrlen),
- OPCODE(o1_setMousePos),
- OPCODE(o1_setFrameRate),
- /* 48 */
- OPCODE(o1_animatePalette),
- OPCODE(o1_animateCursor),
- OPCODE(o1_blitCursor),
- OPCODE(o1_loadFont),
- /* 4C */
- OPCODE(o1_freeFont),
- OPCODE(o2_readData),
- OPCODE(o2_writeData),
- OPCODE(o1_manageDataFile),
- };
+void Inter_v6::setupOpcodesFunc() {
+ Inter_v5::setupOpcodesFunc();
+ OPCODEFUNC(0x03, o6_loadCursor);
+ OPCODEFUNC(0x09, o6_assign);
+ OPCODEFUNC(0x13, o6_palLoad);
+ OPCODEFUNC(0x19, o6_freeCollision);
+ OPCODEFUNC(0x33, o6_fillRect);
+}
+
+void Inter_v6::setupOpcodes() {
static const OpcodeGoblinEntryV6 opcodesGoblin[71] = {
/* 00 */
{0, ""},
@@ -257,33 +166,9 @@ void Inter_v6::setupOpcodes() {
{0, ""},
};
- _opcodesFuncV6 = opcodesFunc;
_opcodesGoblinV6 = opcodesGoblin;
}
-bool Inter_v6::executeFuncOpcode(byte i, byte j, OpFuncParams &params) {
- _vm->_video->_palLUT->buildNext();
-
- debugC(1, kDebugFuncOp, "opcodeFunc %d.%d [0x%X.0x%X] (%s) - %s, %d, %d",
- i, j, i, j, getOpcodeFuncDesc(i, j), _vm->_game->_curTotFile,
- (uint) (_vm->_global->_inter_execPtr - _vm->_game->_totFileData),
- (uint) (_vm->_global->_inter_execPtr - _vm->_game->_totFileData - params.counter - 4));
-
- if ((i > 4) || (j > 15)) {
- warning("unimplemented opcodeFunc: %d.%d", i, j);
- return false;
- }
-
- OpcodeFuncProcV6 op = _opcodesFuncV6[i*16 + j].proc;
-
- if (op == 0)
- warning("unimplemented opcodeFunc: %d.%d", i, j);
- else
- return (this->*op) (params);
-
- return false;
-}
-
void Inter_v6::executeGoblinOpcode(int i, OpGobParams &params) {
debugC(1, kDebugGobOp, "opcodeGoblin %d [0x%X] (%s)",
i, i, getOpcodeGoblinDesc(i));
@@ -310,13 +195,6 @@ void Inter_v6::executeGoblinOpcode(int i, OpGobParams &params) {
}
}
-const char *Inter_v6::getOpcodeFuncDesc(byte i, byte j) {
- if ((i > 4) || (j > 15))
- return "";
-
- return _opcodesFuncV6[i*16 + j].desc;
-}
-
const char *Inter_v6::getOpcodeGoblinDesc(int i) {
for (int j = 0; j < ARRAYSIZE(_goblinFuncLookUp); j++)
if (_goblinFuncLookUp[j][0] == i)