void SciEngine::updateScummVMAudioOptions() { // Update ScummVM's speech/subtitles settings for SCI1.1 CD games, // depending on the in-game settings if ((isCD() && getSciVersion() == SCI_VERSION_1_1) || getSciVersion() >= SCI_VERSION_2) { uint16 ingameSetting = _gamestate->variables[VAR_GLOBAL][kGlobalVarMessageType].getOffset(); switch (ingameSetting) { case 1: // subtitles ConfMan.setBool("subtitles", true); ConfMan.setBool("speech_mute", true); break; case 2: // speech ConfMan.setBool("subtitles", false); ConfMan.setBool("speech_mute", false); break; case 3: // speech + subtitles ConfMan.setBool("subtitles", true); ConfMan.setBool("speech_mute", false); break; default: break; } } }
void SciEngine::syncIngameAudioOptions() { // Now, sync the in-game speech/subtitles settings for SCI1.1 CD games if (isCD() && getSciVersion() == SCI_VERSION_1_1) { bool subtitlesOn = ConfMan.getBool("subtitles"); bool speechOn = !ConfMan.getBool("speech_mute"); if (subtitlesOn && !speechOn) { _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 1); // subtitles } else if (!subtitlesOn && speechOn) { _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 2); // speech } else if (subtitlesOn && speechOn) { // Is it a game that supports simultaneous speech and subtitles? if (getGameId() == GID_SQ4 || getGameId() == GID_FREDDYPHARKAS // TODO: The following need script patches for simultaneous speech and subtitles //|| getGameId() == GID_KQ6 //|| getGameId() == GID_LAURABOW2 ) { _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 3); // speech + subtitles } else { // Game does not support speech and subtitles, set it to speech _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 2); // speech } } } }
void SciEngine::syncIngameAudioOptions() { // Sync the in-game speech/subtitles settings for SCI1.1 CD games if (isCD() && getSciVersion() == SCI_VERSION_1_1) { bool subtitlesOn = ConfMan.getBool("subtitles"); bool speechOn = !ConfMan.getBool("speech_mute"); if (subtitlesOn && !speechOn) { _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 1); // subtitles } else if (!subtitlesOn && speechOn) { _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 2); // speech } else if (subtitlesOn && speechOn) { // Is it a game that supports simultaneous speech and subtitles? switch (_gameId) { case GID_SQ4: case GID_FREDDYPHARKAS: case GID_ECOQUEST: case GID_LSL6: case GID_LAURABOW2: case GID_KQ6: _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 3); // speech + subtitles break; default: // Game does not support speech and subtitles, set it to speech _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 2); // speech } } } }
// used by Script Patcher. Used to find out, if Laura Bow 2/King's Quest 6 need patching for Speech+Subtitles - or not bool SciEngine::speechAndSubtitlesEnabled() { bool subtitlesOn = ConfMan.getBool("subtitles"); bool speechOn = !ConfMan.getBool("speech_mute"); if (isCD() && subtitlesOn && speechOn) return true; return false; }
void SciEngine::syncIngameAudioOptions() { bool useGlobal90 = false; // Sync the in-game speech/subtitles settings for SCI1.1 CD games if (isCD()) { switch (getSciVersion()) { case SCI_VERSION_1_1: // All SCI1.1 CD games use global 90 useGlobal90 = true; break; #ifdef ENABLE_SCI32 case SCI_VERSION_2: case SCI_VERSION_2_1_EARLY: case SCI_VERSION_2_1_MIDDLE: case SCI_VERSION_2_1_LATE: // Only use global 90 for some specific games, not all SCI32 games used this method switch (_gameId) { case GID_KQ7: // SCI2.1 case GID_GK1: // SCI2 case GID_GK2: // SCI2.1 case GID_SQ6: // SCI2.1 case GID_TORIN: // SCI2.1 case GID_QFG4: // SCI2.1 case GID_PQ4: // SCI2 case GID_PHANTASMAGORIA: // SCI2.1 case GID_MOTHERGOOSEHIRES: // SCI2.1 useGlobal90 = true; break; case GID_LSL6: // SCI2.1 // TODO: Uses gameFlags array break; // Shivers does not use global 90 // Police Quest: SWAT does not use global 90 // // TODO: Unknown at the moment: // LSL7, Lighthouse, RAMA, Phantasmagoria 2 default: return; } break; #endif // ENABLE_SCI32 default: return; } bool subtitlesOn = ConfMan.getBool("subtitles"); bool speechOn = !ConfMan.getBool("speech_mute"); #ifdef ENABLE_SCI32 if (getSciVersion() >= SCI_VERSION_2) { GlobalVar index; uint16 textSpeed; switch (g_sci->getGameId()) { case GID_LSL6HIRES: index = kGlobalVarLSL6HiresTextSpeed; textSpeed = 14 - ConfMan.getInt("talkspeed") * 14 / 255 + 1; break; default: index = kGlobalVarTextSpeed; textSpeed = 8 - ConfMan.getInt("talkspeed") * 8 / 255; } _gamestate->variables[VAR_GLOBAL][index] = make_reg(0, textSpeed); } #endif if (useGlobal90) { if (subtitlesOn && !speechOn) { _gamestate->variables[VAR_GLOBAL][kGlobalVarMessageType] = make_reg(0, 1); // subtitles } else if (!subtitlesOn && speechOn) { _gamestate->variables[VAR_GLOBAL][kGlobalVarMessageType] = make_reg(0, 2); // speech } else if (subtitlesOn && speechOn) { // Is it a game that supports simultaneous speech and subtitles? switch (_gameId) { case GID_SQ4: case GID_FREDDYPHARKAS: case GID_ECOQUEST: case GID_LSL6: case GID_LAURABOW2: case GID_KQ6: #ifdef ENABLE_SCI32 // Unsure about Gabriel Knight 2 case GID_KQ7: // SCI2.1 case GID_GK1: // SCI2 case GID_SQ6: // SCI2.1, SQ6 seems to always use subtitles anyway case GID_TORIN: // SCI2.1 case GID_QFG4: // SCI2.1 case GID_PQ4: // SCI2 // Phantasmagoria does not support simultaneous speech + subtitles // Mixed Up Mother Goose Deluxe does not support simultaneous speech + subtitles #endif // ENABLE_SCI32 _gamestate->variables[VAR_GLOBAL][kGlobalVarMessageType] = make_reg(0, 3); // speech + subtitles break; default: // Game does not support speech and subtitles, set it to speech _gamestate->variables[VAR_GLOBAL][kGlobalVarMessageType] = make_reg(0, 2); // speech } } } } }
Common::Error GobEngine::run() { Common::Error err; err = initGameParts(); if (err.getCode() != Common::kNoError) return err; err = initGraphics(); if (err.getCode() != Common::kNoError) return err; // On some systems it's not safe to run CD audio games from the CD. if (isCD()) checkCD(); _system->getAudioCDManager()->open(); _global->_debugFlag = 1; _video->_doRangeClamp = true; // WORKAROUND: Some versions check the video mode to detect the system if (_platform == Common::kPlatformAmiga) _global->_fakeVideoMode = 0x11; else if (_platform == Common::kPlatformAtariST) _global->_fakeVideoMode = 0x10; else _global->_fakeVideoMode = 0x13; _global->_videoMode = 0x13; _global->_useMouse = 1; _global->_soundFlags = MIDI_FLAG | SPEAKER_FLAG | BLASTER_FLAG | ADLIB_FLAG; if (ConfMan.hasKey("language")) _language = Common::parseLanguage(ConfMan.get("language")); switch (_language) { case Common::FR_FRA: case Common::RU_RUS: _global->_language = kLanguageFrench; break; case Common::DE_DEU: _global->_language = kLanguageGerman; break; case Common::EN_ANY: case Common::EN_GRB: case Common::HU_HUN: _global->_language = kLanguageBritish; break; case Common::ES_ESP: _global->_language = kLanguageSpanish; break; case Common::IT_ITA: _global->_language = kLanguageItalian; break; case Common::EN_USA: _global->_language = kLanguageAmerican; break; case Common::NL_NLD: _global->_language = kLanguageDutch; break; case Common::KO_KOR: _global->_language = kLanguageKorean; break; case Common::HE_ISR: _global->_language = kLanguageHebrew; break; case Common::PT_BRA: _global->_language = kLanguagePortuguese; break; case Common::JA_JPN: _global->_language = kLanguageJapanese; break; default: _global->_language = kLanguageBritish; break; } _global->_languageWanted = _global->_language; _init->initGame(); return Common::kNoError; }
bool DreamWebEngine::hasSpeech() { return isCD() && _hasSpeech; }
Common::Error CryoEngine::run() { // Initialize graphics using following: initGraphics(320, 200, false); // Create debugger console. It requires GFX to be initialized _console = new CryoConsole(this); // Additional setup. //debug("CryoEngine::init\n"); Common::Event event; Common::EventManager *eventMan = _system->getEventManager(); _resMan = new ResourceManager(isCD()); // Show something Sprite *s = new Sprite("intds.hsq", this); s->setPalette(); s->drawFrame(0, 0, 92); delete s; SpriteFont *sf = new SpriteFont("generic.hsq", this); sf->drawText("DUNE TEST", 100, 50); delete sf; Common::String charFile = isCD() ? "dnchar.bin" : "dunechar.hsq"; FixedFont *f = new FixedFont(charFile, this); f->drawText("DUNE TEST", 100, 120, 10); delete f; /*Game *g = new Game(_system); g->loadProtection(); delete g;*/ // Update the screen so that its contents can be shown _system->updateScreen(); // Your main even loop should be (invoked from) here. //debug("CryoEngine::go: Hello, World!\n"); while (!shouldQuit()) { // Open the debugger window, if requested while (eventMan->pollEvent(event)) { if (event.kbd.hasFlags(Common::KBD_CTRL) && event.kbd.keycode == Common::KEYCODE_d) { _console->attach(); _console->onFrame(); } } // TODO: Do something... _system->delayMillis(10); } // This test will show up if -d1 and --debugflags=example are specified on the commandline //debugC(1, kQuuxDebugExample, "Example debug call"); // This test will show up if --debugflags=example or --debugflags=example2 or both of them and -d3 are specified on the commandline //debugC(3, kQuuxDebugExample | kQuuxDebugExample2, "Example debug call two"); return Common::kNoError; }