aboutsummaryrefslogtreecommitdiff
path: root/scumm/script_v72he.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scumm/script_v72he.cpp')
-rw-r--r--scumm/script_v72he.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp
index f0194a5cfc..1932298b24 100644
--- a/scumm/script_v72he.cpp
+++ b/scumm/script_v72he.cpp
@@ -605,21 +605,28 @@ void ScummEngine_v72he::o72_objectY() {
}
void ScummEngine_v72he::o72_getTimer() {
- int b = pop();
- int a = fetchScriptByte();
- warning("o72_getTimer stub (%d, %d)", b, a);
- if (a == 10)
- push(1);
- else
+ int timer = pop();
+ int cmd = fetchScriptByte();
+
+ if (cmd == 10) {
+ checkRange(3, 1, timer, "o72_getTimer: Timer %d out of range(%d)");
+ int diff = _system->get_msecs() - _timers[timer];
+ push(diff);
+ } else {
push(0);
+ }
}
void ScummEngine_v72he::o72_setTimer() {
- int b = pop();
- int a = fetchScriptByte();
- if (a != 158)
- error("TIMER command %d?", a);
- warning("o72_setTimer stub (%d, %d)", b, a);
+ int timer = pop();
+ int cmd = fetchScriptByte();
+
+ if (cmd == 158) {
+ checkRange(3, 1, timer, "o72_setTimer: Timer %d out of range(%d)");
+ _timers[timer] = _system->get_msecs();
+ } else {
+ error("TIMER command %d?", cmd);
+ }
}
void ScummEngine_v72he::o72_wordArrayDec() {