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

bluegr md5 at scummvm.org
Sat May 26 15:45:26 CEST 2012


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

Summary:
79926b305c SCI: Bugfix for kFileIOReadRaw
b4152bd7eb SCI: Add some missing game-specific options
5af1ccbac6 SCI: Implement kGetConfig and kGetSierraProfileInt
f15582b190 SCI: Map another missing kFileIO call


Commit: 79926b305cada849e7881b4d10b8dc1ea8ad522a
    https://github.com/scummvm/scummvm/commit/79926b305cada849e7881b4d10b8dc1ea8ad522a
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-05-26T06:23:03-07:00

Commit Message:
SCI: Bugfix for kFileIOReadRaw

Avoid overwriting the target buffer with junk when no data has been read

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



diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index af438bd..b1f8522 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -812,7 +812,8 @@ reg_t kFileIOReadRaw(EngineState *s, int argc, reg_t *argv) {
 	FileHandle *f = getFileFromHandle(s, handle);
 	if (f) {
 		bytesRead = f->_in->read(buf, size);
-		s->_segMan->memcpy(argv[1], (const byte*)buf, size);
+		if (bytesRead > 0)
+			s->_segMan->memcpy(argv[1], (const byte*)buf, size);
 	}
 
 	delete[] buf;


Commit: b4152bd7ebe70dfff210bb74798c30012371812e
    https://github.com/scummvm/scummvm/commit/b4152bd7ebe70dfff210bb74798c30012371812e
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-05-26T06:32:37-07:00

Commit Message:
SCI: Add some missing game-specific options

Changed paths:
    engines/sci/detection_tables.h



diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index ff78d4f..506f79b 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -445,7 +445,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		{"resource.map", 0, "a4b73d5d2b55bdb6e44345e99c8fbdd0", 4804},
 		{"resource.000", 0, "d908dbef56816ac6c60dd145fdeafb2b", 3536046},
 		AD_LISTEND},
-	 	Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO1(GUIO_MIDIGM)	},
+	 	Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO4(GUIO_MIDIGM, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI)	},
 
 	// Eco Quest - English DOS Floppy
 	// SCI interpreter version 1.000.510
@@ -1007,7 +1007,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		{"resource.map", 0, "459f5b04467bc2107aec02f5c4b71b37", 4878},
 		{"resource.001", 0, "3876da2ce16fb7dea2f5d943d946fa84", 1652150},
 		AD_LISTEND},
-	 	Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO2(GUIO_MIDIGM, GAMEOPTION_JONES_CDAUDIO)	},
+	 	Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO4(GUIO_MIDIGM, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_FB01_MIDI, GAMEOPTION_JONES_CDAUDIO)	},
 
 	// King's Quest 1 SCI Remake - English Amiga (from www.back2roots.org)
 	// Executable scanning reports "1.003.007"
@@ -1221,7 +1221,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		{"resource.000", 0, "449471bfd77be52f18a3773c7f7d843d", 571368},
 		{"resource.001", 0, "b45a581ff8751e052c7e364f58d3617f", 16800210},
 		AD_LISTEND},
-	 	Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO1(GUIO_MIDIGM)	},
+	 	Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO4(GUIO_MIDIGM, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI)	},
 
 	// King's Quest 5 - English DOS Floppy
 	// SCI interpreter version 1.000.060


Commit: 5af1ccbac66925f4521419a36a970bff4259e984
    https://github.com/scummvm/scummvm/commit/5af1ccbac66925f4521419a36a970bff4259e984
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-05-26T06:41:11-07:00

Commit Message:
SCI: Implement kGetConfig and kGetSierraProfileInt

This fixes the sluggish game speed in Phantasmagoria (DOS/Windows)

Changed paths:
    engines/sci/engine/kernel.h
    engines/sci/engine/kernel_tables.h
    engines/sci/engine/kmisc.cpp



diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index 42651ec..664c97f 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -475,6 +475,7 @@ reg_t kMoveToEnd(EngineState *s, int argc, reg_t *argv);
 reg_t kGetWindowsOption(EngineState *s, int argc, reg_t *argv);
 reg_t kWinHelp(EngineState *s, int argc, reg_t *argv);
 reg_t kGetConfig(EngineState *s, int argc, reg_t *argv);
+reg_t kGetSierraProfileInt(EngineState *s, int argc, reg_t *argv);
 reg_t kCelInfo(EngineState *s, int argc, reg_t *argv);
 reg_t kSetLanguage(EngineState *s, int argc, reg_t *argv);
 reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv);
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index 1fa12b0..d8414b3 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -560,6 +560,7 @@ static SciKernelMapEntry s_kernelMap[] = {
 	{ MAP_CALL(GetWindowsOption),  SIG_EVERYWHERE,           "i",                     NULL,            NULL },
 	{ MAP_CALL(WinHelp),           SIG_EVERYWHERE,           "(.*)",                  NULL,            NULL },
 	{ MAP_CALL(GetConfig),         SIG_EVERYWHERE,           "ro",                    NULL,            NULL },
+	{ MAP_CALL(GetSierraProfileInt), SIG_EVERYWHERE,         "rri",                   NULL,            NULL },
 	{ MAP_CALL(CelInfo),           SIG_EVERYWHERE,           "iiiiii",                NULL,            NULL },
 	{ MAP_CALL(SetLanguage),       SIG_EVERYWHERE,           "r",                     NULL,            NULL },
 	{ MAP_CALL(ScrollWindow),      SIG_EVERYWHERE,           "(.*)",                  NULL,            NULL },
@@ -579,11 +580,6 @@ static SciKernelMapEntry s_kernelMap[] = {
 	// the game window in Phantasmagoria 2. We ignore these settings completely.
 	{ MAP_EMPTY(SetWindowsOption), SIG_EVERYWHERE,             "ii",                  NULL,            NULL },
 
-	// Used by the Windows version of Phantasmagoria 1 to get the video speed setting. This is called after
-	// kGetConfig and overrides the setting obtained by it. It is a dummy function in the DOS Version. We can
-	// just use GetConfig and mark this one as empty, like the DOS version does.
-	{ MAP_EMPTY(GetSierraProfileInt), SIG_EVERYWHERE,        "(.*)",                  NULL,            NULL },
-
 	// Debug function called whenever the current room changes
 	{ MAP_EMPTY(NewRoom),           SIG_EVERYWHERE,          "(.*)",                  NULL,            NULL },
 
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index a32480c..2be9432 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -356,10 +356,52 @@ reg_t kGetConfig(EngineState *s, int argc, reg_t *argv) {
 	Common::String setting = s->_segMan->getString(argv[0]);
 	reg_t data = readSelector(s->_segMan, argv[1], SELECTOR(data));
 
-	warning("Get config setting %s", setting.c_str());
-	s->_segMan->strcpy(data, "");
+	// This function is used to get the benchmarked results stored in the
+	// resource.cfg configuration file in Phantasmagoria 1. Normally,
+	// the configuration file contains values stored by the installer
+	// regarding audio and video settings, which are then used by the
+	// executable. In Phantasmagoria, two extra executable files are used
+	// to perform system benchmarks:
+	// - CPUID for the CPU benchmarks, sets the cpu and cpuspeed settings
+	// - HDDTEC for the graphics and CD-ROM benchmarks, sets the videospeed setting
+	//
+	// These settings are then used by the game scripts directly to modify
+	// the game speed and graphics output. The result of this call is stored
+	// in global 178. The scripts check these values against the value 425.
+	// Anything below that makes Phantasmagoria awfully sluggish, so we're
+	// setting everything to 500, which makes the game playable.
+
+	if (setting == "videospeed") {
+		s->_segMan->strcpy(data, "500");
+	} else if (setting == "cpu") {
+		// We always return the fastest CPU setting that CPUID can detect
+		// (i.e. 586).
+		s->_segMan->strcpy(data, "586");
+	} else if (setting == "cpuspeed") {
+		s->_segMan->strcpy(data, "500");
+	} else {
+		error("GetConfig: Unknown configuration setting %s", setting.c_str());
+	}
+
 	return argv[1];
 }
+
+reg_t kGetSierraProfileInt(EngineState *s, int argc, reg_t *argv) {
+	Common::String category = s->_segMan->getString(argv[0]);	// always "config"
+	if (category != "config")
+		error("GetSierraProfileInt: category isn't 'config', it's '%s'", category.c_str());
+
+	Common::String setting = s->_segMan->getString(argv[1]);
+	if (setting != "videospeed")
+		error("GetSierraProfileInt: setting isn't 'videospeed', it's '%s'", setting.c_str());
+
+	// The game scripts pass 425 as the third parameter for some unknown reason,
+	// as after the call they compare the result to 425 anyway...
+
+	// We return the same fake value for videospeed as with kGetConfig
+	return make_reg(0, 500);
+}
+
 #endif
 
 // kIconBar is really a subop of kMacPlatform for SCI1.1 Mac


Commit: f15582b190baeae3ab1ddf2b6fc9dc305810f5f0
    https://github.com/scummvm/scummvm/commit/f15582b190baeae3ab1ddf2b6fc9dc305810f5f0
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-05-26T06:42:38-07:00

Commit Message:
SCI: Map another missing kFileIO call

This is used to change directories in the save/load dialog (unused by us)

Changed paths:
    engines/sci/engine/kernel_tables.h



diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index d8414b3..4ddf053 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -239,6 +239,7 @@ static const SciKernelMapSubEntry kFileIO_subops[] = {
 	{ SIG_SCI32,          15, MAP_CALL(FileIOReadWord),            "i",                    NULL },
 	{ SIG_SCI32,          16, MAP_CALL(FileIOWriteWord),           "ii",                   NULL },
 	{ SIG_SCI32,          17, MAP_CALL(FileIOCreateSaveSlot),      "ir",                   NULL },
+	{ SIG_SCI32,          18, MAP_EMPTY(FileIOChangeDirectory),    "r",                    NULL }, // for SQ6, when changing the savegame directory in the save/load dialog
 	{ SIG_SCI32,          19, MAP_CALL(Stub),                      "r",                    NULL }, // for Torin / Torin demo
 #endif
 	SCI_SUBOPENTRY_TERMINATOR






More information about the Scummvm-git-logs mailing list