diff options
author | Omer Mor | 2016-04-14 21:17:49 +0300 |
---|---|---|
committer | Omer Mor | 2016-06-27 08:16:58 +0300 |
commit | 36c7e7d252b1a41f551fdb47512d5095e4dfe488 (patch) | |
tree | f212c9c117b93552dcbfda69177eac9b32ccc7ec | |
parent | 9131976ff4a52eacebe4bd4efd6f71b6230bb61c (diff) | |
download | scummvm-rg350-36c7e7d252b1a41f551fdb47512d5095e4dfe488.tar.gz scummvm-rg350-36c7e7d252b1a41f551fdb47512d5095e4dfe488.tar.bz2 scummvm-rg350-36c7e7d252b1a41f551fdb47512d5095e4dfe488.zip |
SCI: Fixed KGetTime with SYSDATE subop in SCI0-LATE.
SSCI implementation of the SYSDATE subop of the GetTime kernel function was
changed between SCI0-LATE and SCI01: The base year used was changed from 1920 to
1980.
This subop is used in "Codename: Iceman" (Say "ask for date" to a passing girl
on the beach).
The Atari ST version of "Codename: Iceman" use the 1980 base year.
The Amiga version of "Codename: Iceman" appears to return the time instead of
date, with 0 for the YEAR part.
-rw-r--r-- | engines/sci/engine/kmisc.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index f4bb4ff85b..0a5f26476f 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -243,10 +243,18 @@ reg_t kGetTime(EngineState *s, int argc, reg_t *argv) { debugC(kDebugLevelTime, "GetTime(24h) returns %d", retval); break; case KGETTIME_DATE : - // 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); + { + // SCI0 late: Year since 1920 (0 = 1920, 1 = 1921, etc) + // SCI01 and newer: Year since 1980 (0 = 1980, 1 = 1981, etc) + // Atari ST SCI0 late versions use the newer base year. + int baseYear = 80; + if (getSciVersion() == SCI_VERSION_0_LATE && g_sci->getPlatform() == Common::kPlatformDOS) { + baseYear = 20; + } + retval = loc_time.tm_mday | ((loc_time.tm_mon + 1) << 5) | (((loc_time.tm_year - baseYear) & 0x7f) << 9); debugC(kDebugLevelTime, "GetTime(date) returns %d", retval); break; + } default: error("Attempt to use unknown GetTime mode %d", mode); break; |