diff options
author | Travis Howell | 2003-07-29 12:13:39 +0000 |
---|---|---|
committer | Travis Howell | 2003-07-29 12:13:39 +0000 |
commit | 11aa36ff90be9c0cee214a7fb2a15f9e97bef918 (patch) | |
tree | 84d7b526096762e05d7a50fcbb19ddd71d65721c | |
parent | bbbebd9d14c7360dbe250b5e28e1b6505385f7d5 (diff) | |
download | scummvm-rg350-11aa36ff90be9c0cee214a7fb2a15f9e97bef918.tar.gz scummvm-rg350-11aa36ff90be9c0cee214a7fb2a15f9e97bef918.tar.bz2 scummvm-rg350-11aa36ff90be9c0cee214a7fb2a15f9e97bef918.zip |
Add option for the demo included in Maniac Mansion (Classic version)
svn-id: r9279
-rw-r--r-- | README | 1 | ||||
-rw-r--r-- | common/gameDetector.cpp | 17 | ||||
-rw-r--r-- | common/gameDetector.h | 1 | ||||
-rw-r--r-- | scumm/scumm.h | 1 | ||||
-rw-r--r-- | scumm/scummvm.cpp | 7 |
5 files changed, 26 insertions, 1 deletions
@@ -388,6 +388,7 @@ Command Line Options: --multi-midi - enable combination Adlib and native MIDI --native-mt32 - true Roland MT-32 (disable GM emulation) --aspect-ratio - enable aspect ratio correction + --demo-mode - Start demo mode of Maniac Mansion (Classic version) --floppy-intro - Use floppy version intro for Beneath a Steel Sky CD The meaning of long options can be inversed by prefixing them with "no-", e.g. diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp index 7b96c857d6..15ca149510 100644 --- a/common/gameDetector.cpp +++ b/common/gameDetector.cpp @@ -83,6 +83,9 @@ static const char USAGE_STRING[] = "\t--multi-midi - enable combination Adlib and native MIDI\n" "\t--native-mt32 - true Roland MT-32 (disable GM emulation)\n" "\t--aspect-ratio - enable aspect ratio correction\n" +#ifndef DISABLE_SCUMM + "\t--demo-mode - Start demo mode of Maniac Mansion (Classic version)\n" +#endif #ifndef DISABLE_SKY "\t--floppy-intro - Use floppy version intro for Beneath a Steel Sky CD\n" #endif @@ -168,6 +171,10 @@ GameDetector::GameDetector() { _amiga = false; _language = 0; +#ifndef DISABLE_SCUMM + _demo_mode = false; +#endif + #ifndef DISABLE_SKY _floppyIntro = false; #endif @@ -286,6 +293,10 @@ void GameDetector::updateconfig() { _floppyIntro = g_config->getBool("floppy_intro", _floppyIntro); #endif +#ifndef DISABLE_SCUMM + _demo_mode = g_config->getBool("demo_mode", _demo_mode); +#endif + if ((val = g_config->get("language"))) if ((_language = parseLanguage(val)) == -1) { printf("Error in the config file: invalid language.\n"); @@ -494,6 +505,12 @@ void GameDetector::parseCommandLine(int argc, char **argv) { } else if (!strcmp (s, "aspect-ratio")) { _aspectRatio = long_option_value; g_config->setBool ("aspect_ratio", _aspectRatio); +#ifndef DISABLE_SCUMM + } else if (!strcmp (s, "demo-mode")) { + _demo_mode = long_option_value; + g_config->setBool ("demo_mode", _demo_mode); +#endif + #ifndef DISABLE_SKY } else if (!strcmp (s, "floppy-intro")) { _floppyIntro = long_option_value; diff --git a/common/gameDetector.h b/common/gameDetector.h index 226ffe3ea0..d0e04cde7f 100644 --- a/common/gameDetector.h +++ b/common/gameDetector.h @@ -122,6 +122,7 @@ public: bool _amiga; int _language; + bool _demo_mode; bool _floppyIntro; uint16 _talkSpeed; diff --git a/scumm/scumm.h b/scumm/scumm.h index 9ef37e1658..d4b7c6d2c5 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -1065,6 +1065,7 @@ protected: byte _charsetBuffer[512]; public: + bool _demo_mode; bool _noSubtitles; // Whether to skip all subtitles bool _confirmExit; protected: diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index e6572f3497..caab9e2aff 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -393,6 +393,7 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst) memset(_charsetData, 0, sizeof(_charsetData)); _charsetBufPos = 0; memset(_charsetBuffer, 0, sizeof(_charsetBuffer)); + _demo_mode = false; _noSubtitles = false; _confirmExit = false; _numInMsgStack = 0; @@ -545,6 +546,7 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst) _version = detector->_game.version; setFeatures(detector->_game.features); + _demo_mode = detector->_demo_mode; _noSubtitles = detector->_noSubtitles; _confirmExit = detector->_confirmExit; _defaultTalkDelay = detector->_talkSpeed; @@ -826,7 +828,10 @@ void Scumm::launch() { // If requested, load a save game instead of running the boot script if (_saveLoadFlag != 2 || !loadState(_saveLoadSlot, _saveLoadCompatible)) { - runScript(1, 0, 0, &_bootParam); + if (_gameId == GID_MANIAC && _demo_mode) + runScript(9, 0, 0, &_bootParam); + else + runScript(1, 0, 0, &_bootParam); } _saveLoadFlag = 0; } |