aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/macventure/script.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/engines/macventure/script.cpp b/engines/macventure/script.cpp
index 87ba7178bc..2a1ffcfa1a 100644
--- a/engines/macventure/script.cpp
+++ b/engines/macventure/script.cpp
@@ -1044,19 +1044,20 @@ void ScriptEngine::opc9WAIT(EngineState *state, EngineFrame *frame) {
}
void ScriptEngine::opcaTIME(EngineState *state, EngineFrame *frame) {
- for (uint i = 0; i < 3; i++) {// We skip year, month and date
- state->push(0x00);
- }
+ TimeDate t;
+ g_system->getTimeAndDate(t);
+
+ int year = 1900 + t.tm_year;
+ int month = 1 + t.tm_mon;
+
+ state->push(year);
+ state->push(month);
+ state->push(t.tm_mday);
+ state->push(t.tm_hour);
+ state->push(t.tm_min);
+ state->push(t.tm_sec);
- uint32 totalPlayTime = _engine->getTotalPlayTime() / 1000; // In seconds
- int16 hours = totalPlayTime / 3600;
- totalPlayTime %= 3600;
- state->push(hours);
- int16 minutes = totalPlayTime / 60;
- totalPlayTime %= 60;
- state->push(minutes);
- state->push(totalPlayTime);
- debugC(2, kMVDebugScript, "Saved time: h[%d] m[%d] s[%d]", hours, minutes, totalPlayTime);
+ debugC(2, kMVDebugScript, "Saved time: Y[%d] M[%d] D[%d] h[%d] m[%d] s[%d]", year, month, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec);
}
void ScriptEngine::opcbDAY(EngineState *state, EngineFrame *frame) {