aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2014-06-01 19:58:23 +0200
committerMartin Kiewitz2014-06-01 19:58:23 +0200
commit058fc2327f5d46374f40597a954415153ca39977 (patch)
tree2df7c87070879cb66b9eb0d0113d4df3134a63b7 /engines/sci
parent374bd9afc5f1d4b21bc446979dcd3feaa3072473 (diff)
downloadscummvm-rg350-058fc2327f5d46374f40597a954415153ca39977.tar.gz
scummvm-rg350-058fc2327f5d46374f40597a954415153ca39977.tar.bz2
scummvm-rg350-058fc2327f5d46374f40597a954415153ca39977.zip
SCI: fix kGetTime, fixes bug #6605
current year part wasn't calculated properly
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kmisc.cpp3
1 files changed, 2 insertions, 1 deletions
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: