diff options
Diffstat (limited to 'engines/scumm/scumm.cpp')
-rw-r--r-- | engines/scumm/scumm.cpp | 63 |
1 files changed, 35 insertions, 28 deletions
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 81f6af453c..fc46f88df4 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -55,6 +55,7 @@ #include "scumm/player_nes.h" #include "scumm/player_sid.h" #include "scumm/player_pce.h" +#include "scumm/player_apple2.h" #include "scumm/player_v1.h" #include "scumm/player_v2.h" #include "scumm/player_v2cms.h" @@ -150,9 +151,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _fileHandle = 0; // Init all vars - _v0ObjectIndex = false; - _v0ObjectInInventory = false; - _v0ObjectFlag = 0; _imuse = NULL; _imuseDigital = NULL; _musicEngine = NULL; @@ -265,7 +263,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _bytesPerPixel = 1; _doEffect = false; _snapScroll = false; - _currentLights = 0; _shakeEnabled = false; _shakeFrame = 0; _screenStartStrip = 0; @@ -700,10 +697,6 @@ ScummEngine_v2::ScummEngine_v2(OSystem *syst, const DetectorResult &dr) _inventoryOffset = 0; - _activeInventory = 0; - _activeObject = 0; - _activeVerb = 0; - VAR_SENTENCE_VERB = 0xFF; VAR_SENTENCE_OBJECT1 = 0xFF; VAR_SENTENCE_OBJECT2 = 0xFF; @@ -718,19 +711,18 @@ ScummEngine_v2::ScummEngine_v2(OSystem *syst, const DetectorResult &dr) ScummEngine_v0::ScummEngine_v0(OSystem *syst, const DetectorResult &dr) : ScummEngine_v2(syst, dr) { - _verbExecuting = false; - _verbPickup = false; _currentMode = 0; + _currentLights = 0; + _activeVerb = kVerbNone; + _activeObject = 0; _activeObject2 = 0; - _activeObjectIndex = 0; - _activeObject2Index = 0; - _activeInvExecute = false; - _activeObject2Inv = false; - _activeObjectObtained = false; - _activeObject2Obtained = false; - - VAR_ACTIVE_ACTOR = 0xFF; + + _cmdVerb = kVerbNone; + _cmdObject = 0; + _cmdObject2 = 0; + + VAR_ACTIVE_OBJECT2 = 0xFF; VAR_IS_SOUND_RUNNING = 0xFF; VAR_ACTIVE_VERB = 0xFF; } @@ -1033,7 +1025,7 @@ Common::Error ScummEngine::init() { // The kGenUnchanged method is only used for 'container files', i.e. files // that contain the real game files bundled together in an archive format. - // This is the case of the NES, C64 and Mac versions of certain games. + // This is the case of the NES, v0 and Mac versions of certain games. // Note: All of these can also occur in 'extracted' form, in which case they // are treated like any other SCUMM game. if (_filenamePattern.genMethod == kGenUnchanged) { @@ -1171,11 +1163,8 @@ Common::Error ScummEngine::init() { Common::List<Graphics::PixelFormat> tryModes = _system->getSupportedFormats(); for (Common::List<Graphics::PixelFormat>::iterator g = tryModes.begin(); g != tryModes.end(); ++g) { if (g->bytesPerPixel != 2 || g->aBits()) { - g = tryModes.erase(g); - g--; - } - - if (*g == _outputPixelFormat) { + g = tryModes.reverse_erase(g); + } else if (*g == _outputPixelFormat) { tryModes.clear(); tryModes.push_back(_outputPixelFormat); break; @@ -1258,6 +1247,16 @@ void ScummEngine::setupScumm() { // Load game from specified slot, if any if (ConfMan.hasKey("save_slot")) { requestLoad(ConfMan.getInt("save_slot")); + } else if (!ConfMan.hasKey("boot_param") && _game.id == GID_LOOM && _game.platform == Common::kPlatformFMTowns) { + // In case we run the Loom FM-Towns version and have no boot parameter + // nor start save game supplied we will show our own custom difficulty + // selection dialog, since the original does not have any. + LoomTownsDifficultyDialog difficultyDialog; + runDialog(difficultyDialog); + + int difficulty = difficultyDialog.getSelectedDifficulty(); + if (difficulty != -1) + _bootParam = difficulty; } _res->allocResTypeData(rtBuffer, 0, 10, kDynamicResTypeMode); @@ -1380,8 +1379,8 @@ void ScummEngine::setupCostumeRenderer() { _costumeRenderer = new AkosRenderer(this); _costumeLoader = new AkosCostumeLoader(this); } else if (_game.version == 0) { - _costumeRenderer = new C64CostumeRenderer(this); - _costumeLoader = new C64CostumeLoader(this); + _costumeRenderer = new V0CostumeRenderer(this); + _costumeLoader = new V0CostumeLoader(this); } else if (_game.platform == Common::kPlatformNES) { _costumeRenderer = new NESCostumeRenderer(this); _costumeLoader = new NESCostumeLoader(this); @@ -1460,7 +1459,7 @@ void ScummEngine::resetScumm() { _sortedActors = new Actor * [_numActors]; for (i = 0; i < _numActors; ++i) { if (_game.version == 0) - _actors[i] = new ActorC64(this, i); + _actors[i] = new Actor_v0(this, i); else if (_game.version <= 2) _actors[i] = new Actor_v2(this, i); else if (_game.version == 3) @@ -1800,7 +1799,7 @@ void ScummEngine::setupMusic(int midi) { if (_game.version >= 7) { // Setup for digital iMuse is performed in another place } else if (_game.platform == Common::kPlatformApple2GS && _game.version == 0){ - // TODO: Add support for music format + _musicEngine = new Player_AppleII(this, _mixer); } else if (_game.platform == Common::kPlatformC64 && _game.version <= 1) { #ifndef DISABLE_SID _musicEngine = new Player_SID(this, _mixer); @@ -1965,6 +1964,14 @@ Common::Error ScummEngine::go() { if (delta < 1) // Ensure we don't get into an endless loop delta = 1; // by not decreasing sleepers. + // WORKAROUND: walking speed in the original v0/v1 interpreter + // is sometimes slower (e.g. during scrolling) than in ScummVM. + // This is important for the door-closing action in the dungeon, + // otherwise (delta < 6) a single kid is able to escape. + if ((_game.version == 0 && isScriptRunning(132)) || + (_game.version == 1 && isScriptRunning(137))) + delta = 6; + // Wait... waitForTimer(delta * 1000 / 60 - diff); |