diff options
author | Torbjörn Andersson | 2016-09-05 18:58:14 +0200 |
---|---|---|
committer | Torbjörn Andersson | 2016-09-05 18:58:14 +0200 |
commit | c4368a7cd205dd8bcadc485819bb0ad8ae18b2c7 (patch) | |
tree | e3fd091f9a31632bdc0fbd61b1f561e0e6a13e73 /engines | |
parent | 89dd40cd247fa45349d32a012e2816d2e21cccfe (diff) | |
download | scummvm-rg350-c4368a7cd205dd8bcadc485819bb0ad8ae18b2c7.tar.gz scummvm-rg350-c4368a7cd205dd8bcadc485819bb0ad8ae18b2c7.tar.bz2 scummvm-rg350-c4368a7cd205dd8bcadc485819bb0ad8ae18b2c7.zip |
MACVENTURE: Make opcode $ca return current time, not played time
This is used by some games to determine the appropriate greeting,
e.g. "Good evening" if you play the game in the evening.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/macventure/script.cpp | 25 |
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) { |