From f191413b1c48caf7cebf3bd5ac5256a0bb9b5d67 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 1 Nov 2011 15:54:15 +0100 Subject: SCUMM: Clean up loop --- engines/scumm/scumm.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 81f6af453c..78effaffec 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1169,16 +1169,15 @@ Common::Error ScummEngine::init() { return Common::kUnsupportedColorMode; } else { Common::List tryModes = _system->getSupportedFormats(); - for (Common::List::iterator g = tryModes.begin(); g != tryModes.end(); ++g) { + for (Common::List::iterator g = tryModes.begin(); g != tryModes.end(); ) { if (g->bytesPerPixel != 2 || g->aBits()) { g = tryModes.erase(g); - g--; - } - - if (*g == _outputPixelFormat) { + } else if (*g == _outputPixelFormat) { tryModes.clear(); tryModes.push_back(_outputPixelFormat); break; + } else { + ++g; } } -- cgit v1.2.3 From 0af011ba82a9213362fddb73941d9a28e1d1caae Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 1 Nov 2011 23:56:51 +0100 Subject: SCUMM: Further clean up loop --- engines/scumm/scumm.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 78effaffec..f94496b14b 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1169,15 +1169,13 @@ Common::Error ScummEngine::init() { return Common::kUnsupportedColorMode; } else { Common::List tryModes = _system->getSupportedFormats(); - for (Common::List::iterator g = tryModes.begin(); g != tryModes.end(); ) { + for (Common::List::iterator g = tryModes.begin(); g != tryModes.end(); ++g) { if (g->bytesPerPixel != 2 || g->aBits()) { - g = tryModes.erase(g); + g = tryModes.reverse_erase(g); } else if (*g == _outputPixelFormat) { tryModes.clear(); tryModes.push_back(_outputPixelFormat); break; - } else { - ++g; } } -- cgit v1.2.3 From 109ba212c6cc62ec4a2f2a664a957e66b383f44d Mon Sep 17 00:00:00 2001 From: Tobias Gunkel Date: Sun, 9 Oct 2011 12:47:47 +0200 Subject: SCUMM: Add initial support for AppleII sound player --- engines/scumm/scumm.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index f94496b14b..3eea68fbbe 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_appleII.h" #include "scumm/player_v1.h" #include "scumm/player_v2.h" #include "scumm/player_v2cms.h" @@ -1797,7 +1798,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); -- cgit v1.2.3 From 854928f09a2d839c667848c2b18eb7e6b3dd6c22 Mon Sep 17 00:00:00 2001 From: Tobias Gunkel Date: Sat, 24 Dec 2011 14:29:06 +0100 Subject: SCUMM: Rename player_appleII.* -> player_apple2.* to have the filenames lower case --- engines/scumm/scumm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 3eea68fbbe..9a093891d2 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -55,7 +55,7 @@ #include "scumm/player_nes.h" #include "scumm/player_sid.h" #include "scumm/player_pce.h" -#include "scumm/player_appleII.h" +#include "scumm/player_apple2.h" #include "scumm/player_v1.h" #include "scumm/player_v2.h" #include "scumm/player_v2cms.h" -- cgit v1.2.3 From 95cabb0ffd43e6bdd2c600c5baa459cab89f068d Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 24 Dec 2011 21:09:46 +0100 Subject: SCUMM: Add a difficulty selection dialog for Loom FM-Towns. It is in spirit of the DOS version's selection dialog, but it has the description above the buttons instead of below it. --- engines/scumm/scumm.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 9a093891d2..d3cc218cd3 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1256,6 +1256,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); -- cgit v1.2.3 From a79f224c23f1b0fa4d9850a032e0adc0d72619f7 Mon Sep 17 00:00:00 2001 From: Tobias Gunkel Date: Tue, 3 Jan 2012 22:10:50 +0100 Subject: SCUMM: changed handling of _activeInventory/_activeActor to _activeObject(2)/_activeObject(2)Type Note: the transition is not completed yet. The code compiles but is probably not runnable as not every occurrence of _activeInventory has been properly replaced. The usage of _v0ObjectIndex and _v0ObjectInInventory should be revised too and both variables should be replaced by another mechanism (maybe by using a single variable "obj = (type << 8) | id"). - moved v0 only vars _activeInventory, _activeObject, _activeVerb from ScummEngine_v2 to ScummEngine_v0 - removed _activeActor, _activeInvExecute, _activeObject2Inv and _activeInventory. They are handled by _activeObject/_activeObjectType and _activeObject2/_activeObject2Type now. - removed _activeObject(2)Index as they only bloat the code without any benefit (?) - merge prep-name tables from ScummEngine_v2::drawPreposition() and ScummEngine_v0::drawSentenceWord() by introducing ScummEngine_v2::drawPreposition() - rename ObjectData.flags -> obj_type (quick-fix only, needs review! Maybe obj_nr and obj_type can be merged into one var: obj_nr = (obj_type << 8) | obj_nr) - o_unknown2 is negation of o_ifActiveObject (o_ifNotEqualActiveObject2) - renamed o_ifActiveObject -> o_ifEqualActiveObject2 as it acts only on _activeObject2 - renamed ScummEngine_v0::drawSentenceWord() -> ScummEngine_v0::getObjectName() --- engines/scumm/scumm.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index d3cc218cd3..d3dc702395 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -701,10 +701,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; @@ -723,11 +719,11 @@ ScummEngine_v0::ScummEngine_v0(OSystem *syst, const DetectorResult &dr) _verbPickup = false; _currentMode = 0; + _activeVerb = 0; + _activeObject = 0; _activeObject2 = 0; - _activeObjectIndex = 0; - _activeObject2Index = 0; - _activeInvExecute = false; - _activeObject2Inv = false; + _activeObjectType = kObjectTypeRoom; + _activeObject2Type = kObjectTypeRoom; _activeObjectObtained = false; _activeObject2Obtained = false; -- cgit v1.2.3 From 1c32000a004cc184a8744e2467035a4c7ba2f3a5 Mon Sep 17 00:00:00 2001 From: Tobias Gunkel Date: Sat, 7 Jan 2012 16:08:55 +0100 Subject: SCUMM: start handling object type and id correctly in mm c64 - removed complicated and unnecessary _v0ObjectIndex, _v0ObjectInInventory, _v0ObjectFlag vars - started to merge object id and type into one object value (type<<8|id) - verb preposition ids do not dependent on language -> remove from VerbSettings Note: - objects with type=0 are foreground objects. They have a state, an owner and a bg overlay image. - objects with type=1 are bg objects. They do not have a state or owner and are already contained in the bg image. The do not have an entry in objectState/OwnerTable --- engines/scumm/scumm.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index d3dc702395..423ad79b00 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -151,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; @@ -720,10 +717,10 @@ ScummEngine_v0::ScummEngine_v0(OSystem *syst, const DetectorResult &dr) _currentMode = 0; _activeVerb = 0; - _activeObject = 0; - _activeObject2 = 0; - _activeObjectType = kObjectTypeRoom; - _activeObject2Type = kObjectTypeRoom; + _activeObjectNr = 0; + _activeObject2Nr = 0; + _activeObjectType = kObjectTypeBG; + _activeObject2Type = kObjectTypeBG; _activeObjectObtained = false; _activeObject2Obtained = false; -- cgit v1.2.3 From 706b8cf1c531e15b980a64060a1080e17e854d98 Mon Sep 17 00:00:00 2001 From: Tobias Gunkel Date: Sat, 7 Jan 2012 20:06:26 +0100 Subject: SCUMM: replace verb, prep and currentMode values with symbolic constants --- engines/scumm/scumm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 423ad79b00..8b2e2ef88e 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -716,7 +716,7 @@ ScummEngine_v0::ScummEngine_v0(OSystem *syst, const DetectorResult &dr) _verbPickup = false; _currentMode = 0; - _activeVerb = 0; + _activeVerb = kVerbNone; _activeObjectNr = 0; _activeObject2Nr = 0; _activeObjectType = kObjectTypeBG; -- cgit v1.2.3 From de0b5f76749add219a6b667d5d2d69fb8a86d959 Mon Sep 17 00:00:00 2001 From: Tobias Gunkel Date: Sun, 8 Jan 2012 23:51:13 +0100 Subject: SCUMM: use command stack and SentenceTab in mm c64 - MM C64 uses command stack (SentenceTab, doSentence()) now - _cmdObject... added for current SentenceTab. The _active... variables are only used to build a sentence in the inventory but never by a script. -> many routines are not needed anymore and are removed --- engines/scumm/scumm.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 8b2e2ef88e..e6ec2b0dab 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -712,17 +712,19 @@ 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; _activeVerb = kVerbNone; _activeObjectNr = 0; + _activeObjectType = 0; _activeObject2Nr = 0; - _activeObjectType = kObjectTypeBG; - _activeObject2Type = kObjectTypeBG; - _activeObjectObtained = false; - _activeObject2Obtained = false; + _activeObject2Type = 0; + + _cmdVerb = kVerbNone; + _cmdObjectNr = 0; + _cmdObjectType = 0; + _cmdObject2Nr = 0; + _cmdObject2Type = 0; VAR_ACTIVE_ACTOR = 0xFF; VAR_IS_SOUND_RUNNING = 0xFF; -- cgit v1.2.3 From b337823bab5994b78f639a7625ff763f061a1c0c Mon Sep 17 00:00:00 2001 From: Tobias Gunkel Date: Mon, 9 Jan 2012 23:21:08 +0100 Subject: SCUMM: fix verb and script handling - getVerbEntrypoint() should not handle walk-to differently (revert 0x0D handling back to original behavior) - VAR_ACTIVE_ACTOR actually is VAR_ACTIVE_OBJECT2 - runSentenceScript(): "if (_cmdVerb == kVerbWalkTo)" must be "if (_cmdVerb != kVerbWalkTo)" --- engines/scumm/scumm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index e6ec2b0dab..2eda5cac80 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -726,7 +726,7 @@ ScummEngine_v0::ScummEngine_v0(OSystem *syst, const DetectorResult &dr) _cmdObject2Nr = 0; _cmdObject2Type = 0; - VAR_ACTIVE_ACTOR = 0xFF; + VAR_ACTIVE_OBJECT2 = 0xFF; VAR_IS_SOUND_RUNNING = 0xFF; VAR_ACTIVE_VERB = 0xFF; } -- cgit v1.2.3 From c138ef67099cd14bedd4e0e79080e31e2b41eddd Mon Sep 17 00:00:00 2001 From: Tobias Gunkel Date: Sun, 15 Jan 2012 21:43:21 +0100 Subject: SCUMM: merge _activeObjectNr/_activeObjectType and _cmdObjectNr/_cmdObjectType --- engines/scumm/scumm.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 2eda5cac80..f2db5ad6ba 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -715,16 +715,12 @@ ScummEngine_v0::ScummEngine_v0(OSystem *syst, const DetectorResult &dr) _currentMode = 0; _activeVerb = kVerbNone; - _activeObjectNr = 0; - _activeObjectType = 0; - _activeObject2Nr = 0; - _activeObject2Type = 0; + _activeObject = 0; + _activeObject2 = 0; _cmdVerb = kVerbNone; - _cmdObjectNr = 0; - _cmdObjectType = 0; - _cmdObject2Nr = 0; - _cmdObject2Type = 0; + _cmdObject = 0; + _cmdObject2 = 0; VAR_ACTIVE_OBJECT2 = 0xFF; VAR_IS_SOUND_RUNNING = 0xFF; -- cgit v1.2.3 From 0bae642453caeef9c6af9c49f043f46eebd0f787 Mon Sep 17 00:00:00 2001 From: Tobias Gunkel Date: Tue, 17 Jan 2012 22:52:59 +0100 Subject: SCUMM: 2nd try to fix dungeon door timing Shorten the timer delay does not work as escaping with a second kid is not possible too. Instead decrease engine speed during script execution. --- engines/scumm/scumm.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index f2db5ad6ba..61d38dc593 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1964,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); -- cgit v1.2.3 From daff6f36ae210bea03bc51f0e5293218f439cd89 Mon Sep 17 00:00:00 2001 From: Tobias Gunkel Date: Sat, 4 Feb 2012 15:40:36 +0100 Subject: SCUMM: _currentLights is v0 only --- engines/scumm/scumm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 61d38dc593..d8b02d0881 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -263,7 +263,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _bytesPerPixel = 1; _doEffect = false; _snapScroll = false; - _currentLights = 0; _shakeEnabled = false; _shakeFrame = 0; _screenStartStrip = 0; @@ -713,6 +712,7 @@ ScummEngine_v0::ScummEngine_v0(OSystem *syst, const DetectorResult &dr) : ScummEngine_v2(syst, dr) { _currentMode = 0; + _currentLights = 0; _activeVerb = kVerbNone; _activeObject = 0; -- cgit v1.2.3 From 9dd6105ce62210509207dc61607543b7bcf5639d Mon Sep 17 00:00:00 2001 From: Tobias Gunkel Date: Sat, 4 Feb 2012 18:34:08 +0100 Subject: SCUMM: replace "c64" with "v0" when it applies to both C64 and AppleII v0 versions In addition some routines (e.g. the gfx ones) that are even used in v1. --- engines/scumm/scumm.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index d8b02d0881..fc46f88df4 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1025,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) { @@ -1379,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); @@ -1459,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) -- cgit v1.2.3