[Scummvm-cvs-logs] scummvm master -> a40e43f7772f45dfa59de14d8f5349869c3f2d78

bluegr bluegr at gmail.com
Thu Jun 30 23:54:53 CEST 2016


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
36c7e7d252 SCI: Fixed KGetTime with SYSDATE subop in SCI0-LATE.
a40e43f777 Merge pull request #770 from OmerMor/kgettime


Commit: 36c7e7d252b1a41f551fdb47512d5095e4dfe488
    https://github.com/scummvm/scummvm/commit/36c7e7d252b1a41f551fdb47512d5095e4dfe488
Author: Omer Mor (omer.mor at gmail.com)
Date: 2016-06-27T08:16:58+03:00

Commit Message:
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.

Changed paths:
    engines/sci/engine/kmisc.cpp



diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index f4bb4ff..0a5f264 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;


Commit: a40e43f7772f45dfa59de14d8f5349869c3f2d78
    https://github.com/scummvm/scummvm/commit/a40e43f7772f45dfa59de14d8f5349869c3f2d78
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2016-07-01T00:54:44+03:00

Commit Message:
Merge pull request #770 from OmerMor/kgettime

SCI: Fixed KGetTime with SYSDATE subop in SCI0-LATE.

Changed paths:
    engines/sci/engine/kmisc.cpp









More information about the Scummvm-git-logs mailing list