aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/kyra/kyra_mr.h10
-rw-r--r--engines/kyra/kyra_v2.h10
-rw-r--r--engines/kyra/script_hof.cpp64
-rw-r--r--engines/kyra/script_mr.cpp88
-rw-r--r--engines/kyra/script_v2.cpp65
5 files changed, 86 insertions, 151 deletions
diff --git a/engines/kyra/kyra_mr.h b/engines/kyra/kyra_mr.h
index 892349c9b8..ea2c58883e 100644
--- a/engines/kyra/kyra_mr.h
+++ b/engines/kyra/kyra_mr.h
@@ -568,16 +568,6 @@ private:
int o3_removeInventoryItemInstances(EMCState *script);
int o3_countInventoryItemInstances(EMCState *script);
int o3_npcChatSequence(EMCState *script);
- int o3_queryGameFlag(EMCState *script);
- int o3_resetGameFlag(EMCState *script);
- int o3_setGameFlag(EMCState *script);
- int o3_setHandItem(EMCState *script);
- int o3_removeHandItem(EMCState *script);
- int o3_handItemSet(EMCState *script);
- int o3_hideMouse(EMCState *script);
- int o3_addSpecialExit(EMCState *script);
- int o3_setMousePos(EMCState *script);
- int o3_showMouse(EMCState *script);
int o3_badConscienceChat(EMCState *script);
int o3_wipeDownMouseItem(EMCState *script);
int o3_setMalcolmsMood(EMCState *script);
diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h
index a4f7e4e9a1..44647e331e 100644
--- a/engines/kyra/kyra_v2.h
+++ b/engines/kyra/kyra_v2.h
@@ -288,6 +288,16 @@ protected:
int o2_getCharacterScene(EMCState *script);
int o2_trySceneChange(EMCState *script);
int o2_moveCharacter(EMCState *script);
+ int o2_queryGameFlag(EMCState *script);
+ int o2_resetGameFlag(EMCState *script);
+ int o2_setGameFlag(EMCState *script);
+ int o2_setHandItem(EMCState *script);
+ int o2_removeHandItem(EMCState *script);
+ int o2_handItemSet(EMCState *script);
+ int o2_hideMouse(EMCState *script);
+ int o2_addSpecialExit(EMCState *script);
+ int o2_setMousePos(EMCState *script);
+ int o2_showMouse(EMCState *script);
};
} // end of namespace Kyra
diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp
index 29a426d575..d4960de007 100644
--- a/engines/kyra/script_hof.cpp
+++ b/engines/kyra/script_hof.cpp
@@ -476,70 +476,6 @@ int KyraEngine_HoF::o2_countItemsInScene(EMCState *script) {
return count;
}
-int KyraEngine_HoF::o2_queryGameFlag(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_queryGameFlag(%p) (%d)", (const void *)script, stackPos(0));
- return queryGameFlag(stackPos(0));
-}
-
-int KyraEngine_HoF::o2_resetGameFlag(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_resetGameFlag(%p) (%d)", (const void *)script, stackPos(0));
- return resetGameFlag(stackPos(0));
-}
-
-int KyraEngine_HoF::o2_setGameFlag(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setGameFlag(%p) (%d)", (const void *)script, stackPos(0));
- return setGameFlag(stackPos(0));
-}
-
-int KyraEngine_HoF::o2_setHandItem(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setHandItem(%p) (%d)", (const void *)script, stackPos(0));
- setHandItem(stackPos(0));
- return 0;
-}
-
-int KyraEngine_HoF::o2_removeHandItem(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_removeHandItem(%p) ()", (const void *)script);
- removeHandItem();
- return 0;
-}
-
-int KyraEngine_HoF::o2_handItemSet(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_handItemSet(%p) ()", (const void *)script);
- return _handItemSet;
-}
-
-int KyraEngine_HoF::o2_hideMouse(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_hideMouse(%p) ()", (const void *)script);
- _screen->hideMouse();
- return 0;
-}
-
-int KyraEngine_HoF::o2_addSpecialExit(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_addSpecialExit(%p) (%d, %d, %d, %d, %d)", (const void *)script,
- stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
- if (_specialExitCount < 5) {
- _specialExitTable[_specialExitCount+0] = stackPos(0);
- _specialExitTable[_specialExitCount+5] = stackPos(1);
- _specialExitTable[_specialExitCount+10] = stackPos(2) + stackPos(0) - 1;
- _specialExitTable[_specialExitCount+15] = stackPos(3) + stackPos(1) - 1;
- _specialExitTable[_specialExitCount+20] = stackPos(4);
- ++_specialExitCount;
- }
- return 0;
-}
-
-int KyraEngine_HoF::o2_setMousePos(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setMousePos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- setMousePos(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_HoF::o2_showMouse(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_showMouse(%p) ()", (const void *)script);
- _screen->showMouse();
- return 0;
-}
-
int KyraEngine_HoF::o2_wipeDownMouseItem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_wipeDownMouseItem(%p) (-, %d, %d)", (const void *)script, stackPos(1), stackPos(2));
_screen->hideMouse();
diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp
index a4d4c65e64..5d31979dee 100644
--- a/engines/kyra/script_mr.cpp
+++ b/engines/kyra/script_mr.cpp
@@ -264,72 +264,6 @@ int KyraEngine_MR::o3_npcChatSequence(EMCState *script) {
return 0;
}
-int KyraEngine_MR::o3_queryGameFlag(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_queryGameFlag(%p) (%d)", (const void *)script, stackPos(0));
- return queryGameFlag(stackPos(0));
-}
-
-int KyraEngine_MR::o3_resetGameFlag(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_resetGameFlag(%p) (%d)", (const void *)script, stackPos(0));
- resetGameFlag(stackPos(0));
- return 0;
-}
-
-int KyraEngine_MR::o3_setGameFlag(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setGameFlag(%p) (%d)", (const void *)script, stackPos(0));
- setGameFlag(stackPos(0));
- return 1;
-}
-
-int KyraEngine_MR::o3_setHandItem(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setHandItem(%p) (%d)", (const void *)script, stackPos(0));
- setHandItem(stackPos(0));
- return 0;
-}
-
-int KyraEngine_MR::o3_removeHandItem(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_removeHandItem(%p) ()", (const void *)script);
- removeHandItem();
- return 0;
-}
-
-int KyraEngine_MR::o3_handItemSet(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_handItemSet(%p) ()", (const void *)script);
- return _handItemSet;
-}
-
-int KyraEngine_MR::o3_hideMouse(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_hideMouse(%p) ()", (const void *)script);
- _screen->hideMouse();
- return 0;
-}
-
-int KyraEngine_MR::o3_addSpecialExit(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_addSpecialExit(%p) (%d, %d, %d, %d, %d)", (const void *)script,
- stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
- if (_specialExitCount < 5) {
- _specialExitTable[_specialExitCount+0] = stackPos(0);
- _specialExitTable[_specialExitCount+5] = stackPos(1);
- _specialExitTable[_specialExitCount+10] = stackPos(2) + stackPos(0) - 1;
- _specialExitTable[_specialExitCount+15] = stackPos(3) + stackPos(1) - 1;
- _specialExitTable[_specialExitCount+20] = stackPos(4);
- ++_specialExitCount;
- }
- return 0;
-}
-
-int KyraEngine_MR::o3_setMousePos(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setMousePos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- setMousePos(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_MR::o3_showMouse(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_showMouse(%p) ()", (const void *)script);
- _screen->showMouse();
- return 0;
-}
-
int KyraEngine_MR::o3_badConscienceChat(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_badConscienceChat(%p) (%d)", (const void *)script, stackPos(0));
int id = stackPos(0);
@@ -1444,19 +1378,19 @@ void KyraEngine_MR::setupOpcodeTable() {
Opcode(o3_removeInventoryItemInstances);
Opcode(o3_countInventoryItemInstances);
Opcode(o3_npcChatSequence);
- Opcode(o3_queryGameFlag);
+ Opcode(o2_queryGameFlag);
// 0x28
- Opcode(o3_resetGameFlag);
- Opcode(o3_setGameFlag);
- Opcode(o3_setHandItem);
- Opcode(o3_removeHandItem);
+ Opcode(o2_resetGameFlag);
+ Opcode(o2_setGameFlag);
+ Opcode(o2_setHandItem);
+ Opcode(o2_removeHandItem);
// 0x2c
- Opcode(o3_handItemSet);
- Opcode(o3_hideMouse);
- Opcode(o3_addSpecialExit);
- Opcode(o3_setMousePos);
+ Opcode(o2_handItemSet);
+ Opcode(o2_hideMouse);
+ Opcode(o2_addSpecialExit);
+ Opcode(o2_setMousePos);
// 0x30
- Opcode(o3_showMouse);
+ Opcode(o2_showMouse);
Opcode(o3_badConscienceChat);
Opcode(o3_wipeDownMouseItem);
Opcode(o3_dummy);
@@ -1633,7 +1567,7 @@ void KyraEngine_MR::setupOpcodeTable() {
Opcode(o3d_updateAnim);
Opcode(o3d_delay);
Opcode(o3_getRand);
- Opcode(o3_queryGameFlag);
+ Opcode(o2_queryGameFlag);
// 0x04
Opcode(o3_dummy);
}
diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp
index f34c765c2d..dc7a7c8bd0 100644
--- a/engines/kyra/script_v2.cpp
+++ b/engines/kyra/script_v2.cpp
@@ -24,6 +24,7 @@
*/
#include "kyra/kyra_v2.h"
+#include "kyra/screen_v2.h"
namespace Kyra {
@@ -72,5 +73,69 @@ int KyraEngine_v2::o2_moveCharacter(EMCState *script) {
return 0;
}
+int KyraEngine_v2::o2_queryGameFlag(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_queryGameFlag(%p) (%d)", (const void *)script, stackPos(0));
+ return queryGameFlag(stackPos(0));
+}
+
+int KyraEngine_v2::o2_resetGameFlag(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_resetGameFlag(%p) (%d)", (const void *)script, stackPos(0));
+ return resetGameFlag(stackPos(0));
+}
+
+int KyraEngine_v2::o2_setGameFlag(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setGameFlag(%p) (%d)", (const void *)script, stackPos(0));
+ return setGameFlag(stackPos(0));
+}
+
+int KyraEngine_v2::o2_setHandItem(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setHandItem(%p) (%d)", (const void *)script, stackPos(0));
+ setHandItem(stackPos(0));
+ return 0;
+}
+
+int KyraEngine_v2::o2_removeHandItem(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_removeHandItem(%p) ()", (const void *)script);
+ removeHandItem();
+ return 0;
+}
+
+int KyraEngine_v2::o2_handItemSet(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_handItemSet(%p) ()", (const void *)script);
+ return _handItemSet;
+}
+
+int KyraEngine_v2::o2_hideMouse(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_hideMouse(%p) ()", (const void *)script);
+ screen()->hideMouse();
+ return 0;
+}
+
+int KyraEngine_v2::o2_addSpecialExit(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_addSpecialExit(%p) (%d, %d, %d, %d, %d)", (const void *)script,
+ stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ if (_specialExitCount < 5) {
+ _specialExitTable[_specialExitCount+0] = stackPos(0);
+ _specialExitTable[_specialExitCount+5] = stackPos(1);
+ _specialExitTable[_specialExitCount+10] = stackPos(2) + stackPos(0) - 1;
+ _specialExitTable[_specialExitCount+15] = stackPos(3) + stackPos(1) - 1;
+ _specialExitTable[_specialExitCount+20] = stackPos(4);
+ ++_specialExitCount;
+ }
+ return 0;
+}
+
+int KyraEngine_v2::o2_setMousePos(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setMousePos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ setMousePos(stackPos(0), stackPos(1));
+ return 0;
+}
+
+int KyraEngine_v2::o2_showMouse(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_showMouse(%p) ()", (const void *)script);
+ screen()->showMouse();
+ return 0;
+}
+
} // end of namespace Kyra