From 058fc2327f5d46374f40597a954415153ca39977 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Sun, 1 Jun 2014 19:58:23 +0200 Subject: SCI: fix kGetTime, fixes bug #6605 current year part wasn't calculated properly --- engines/sci/engine/kmisc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/sci') diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index e3a354e222..448e641b63 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -244,7 +244,8 @@ reg_t kGetTime(EngineState *s, int argc, reg_t *argv) { debugC(kDebugLevelTime, "GetTime(24h) returns %d", retval); break; case KGETTIME_DATE : - retval = loc_time.tm_mday | ((loc_time.tm_mon + 1) << 5) | (((loc_time.tm_year + 1900) & 0x7f) << 9); + // Year since 1980 (0 = 1980, 1 = 1981, etc.) + retval = loc_time.tm_mday | ((loc_time.tm_mon + 1) << 5) | (((loc_time.tm_year - 80) & 0x7f) << 9); debugC(kDebugLevelTime, "GetTime(date) returns %d", retval); break; default: -- cgit v1.2.3