[Scummvm-cvs-logs] SF.net SVN: scummvm:[45551] scummvm/trunk/engines/sci/engine/kmisc.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Fri Oct 30 23:53:02 CET 2009
Revision: 45551
http://scummvm.svn.sourceforge.net/scummvm/?rev=45551&view=rev
Author: thebluegr
Date: 2009-10-30 22:53:00 +0000 (Fri, 30 Oct 2009)
Log Message:
-----------
Cleaned up kPlatform() a bit, and changed it to return appropriate values for the CD hires version of KQ6
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kmisc.cpp
Modified: scummvm/trunk/engines/sci/engine/kmisc.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmisc.cpp 2009-10-30 22:50:21 UTC (rev 45550)
+++ scummvm/trunk/engines/sci/engine/kmisc.cpp 2009-10-30 22:53:00 UTC (rev 45551)
@@ -236,19 +236,34 @@
return s->r_acc;
}
+enum kSciPlatforms {
+ kSciPlatformDOS = 1,
+ kSciPlatformWindows = 2
+};
+
+enum kPlatformOps {
+ kPlatformGetPlatform = 4,
+ kPlatformUnk5 = 5,
+ kPlatformIsHiRes = 6,
+ kPlatformIsItWindows = 7
+};
+
reg_t kPlatform(EngineState *s, int argc, reg_t *argv) {
- if (argc == 1) {
- if (argv[0].toUint16() == 4)
- if (((SciEngine*)g_engine)->getPlatform() == Common::kPlatformWindows)
- return make_reg(0, 2);
- else
- return make_reg(0, 1);
- else if (argv[0].toUint16() == 5)
- warning("kPlatform(5)"); // TODO: return 1 based on some variable
- else if (argv[0].toUint16() == 6)
- warning("kPlatform(6)"); // TODO: return some variable
- else if (argv[0].toUint16() == 7 && ((SciEngine*)g_engine)->getPlatform() == Common::kPlatformWindows)
- return make_reg(0, 1);
+ bool isWindows = ((SciEngine*)g_engine)->getPlatform() == Common::kPlatformWindows;
+ uint16 operation = argv[0].toUint16();
+
+ switch (operation) {
+ case kPlatformGetPlatform:
+ return make_reg(0, (isWindows) ? kSciPlatformWindows : kSciPlatformDOS);
+ case kPlatformUnk5:
+ // This case needs to return the opposite of case 6 to get hires graphics
+ return make_reg(0, !isWindows);
+ case kPlatformIsHiRes:
+ return make_reg(0, isWindows);
+ case kPlatformIsItWindows:
+ return make_reg(0, isWindows);
+ default:
+ warning("Unsupported kPlatform operation %d", operation);
}
return NULL_REG;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list