From ef71f37a9c63039aa239393c476b96cbfe2b7d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Andersson?= Date: Mon, 5 Sep 2016 19:14:36 +0200 Subject: [PATCH] MACVENTURE: Implement opcode $cb (Get Current Day) In Deja Vu, Pete's All Nite Gun Palace is closed if you play the game on a Sunday. I'm guessing that's the only place where this opcode is used --- engines/macventure/script.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/engines/macventure/script.cpp b/engines/macventure/script.cpp index 2a1ffcfa1a4f..77bbea18661e 100644 --- a/engines/macventure/script.cpp +++ b/engines/macventure/script.cpp @@ -1061,8 +1061,14 @@ void ScriptEngine::opcaTIME(EngineState *state, EngineFrame *frame) { } void ScriptEngine::opcbDAY(EngineState *state, EngineFrame *frame) { - // Probaby irrelevant, so we push Day [9] - state->push(9); + TimeDate t; + g_system->getTimeAndDate(t); + + int weekday = 1 + t.tm_wday; + weekday = 1; + state->push(weekday); + + debugC(2, kMVDebugScript, "Current day of week: %d", weekday); } void ScriptEngine::opccCHLD(EngineState *state, EngineFrame *frame) {