aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2008-03-27 23:53:49 +0000
committerJohannes Schickel2008-03-27 23:53:49 +0000
commit72484b204b85f1d25c01e0f0afc757d9a3c646b9 (patch)
tree814a7b15b9e205e2de6ca16c1aec822eec82cbc5
parentbf26f82cbbb1995b5bb31c9e3ac9c974b23c6e12 (diff)
downloadscummvm-rg350-72484b204b85f1d25c01e0f0afc757d9a3c646b9.tar.gz
scummvm-rg350-72484b204b85f1d25c01e0f0afc757d9a3c646b9.tar.bz2
scummvm-rg350-72484b204b85f1d25c01e0f0afc757d9a3c646b9.zip
- Implemented opcodes:
-> 51: o2_getElapsedSecs -> 52: o2_getTimerDelay - Added warnings to o2_delaySecs and o2_delay for unimplemented subfunctions svn-id: r31277
-rw-r--r--engines/kyra/kyra_v2.h2
-rw-r--r--engines/kyra/script_v2.cpp23
2 files changed, 22 insertions, 3 deletions
diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h
index 67d363074d..5d57c4ca66 100644
--- a/engines/kyra/kyra_v2.h
+++ b/engines/kyra/kyra_v2.h
@@ -995,6 +995,8 @@ protected:
int o2_setMousePos(ScriptState *script);
int o2_showMouse(ScriptState *script);
int o2_wipeDownMouseItem(ScriptState *script);
+ int o2_getElapsedSecs(ScriptState *script);
+ int o2_getTimerDelay(ScriptState *script);
//int o2_playSoundEffect(ScriptState *script);
int o2_delaySecs(ScriptState *script);
int o2_delay(ScriptState *script);
diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp
index 52a2f534a7..ac0a7e955f 100644
--- a/engines/kyra/script_v2.cpp
+++ b/engines/kyra/script_v2.cpp
@@ -593,14 +593,31 @@ int KyraEngine_v2::o2_wipeDownMouseItem(ScriptState *script) {
return 0;
}
+int KyraEngine_v2::o2_getElapsedSecs(ScriptState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getElapsedSecs(%p) ()", (const void *)script);
+ return _system->getMillis() / 1000;
+}
+
+int KyraEngine_v2::o2_getTimerDelay(ScriptState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getTimerDelay(%p) (%d)", (const void *)script, stackPos(0));
+ return _timer->getDelay(stackPos(0));
+}
+
int KyraEngine_v2::o2_delaySecs(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_delaySecs(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- delay(stackPos(0) * 1000, true);
+ if (stackPos(1))
+ warning("unimplemented o2_delaySecs subfunction");
+ //if (stackPos(1))
+ // sub_27100(stackPos(0) * _tickLength);
+ //else
+ delay(stackPos(0) * 1000, true);
return 0;
}
int KyraEngine_v2::o2_delay(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_delay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ if (stackPos(1))
+ warning("unimplemented o2_delay subfunction");
//if (stackPos(1))
// sub_27100(stackPos(0) * _tickLength);
//else
@@ -1780,9 +1797,9 @@ void KyraEngine_v2::setupOpcodeTable() {
Opcode(o2_showMouse),
OpcodeUnImpl(),
Opcode(o2_wipeDownMouseItem),
- OpcodeUnImpl(),
+ Opcode(o2_getElapsedSecs),
// 0x34
- OpcodeUnImpl(),
+ Opcode(o2_getTimerDelay),
Opcode(o2_playSoundEffect),
Opcode(o2_delaySecs),
Opcode(o2_delay),