diff options
author | Filippos Karapetis | 2009-10-30 22:53:00 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-10-30 22:53:00 +0000 |
commit | 1c158c52a1217225cfa4aadb289a537287eec6a2 (patch) | |
tree | cd21a5b845012987adf084e333353c9178b567c3 | |
parent | 29fb3b0f3fca31c36f13175627f9bc06effe8e97 (diff) | |
download | scummvm-rg350-1c158c52a1217225cfa4aadb289a537287eec6a2.tar.gz scummvm-rg350-1c158c52a1217225cfa4aadb289a537287eec6a2.tar.bz2 scummvm-rg350-1c158c52a1217225cfa4aadb289a537287eec6a2.zip |
Cleaned up kPlatform() a bit, and changed it to return appropriate values for the CD hires version of KQ6
svn-id: r45551
-rw-r--r-- | engines/sci/engine/kmisc.cpp | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index dc3baefb92..15b8d637a2 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -236,19 +236,34 @@ reg_t kMemory(EngineState *s, int argc, reg_t *argv) { 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; |