diff options
author | Norbert Lange | 2009-08-08 19:09:30 +0000 |
---|---|---|
committer | Norbert Lange | 2009-08-08 19:09:30 +0000 |
commit | 0350a1598deea8d1af252ddd96a490699d10e2e2 (patch) | |
tree | 11557d7a87ee5da2ee20e6c13e8be7d2607f393c /engines/scumm | |
parent | df06592be1b4c9904acde5a843d3ab3d076c65ac (diff) | |
parent | 65a39cc2b0ebb989444330c561743ba0466c1a9c (diff) | |
download | scummvm-rg350-0350a1598deea8d1af252ddd96a490699d10e2e2.tar.gz scummvm-rg350-0350a1598deea8d1af252ddd96a490699d10e2e2.tar.bz2 scummvm-rg350-0350a1598deea8d1af252ddd96a490699d10e2e2.zip |
merge with trunk
svn-id: r43134
Diffstat (limited to 'engines/scumm')
42 files changed, 1238 insertions, 417 deletions
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index 88c258a2e6..3033904357 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -527,9 +527,15 @@ void Actor_v2::walkActor() { if (_moving & MF_TURN) { new_dir = updateActorDirection(false); // FIXME: is this correct? - if (_facing != new_dir) + if (_facing != new_dir) { + + // Actor never stops walking when an object has been selected without this + if (_vm->_game.version ==0) + _moving = 0; + setDirection(new_dir); - else + + } else _moving = 0; return; } @@ -817,6 +823,16 @@ void Actor::setDirection(int direction) { if (_costume == 0) return; + // V0 MM + if (_vm->_game.version == 0) { + if (_moving) + _vm->_costumeLoader->costumeDecodeData(this, _walkFrame, 0); + else + _vm->_costumeLoader->costumeDecodeData(this, _standFrame, 0); + _needRedraw = true; + return; + } + // Update the costume for the new direction (and mark the actor for redraw) aMask = 0x8000; for (i = 0; i < 16; i++, aMask >>= 1) { @@ -1224,7 +1240,10 @@ void Actor::showActor() { _vm->ensureResourceLoaded(rtCostume, _costume); - if (_vm->_game.version <= 2) { + if (_vm->_game.version == 0) { + _cost.reset(); + startAnimActor(_standFrame); + } else if (_vm->_game.version <= 2) { _cost.reset(); startAnimActor(_standFrame); startAnimActor(_initFrame); @@ -1380,6 +1399,13 @@ void ScummEngine::processActors() { Actor** end = _sortedActors + numactors; for (Actor** ac = _sortedActors; ac != end; ++ac) { Actor* a = *ac; + + // V0 MM: 0x057B + if (_game.version == 0) { + ActorC64 *A = (ActorC64*) a; + if ((A->_speaking & 1)) + A->_speaking ^= 0xFE; + } // Draw and animate the actors, except those w/o a costume. // Note: We could 'optimize' this a little bit by only putting // actors with a costume into the _sortedActors array in the @@ -1572,6 +1598,8 @@ void Actor_v2::prepareDrawActorCostume(BaseCostumeRenderer *bcr) { // we need to shift it 8 pixels to the left if (_facing == 90) bcr->_actorX -= 8; + } else if (_vm->_game.version == 0) { + bcr->_actorX += 12; } else if (_vm->_game.version <= 2) { // HACK: We have to adjust the x position by one strip (8 pixels) in // V2 games. However, it is not quite clear to me why. And to fully @@ -1703,6 +1731,12 @@ void Actor::animateActor(int anim) { case 4: // turn to new direction turnToDirection(dir); break; + case 64: + if (_vm->_game.version == 0) { + _moving &= ~MF_TURN; + setDirection(dir); + break; + } default: if (_vm->_game.version <= 2) startAnimActor(anim / 4); @@ -2167,21 +2201,38 @@ void Actor::setActorCostume(int c) { } } -static const char* v0ActorNames[7] = { +static const char* v0ActorNames[0x19] = { "Syd", "Razor", "Dave", "Michael", "Bernard", "Wendy", - "Jeff" + "Jeff", + "", + "Dr Fred", + "Nurse Edna", + "Weird Ed", + "Dead Cousin Ted", + "Purple Tentacle", + "Green Tentacle", + "Meteor", + "Plant", + "", + "", + "", + "", + "", + "", + "Sandy" }; const byte *Actor::getActorName() { - const byte *ptr; + const byte *ptr = NULL; if (_vm->_game.version == 0) { - ptr = (const byte *)v0ActorNames[_number - 1]; + if (_number) + ptr = (const byte *)v0ActorNames[_number - 1]; } else { ptr = _vm->getResourceAddress(rtActorName, _number); } diff --git a/engines/scumm/actor.h b/engines/scumm/actor.h index 3e8fe6626b..3f67d42a50 100644 --- a/engines/scumm/actor.h +++ b/engines/scumm/actor.h @@ -380,11 +380,15 @@ protected: class ActorC64 : public Actor_v2 { public: - // FIXME: This flag is never saved, which might lead to broken save states. + // FIXME: These vars are never saved, which might lead to broken save states. byte _miscflags; + byte _speaking, _speakingPrev; + byte _costCommand, _costFrame; public: - ActorC64(ScummEngine *scumm, int id) : Actor_v2(scumm, id) {} + ActorC64(ScummEngine *scumm, int id) : Actor_v2(scumm, id) { + _speaking = _speakingPrev = _costCommand = _costFrame = 0; + } virtual void initActor(int mode) { Actor_v2::initActor(mode); if (mode == -1) { diff --git a/engines/scumm/boxes.cpp b/engines/scumm/boxes.cpp index 472e04b5f3..d480209501 100644 --- a/engines/scumm/boxes.cpp +++ b/engines/scumm/boxes.cpp @@ -445,7 +445,7 @@ byte ScummEngine::getNumBoxes() { return 0; if (_game.version == 8) return (byte)READ_LE_UINT32(ptr); - else if (_game.features >= 5) + else if (_game.version >= 5) return (byte)READ_LE_UINT16(ptr); else return ptr[0]; diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp index 82497de87a..57b793d579 100644 --- a/engines/scumm/costume.cpp +++ b/engines/scumm/costume.cpp @@ -1040,26 +1040,25 @@ byte C64CostumeRenderer::drawLimb(const Actor *a, int limb) { if (limb >= 8) return 0; + if (a->_cost.start[limb] == 0xFFFF) + return 0; + if (limb == 0) { _draw_top = 200; _draw_bottom = 0; } + + bool flipped = (a->_cost.start[limb] & 0x80) != 0; + byte frameStart = _loaded._frameOffsets[a->_cost.frame[limb]]; + byte frame = _loaded._frameOffsets[frameStart + a->_cost.curpos[limb]]; + if (frame == 0xFF) + return 0; - // TODO: - // get out how animations are handled - byte state = a->_moving != 0 ? 0 : 1; - byte unk1 = (_loaded._animCmds + (state*32) + newDirToOldDir(a->getFacing()) * 8)[limb]; - byte unk2 = _loaded._frameOffsets[_loaded._frameOffsets[limb] + (unk1 & 0x7f)]; - bool flipped = (unk1 & 0x80) != 0; - - byte p1 = _loaded._frameOffsets[unk2]; - byte temp1 = _loaded._baseptr[p1]; - byte temp2 = temp1 + _loaded._dataOffsets[4]; - int offL = _loaded._baseptr[temp1 + 2]; - int offH = _loaded._baseptr[temp2]; - int off = (offH << 8) + offL; + byte ptrLow = _loaded._baseptr[frame]; + byte ptrHigh = ptrLow + _loaded._dataOffsets[4]; + int frameOffset = (_loaded._baseptr[ptrHigh] << 8) + _loaded._baseptr[ptrLow + 2]; // 0x23EF / 0x2400 - const byte *data = _loaded._baseptr + off; + const byte *data = _loaded._baseptr + frameOffset; // Set up the palette data byte palette[4] = { 0, 0, 0, 0 }; @@ -1077,8 +1076,8 @@ byte C64CostumeRenderer::drawLimb(const Actor *a, int limb) { int offsetY = *data++; // these two fields seems to be most times zero // byte6 was one time 255 in one costume I tried -// int byte5 = *data++; -// int byte6 = *data++; +// int byte5 = *data++; // 0x1F80 // This value is never used +// int byte6 = *data++; // 0x1F86 // This value is subtracted from ?actor drawy? at 0x2383 // debug(3, "byte5: %d", byte5); // debug(3, "byte6: %d", byte6); data += 2; @@ -1091,17 +1090,13 @@ byte C64CostumeRenderer::drawLimb(const Actor *a, int limb) { if (flipped) { if (offsetX) - xpos += (offsetX-1) * 8; + xpos += (offsetX - 1) * 8; } else { xpos += offsetX * 8; } - // + 4 could be commented, because maybe the _actorX position is - // wrong, I looked at the scumm-c64 interpreter by lloyd - // and there Bernhard is directly on the right in the intro - // but here in ScummVM he is 4 pixel left of the other position. - xpos += _actorX - (a->_width / 2) + 4; - ypos += _actorY - _loaded._maxHeight; + xpos += _actorX - (a->_width / 2); + ypos += (_actorY - _loaded._maxHeight) + 1; // +1 as we appear to be 1 pixel away from the original interpreter // This code is very similar to procC64() for (int y = 0; y < height; ++y) { @@ -1111,9 +1106,9 @@ byte C64CostumeRenderer::drawLimb(const Actor *a, int limb) { int realX = 0; if (flipped) { if (offsetX == 0||offsetX == 1) { - realX = width-(x+1); + realX = width-(x + 1); } else if (offsetX == 2) { - realX = width-(x+2); + realX = width-(x + 2); } } else { realX = x; @@ -1134,10 +1129,8 @@ byte C64CostumeRenderer::drawLimb(const Actor *a, int limb) { } _draw_top = MIN(_draw_top, ypos); - _draw_bottom = MAX(_draw_bottom, ypos+height); - // if +4 above is NOT commented, here "+(flipped ? 4 : 0)" can be commented out - // and other way round - _vm->markRectAsDirty(kMainVirtScreen, xpos, xpos+(width*8)/*+(flipped ? 4 : 0)*/, ypos, ypos+height, _actorID); + _draw_bottom = MAX(_draw_bottom, ypos + height); + _vm->markRectAsDirty(kMainVirtScreen, xpos, xpos + (width * 8), ypos, ypos + height, _actorID); return 0; } @@ -1151,6 +1144,7 @@ void C64CostumeRenderer::setCostume(int costume, int shadow) { void C64CostumeLoader::loadCostume(int id) { const byte *ptr = _vm->getResourceAddress(rtCostume, id); + _id = id; _baseptr = ptr + 9; @@ -1165,33 +1159,152 @@ void C64CostumeLoader::loadCostume(int id) { _animCmds = _baseptr + READ_LE_UINT16(ptr + 7); _maxHeight = 0; - for (int i = 0; i < 8; ++i) { - int pid = _frameOffsets[_frameOffsets[i]]; - byte p1 = _frameOffsets[pid]; - byte b = _baseptr[p1]; - byte c = b + _dataOffsets[4]; - int offL = _baseptr[b + 2]; - int offH = _baseptr[c]; - int off = (offH << 8) + offL; - const byte *data = _baseptr + off; - - if (data[3] > _maxHeight) { - _maxHeight = data[3]; // data[3] is libs's Y offset +} + +void C64CostumeLoader::frameUpdate(ActorC64 *a, int cmd ) { + byte limbFrames = 0; + + // Each costume-command has 8 limbs (0x2622) + cmd <<= 3; + + for (int limb = 0, pos = 0; limb < 8; ++limb, pos = 0) { + // get a limb frames ptr from the costume command + limbFrames = ((_animCmds + cmd)[limb]); + + // Dont change limb if entry is invalid + if (limbFrames == 0xFF) + continue; + + // Has limb frames ptr changed since last update? + if (a->_cost.start[limb] == limbFrames) + continue; + + // Set new limb command addresses + a->_cost.start[limb] = limbFrames; + a->_cost.frame[limb] = _frameOffsets[limb] + (limbFrames & 0x7f); // limb animation-frames ptr + + // Get first entry of a limbs' frames + byte frameStart = _frameOffsets[ a->_cost.frame[limb]]; + + // Loop each frame in this limb until we reach the end marker + while (pos != 0xFF) { // This is just so we dont overflow + byte frame = _frameOffsets[frameStart + pos]; + + // Each animation-frame until we find end + if (frame == 0xFF) + break; + + byte ptrLow = _baseptr[frame]; + byte ptrHigh = ptrLow + _dataOffsets[4]; + int frameOffset = (_baseptr[ptrHigh] << 8) + _baseptr[ptrLow + 2]; // 0x23EF / 0x2400 + + const byte *data = _baseptr + frameOffset; + + if (data[3] > _maxHeight) + _maxHeight = data[3] + 1; + + ++pos; } + + // Set ending position of limb frames + a->_cost.end[limb] = pos - 1; + a->_cost.curpos[limb] = 0; } - ++_maxHeight; } -void C64CostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) { +// based on 0x2BCA, doesn't match disassembly because 'oldDir' variable +// is not the same value as stored in the original interpreter +int C64CostumeLoader::dirToDirStop(int oldDir) { + switch (oldDir) { + case 0: + return 4; // Left + case 1: + return 5; // Right + case 2: + return 6; // Face Camera + case 3: + return 7; // Face Away + } + // shouldnt' be reached + return 4; } -byte C64CostumeLoader::increaseAnims(Actor *a) { - return 0; +void C64CostumeLoader::actorSpeak(ActorC64 *a, int &cmd) { + if ((a->_speaking & 0x80)) + cmd += 0x0C; + else + cmd += 0x10; } -byte C64CostumeLoader::increaseAnim(Actor *a, int slot) { - return 0; +void C64CostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) { + ActorC64 *A = (ActorC64 *)a; + int dir = newDirToOldDir(a->getFacing()); + int command = dir; + + loadCostume(a->_costume); + + // Enable/Disable speaking flag + if (frame == a->_talkStartFrame) { + A->_speaking = 1; + return; + } + if (frame == a->_talkStopFrame) { + A->_speaking = 0; + return; + } + + // Different command for stand frame + if (frame == a->_standFrame) + command = dirToDirStop(dir); + + // Update the limb frames + frameUpdate(A, command); + + // Keep current command/frame mode + A->_costCommand = dir; + A->_costFrame = frame; + + // Update 'speaking' frames? + if (A->_speaking) { + command = dir; // Incase standing frame was set as cmd + actorSpeak(A, command); + + // Update the limb speak frames + frameUpdate(A, command); + } } +byte C64CostumeLoader::increaseAnims(Actor *a) { + ActorC64 *A = (ActorC64 *)a; + + // check if the actor speak flag has changed since last frame increase + if (A->_speaking != A->_speakingPrev) { + int cmd = A->_costCommand; + A->_speakingPrev = A->_speaking; + + // Update to use speak frame + if (A->_speaking & 0x80) { + actorSpeak(A, cmd); + + } else { + // Update to use stand frame + if (A->_costFrame == A->_standFrame) + cmd = dirToDirStop(cmd); + } + + // Update the limb frames + frameUpdate(A, cmd); + } + + // increase each frame pos + for (int limb = 0; limb < 8; ++limb) { + if (a->_cost.curpos[limb] < a->_cost.end[limb]) + a->_cost.curpos[limb]++; + else + a->_cost.curpos[limb] = 0; + } + + return 1; +} } // End of namespace Scumm diff --git a/engines/scumm/costume.h b/engines/scumm/costume.h index 003bd6ce2b..8e1910abcf 100644 --- a/engines/scumm/costume.h +++ b/engines/scumm/costume.h @@ -79,8 +79,12 @@ public: byte increaseAnims(Actor *a); int _maxHeight; + protected: - byte increaseAnim(Actor *a, int slot); + void actorSpeak(ActorC64 *a, int &cmd); + int dirToDirStop(int oldDir); + void frameUpdate(ActorC64 *A, int cmd); + }; class ClassicCostumeRenderer : public BaseCostumeRenderer { diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 5fa74d22c3..8beb2ef720 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -723,6 +723,32 @@ GameDescriptor ScummMetaEngine::findGame(const char *gameid) const { return AdvancedDetector::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable); } +static Common::String generatePreferredTarget(const DetectorResult &x) { + Common::String res(x.game.gameid); + + if (x.game.preferredTag) { + res = res + "-" + x.game.preferredTag; + } + + if (x.game.features & GF_DEMO) { + res = res + "-demo"; + } + + // Append the platform, if a non-standard one has been specified. + if (x.game.platform != Common::kPlatformPC && x.game.platform != Common::kPlatformUnknown) { + // HACK: For CoMI, it's pointless to encode the fact that it's for Windows + if (x.game.id != GID_CMI) + res = res + "-" + Common::getPlatformAbbrev(x.game.platform); + } + + // Append the language, if a non-standard one has been specified + if (x.language != Common::EN_ANY && x.language != Common::UNK_LANG) { + res = res + "-" + Common::getLanguageCode(x.language); + } + + return res; +} + GameList ScummMetaEngine::detectGames(const Common::FSList &fslist) const { GameList detectedGames; Common::List<DetectorResult> results; @@ -737,34 +763,34 @@ GameList ScummMetaEngine::detectGames(const Common::FSList &fslist) const { const PlainGameDescriptor *g = findPlainGameDescriptor(x->game.gameid, gameDescriptions); assert(g); GameDescriptor dg(x->game.gameid, g->description, x->language, x->game.platform); - dg.updateDesc(x->extra); // Append additional information, if set, to the description. + + // Append additional information, if set, to the description. + dg.updateDesc(x->extra); // Compute and set the preferred target name for this game. // Based on generateComplexID() in advancedDetector.cpp. - Common::String res(x->game.gameid); - - if (x->game.preferredTag) { - res = res + "-" + x->game.preferredTag; - } - - if (x->game.features & GF_DEMO) { - res = res + "-demo"; - } - - // Append the platform, if a non-standard one has been specified. - if (x->game.platform != Common::kPlatformPC && x->game.platform != Common::kPlatformUnknown) { - // HACK: For CoMI, it's pointless to encode the fact that it's for Windows - if (x->game.id != GID_CMI) - res = res + "-" + Common::getPlatformAbbrev(x->game.platform); - } - - // Append the language, if a non-standard one has been specified - if (x->language != Common::EN_ANY && x->language != Common::UNK_LANG) { - res = res + "-" + Common::getLanguageCode(x->language); + dg["preferredtarget"] = generatePreferredTarget(*x); + + // HACK: Detect and distinguish the FM-TOWNS demos + if (x->game.platform == Common::kPlatformFMTowns && (x->game.features & GF_DEMO)) { + if (x->md5 == "2d388339d6050d8ccaa757b64633954e") { + // Indy + Loom demo + dg.description() = "Indiana Jones and the Last Crusade & Loom"; + dg.updateDesc(x->extra); + dg["preferredtarget"] = "indyloom"; + } else if (x->md5 == "77f5c9cc0986eb729c1a6b4c8823bbae") { + // Zak + Loom demo + dg.description() = "Zak McKracken & Loom"; + dg.updateDesc(x->extra); + dg["preferredtarget"] = "zakloom"; + } else if (x->md5 == "3938ee1aa4433fca9d9308c9891172b1") { + // Indy + Zak demo + dg.description() = "Indiana Jones and the Last Crusade & Zak McKracken"; + dg.updateDesc(x->extra); + dg["preferredtarget"] = "indyzak"; + } } - dg["preferredtarget"] = res; - dg.setGUIOptions(x->game.guioptions); detectedGames.push_back(dg); diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h index 92024a21cc..5054bffd30 100644 --- a/engines/scumm/detection_tables.h +++ b/engines/scumm/detection_tables.h @@ -230,14 +230,14 @@ static const GameSettings gameVariantsTable[] = { {"monkey2", 0, 0, GID_MONKEY2, 5, 0, MDT_ADLIB | MDT_MIDI, 0, UNK, GUIO_NOSPEECH}, - {"atlantis", "", 0, GID_INDY4, 5, 0, MDT_ADLIB | MDT_MIDI, 0, UNK, GUIO_NOSPEECH}, - {"atlantis", "CD" , 0, GID_INDY4, 5, 0, MDT_ADLIB | MDT_MIDI, 0, UNK, GUIO_NONE}, + {"atlantis", "" , 0, GID_INDY4, 5, 0, MDT_ADLIB | MDT_MIDI, 0, UNK, GUIO_NONE}, + {"atlantis", "Floppy", 0, GID_INDY4, 5, 0, MDT_ADLIB | MDT_MIDI, 0, UNK, GUIO_NOSPEECH}, - {"tentacle", "", 0, GID_TENTACLE, 6, 0, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NOSPEECH}, - {"tentacle", "CD", 0, GID_TENTACLE, 6, 0, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NONE}, + {"tentacle", "", 0, GID_TENTACLE, 6, 0, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NONE}, + {"tentacle", "Floppy", 0, GID_TENTACLE, 6, 0, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NOSPEECH}, - {"samnmax", "", 0, GID_SAMNMAX, 6, 0, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NOSPEECH}, - {"samnmax", "CD", 0, GID_SAMNMAX, 6, 0, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NONE}, + {"samnmax", "", 0, GID_SAMNMAX, 6, 0, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NONE}, + {"samnmax", "Floppy", 0, GID_SAMNMAX, 6, 0, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NOSPEECH}, #ifdef ENABLE_SCUMM_7_8 {"ft", 0, 0, GID_FT, 7, 0, MDT_NONE, 0, UNK, GUIO_NOMIDI}, diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 880fab04a5..42e49afcc1 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -439,7 +439,7 @@ ScummMenuDialog::ScummMenuDialog(ScummEngine *scumm) new GUI::ButtonWidget(this, "ScummMain.Resume", "Resume", kPlayCmd, 'P'); new GUI::ButtonWidget(this, "ScummMain.Load", "Load", kLoadCmd, 'L'); - new GUI::ButtonWidget(this, "ScummMain.Save", "Save", kSaveCmd, 'S'); + _saveButton = new GUI::ButtonWidget(this, "ScummMain.Save", "Save", kSaveCmd, 'S'); new GUI::ButtonWidget(this, "ScummMain.Options", "Options", kOptionsCmd, 'O'); #ifndef DISABLE_HELP @@ -471,6 +471,13 @@ ScummMenuDialog::~ScummMenuDialog() { delete _loadDialog; } +void ScummMenuDialog::reflowLayout() { + if (!_vm->canSaveGameStateCurrently()) + _saveButton->setEnabled(false); + + Dialog::reflowLayout(); +} + void ScummMenuDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { switch (cmd) { case kSaveCmd: diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h index af844272fa..d4ecbde534 100644 --- a/engines/scumm/dialogs.h +++ b/engines/scumm/dialogs.h @@ -88,6 +88,8 @@ public: ~ScummMenuDialog(); virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data); + virtual void reflowLayout(); + protected: ScummEngine *_vm; @@ -99,6 +101,8 @@ protected: SaveLoadChooser *_saveDialog; SaveLoadChooser *_loadDialog; + GUI::ButtonWidget *_saveButton; + void save(); void load(); }; diff --git a/engines/scumm/file.cpp b/engines/scumm/file.cpp index 3f101691c7..6dc31b09ef 100644 --- a/engines/scumm/file.cpp +++ b/engines/scumm/file.cpp @@ -126,7 +126,7 @@ bool ScummFile::openSubFile(const Common::String &filename) { bool ScummFile::eos() const { - return _subFileLen ? (pos() >= _subFileLen) : File::eos(); // FIXME + return _subFileLen ? _myEos : File::eos(); } int32 ScummFile::pos() const { @@ -154,7 +154,10 @@ bool ScummFile::seek(int32 offs, int whence) { assert((int32)_subFileStart <= offs && offs <= (int32)(_subFileStart + _subFileLen)); whence = SEEK_SET; } - return File::seek(offs, whence); + bool ret = File::seek(offs, whence); + if (ret) + _myEos = false; + return ret; } uint32 ScummFile::read(void *dataPtr, uint32 dataSize) { @@ -167,7 +170,7 @@ uint32 ScummFile::read(void *dataPtr, uint32 dataSize) { int32 newPos = curPos + dataSize; if (newPos > _subFileLen) { dataSize = _subFileLen - curPos; - _myIoFailed = true; + _myEos = true; } } diff --git a/engines/scumm/file.h b/engines/scumm/file.h index aa52dd069f..c37c2f036e 100644 --- a/engines/scumm/file.h +++ b/engines/scumm/file.h @@ -55,7 +55,7 @@ private: byte _encbyte; int32 _subFileStart; int32 _subFileLen; - bool _myIoFailed; + bool _myEos; // Have we read past the end of the subfile? void setSubfileRange(int32 start, int32 len); void resetSubfile(); @@ -67,8 +67,7 @@ public: bool open(const Common::String &filename); bool openSubFile(const Common::String &filename); - bool ioFailed() const { return _myIoFailed || BaseScummFile::ioFailed(); } - void clearIOFailed() { _myIoFailed = false; BaseScummFile::clearIOFailed(); } + void clearErr() { _myEos = false; BaseScummFile::clearErr(); } bool eos() const; int32 pos() const; diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index 5961ec4013..18cba0ab4a 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -758,18 +758,18 @@ void ditherHerc(byte *src, byte *hercbuf, int srcPitch, int *x, int *y, int *wid } void scale2x(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h) { - byte *dstL1 = dst; - byte *dstL2 = dst + dstPitch; + uint16 *dstL1 = (uint16 *)dst; + uint16 *dstL2 = (uint16 *)(dst + dstPitch); - int dstAdd = dstPitch * 2 - w * 2; - int srcAdd = srcPitch - w; + const int dstAdd = dstPitch - w; + const int srcAdd = srcPitch - w; while (h--) { - for (int x = 0; x < w; ++x, dstL1 += 2, dstL2 += 2) { + for (int x = 0; x < w; ++x) { uint16 col = *src++; col |= col << 8; - *(uint16*)(dstL1) = col; - *(uint16*)(dstL2) = col; + *dstL1++ = col; + *dstL2++ = col; } dstL1 += dstAdd; dstL2 += dstAdd; src += srcAdd; diff --git a/engines/scumm/he/cup_player_he.cpp b/engines/scumm/he/cup_player_he.cpp index 51176c5df9..39615edb6a 100644 --- a/engines/scumm/he/cup_player_he.cpp +++ b/engines/scumm/he/cup_player_he.cpp @@ -91,20 +91,19 @@ void CUP_Player::close() { } void CUP_Player::play() { - while (parseNextHeaderTag(_fileStream)) { - if (_fileStream.ioFailed()) { - return; - } - } + while (parseNextHeaderTag(_fileStream)) { } + + if (_fileStream.eos() || _fileStream.err()) + return; + debug(1, "rate %d width %d height %d", _playbackRate, _width, _height); int ticks = _system->getMillis(); while (_dataSize != 0 && !_vm->shouldQuit()) { - while (parseNextBlockTag(_fileStream)) { - if (_fileStream.ioFailed()) { - return; - } - } + while (parseNextBlockTag(_fileStream)) { } + if (_fileStream.eos() || _fileStream.err()) + return; + int diff = _system->getMillis() - ticks; if (diff >= 0 && diff <= _playbackRate) { _system->delayMillis(_playbackRate - diff); @@ -200,6 +199,10 @@ void CUP_Player::waitForSfxChannel(int channel) { bool CUP_Player::parseNextHeaderTag(Common::SeekableReadStream &dataStream) { uint32 tag = dataStream.readUint32BE(); uint32 size = dataStream.readUint32BE() - 8; + + if (dataStream.eos()) + return false; + uint32 next = dataStream.pos() + size; debug(1, "New header tag %s %d dataSize %d", tag2str(tag), size, _dataSize); switch (tag) { diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h index 4c2da19cc5..9e905b0e79 100644 --- a/engines/scumm/he/intern_he.h +++ b/engines/scumm/he/intern_he.h @@ -78,7 +78,7 @@ protected: int virtScreenSave(byte *dst, int x1, int y1, int x2, int y2); void virtScreenLoad(int resIdx, int x1, int y1, int x2, int y2); - int convertFilePath(byte *dst); + int convertFilePath(byte *dst, int dstSize); virtual void decodeParseString(int a, int b); void swapObjects(int object1, int object2); diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index fe0904d632..84fec085cc 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -1621,7 +1621,7 @@ void ScummEngine_v100he::o100_roomOps() { copyScriptString((byte *)buffer, sizeof(buffer)); - r = convertFilePath(buffer); + r = convertFilePath(buffer, sizeof(buffer)); memcpy(_saveLoadFileName, buffer + r, sizeof(buffer) - r); debug(1, "o100_roomOps: case 137: filename %s", _saveLoadFileName); @@ -2239,7 +2239,7 @@ void ScummEngine_v100he::o100_videoOps() { if (_videoParams.flags == 0) _videoParams.flags = 4; - const char *filename = (char *)_videoParams.filename + convertFilePath(_videoParams.filename); + const char *filename = (char *)_videoParams.filename + convertFilePath(_videoParams.filename, sizeof(_videoParams.filename)); if (_videoParams.flags == 2) { VAR(119) = _moviePlay->load(filename, _videoParams.flags, _videoParams.wizResNum); } else { diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp index 5ad447b1c7..f186495f81 100644 --- a/engines/scumm/he/script_v60he.cpp +++ b/engines/scumm/he/script_v60he.cpp @@ -93,7 +93,7 @@ void ScummEngine_v60he::setupOpcodes() { _opcodes[0xed].setProc(0, 0); } -int ScummEngine_v60he::convertFilePath(byte *dst) { +int ScummEngine_v60he::convertFilePath(byte *dst, int dstSize) { debug(1, "convertFilePath: original filePath is %s", dst); int len = resStrLen(dst); @@ -113,16 +113,25 @@ int ScummEngine_v60he::convertFilePath(byte *dst) { // Strip path int r = 0; - if (dst[0] == '.' && dst[1] == '/') { // Game Data Path + if (dst[len - 3] == 's' && dst[len - 2] == 'g') { // Save Game File + // Change filename prefix to target name, for save game files. + char saveName[20]; + sprintf(saveName, "%s.sg%c", _targetName.c_str(), dst[len - 1]); + memcpy(dst, saveName, 20); + } else if (dst[0] == '.' && dst[1] == '/') { // Game Data Path + // The default game data path is set to './' by ScummVM r = 2; } else if (dst[0] == '*' && dst[1] == '/') { // Save Game Path (HE72 - HE100) + // The default save game path is set to '*/' by ScummVM r = 2; } else if (dst[0] == 'c' && dst[1] == ':') { // Save Game Path (HE60 - HE71) + // The default save path is game path (DOS) or 'c:/hegames/' (Windows) for (r = len; r != 0; r--) { if (dst[r - 1] == '/') break; } } else if (dst[0] == 'u' && dst[1] == 's') { // Save Game Path (Moonbase Commander) + // The default save path is 'user/' r = 5; } @@ -269,7 +278,7 @@ void ScummEngine_v60he::o60_roomOps() { len = resStrLen(_scriptPointer); _scriptPointer += len + 1; - r = convertFilePath(buffer); + r = convertFilePath(buffer, sizeof(buffer)); memcpy(_saveLoadFileName, buffer + r, sizeof(buffer) - r); debug(1, "o60_roomOps: case 221: filename %s", _saveLoadFileName); @@ -684,7 +693,7 @@ void ScummEngine_v60he::o60_openFile() { len = resStrLen(_scriptPointer); _scriptPointer += len + 1; - filename = (char *)buffer + convertFilePath(buffer); + filename = (char *)buffer + convertFilePath(buffer, sizeof(buffer)); debug(1, "Final filename to %s", filename); mode = pop(); @@ -738,7 +747,7 @@ void ScummEngine_v60he::o60_deleteFile() { len = resStrLen(_scriptPointer); _scriptPointer += len + 1; - filename = (char *)buffer + convertFilePath(buffer); + filename = (char *)buffer + convertFilePath(buffer, sizeof(buffer)); debug(1, "o60_deleteFile (\"%s\")", filename); @@ -760,8 +769,8 @@ void ScummEngine_v60he::o60_rename() { len = resStrLen(_scriptPointer); _scriptPointer += len + 1; - oldFilename = (char *)buffer1 + convertFilePath(buffer1); - newFilename = (char *)buffer2 + convertFilePath(buffer2); + oldFilename = (char *)buffer1 + convertFilePath(buffer1, sizeof(buffer1)); + newFilename = (char *)buffer2 + convertFilePath(buffer2, sizeof(buffer2)); debug(1, "o60_rename (\"%s\" to \"%s\")", oldFilename, newFilename); diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp index 64c63baa9d..6224ef5b47 100644 --- a/engines/scumm/he/script_v72he.cpp +++ b/engines/scumm/he/script_v72he.cpp @@ -713,7 +713,7 @@ void ScummEngine_v72he::o72_roomOps() { copyScriptString((byte *)buffer, sizeof(buffer)); - r = convertFilePath(buffer); + r = convertFilePath(buffer, sizeof(buffer)); memcpy(_saveLoadFileName, buffer + r, sizeof(buffer) - r); debug(1, "o72_roomOps: case 221: filename %s", _saveLoadFileName); @@ -1401,7 +1401,7 @@ void ScummEngine_v72he::o72_openFile() { strcpy((char *)buffer, "moonbase.ini"); } - const char *filename = (char *)buffer + convertFilePath(buffer); + const char *filename = (char *)buffer + convertFilePath(buffer, sizeof(buffer)); debug(1, "Final filename to %s", filename); slot = -1; @@ -1547,7 +1547,7 @@ void ScummEngine_v72he::o72_deleteFile() { byte buffer[256]; copyScriptString(buffer, sizeof(buffer)); - const char *filename = (char *)buffer + convertFilePath(buffer); + const char *filename = (char *)buffer + convertFilePath(buffer, sizeof(buffer)); debug(1, "o72_deleteFile(%s)", filename); @@ -1562,8 +1562,8 @@ void ScummEngine_v72he::o72_rename() { copyScriptString(buffer1, sizeof(buffer1)); copyScriptString(buffer2, sizeof(buffer2)); - const char *newFilename = (char *)buffer1 + convertFilePath(buffer1); - const char *oldFilename = (char *)buffer2 + convertFilePath(buffer2); + const char *newFilename = (char *)buffer1 + convertFilePath(buffer1, sizeof(buffer1)); + const char *oldFilename = (char *)buffer2 + convertFilePath(buffer2, sizeof(buffer2)); _saveFileMan->renameSavefile(oldFilename, newFilename); diff --git a/engines/scumm/he/script_v80he.cpp b/engines/scumm/he/script_v80he.cpp index b71a0f9e10..d7e36106ea 100644 --- a/engines/scumm/he/script_v80he.cpp +++ b/engines/scumm/he/script_v80he.cpp @@ -89,7 +89,7 @@ void ScummEngine_v80he::o80_getFileSize() { byte buffer[256]; copyScriptString(buffer, sizeof(buffer)); - const char *filename = (char *)buffer + convertFilePath(buffer); + const char *filename = (char *)buffer + convertFilePath(buffer, sizeof(buffer)); Common::SeekableReadStream *f = 0; if (!_saveFileMan->listSavefiles(filename).empty()) { @@ -154,7 +154,7 @@ void ScummEngine_v80he::o80_readConfigFile() { copyScriptString(section, sizeof(section)); copyScriptString(filename, sizeof(filename)); - r = convertFilePath(filename); + r = convertFilePath(filename, sizeof(filename)); if (_game.id == GID_TREASUREHUNT) { // WORKAROUND: Remove invalid characters @@ -222,7 +222,7 @@ void ScummEngine_v80he::o80_writeConfigFile() { error("o80_writeConfigFile: default type %d", subOp); } - r = convertFilePath(filename); + r = convertFilePath(filename, sizeof(filename)); if (_game.id == GID_TREASUREHUNT) { // WORKAROUND: Remove invalid characters diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp index f97771a4f8..2da58b4480 100644 --- a/engines/scumm/he/script_v90he.cpp +++ b/engines/scumm/he/script_v90he.cpp @@ -1426,7 +1426,7 @@ void ScummEngine_v90he::o90_videoOps() { if (_videoParams.flags == 0) _videoParams.flags = 4; - const char *filename = (char *)_videoParams.filename + convertFilePath(_videoParams.filename); + const char *filename = (char *)_videoParams.filename + convertFilePath(_videoParams.filename, sizeof(_videoParams.filename)); if (_videoParams.flags & 2) { VAR(119) = _moviePlay->load(filename, _videoParams.flags, _videoParams.wizResNum); } else { diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp index 4c20ed7835..6b1db38b23 100644 --- a/engines/scumm/he/wiz_he.cpp +++ b/engines/scumm/he/wiz_he.cpp @@ -2083,7 +2083,7 @@ void Wiz::processWizImage(const WizParameters *params) { Common::File f; memcpy(filename, params->filename, 260); - _vm->convertFilePath(filename); + _vm->convertFilePath(filename, sizeof(filename)); if (f.open((const char *)filename)) { uint32 id = f.readUint32BE(); @@ -2126,7 +2126,7 @@ void Wiz::processWizImage(const WizParameters *params) { break; case 0: memcpy(filename, params->filename, 260); - _vm->convertFilePath(filename); + _vm->convertFilePath(filename, sizeof(filename)); if (!f.open((const char *)filename)) { debug(0, "Unable to open for write '%s'", filename); diff --git a/engines/scumm/imuse_digi/dimuse_bndmgr.cpp b/engines/scumm/imuse_digi/dimuse_bndmgr.cpp index 4577a11fe1..be5f7623ca 100644 --- a/engines/scumm/imuse_digi/dimuse_bndmgr.cpp +++ b/engines/scumm/imuse_digi/dimuse_bndmgr.cpp @@ -225,7 +225,7 @@ bool BundleMgr::loadCompTable(int32 index) { _file->seek(8, SEEK_CUR); if (tag != MKID_BE('COMP')) { - error("BundleMgr::loadCompTable() Compressed sound %d invalid (%s)", index, tag2str(tag)); + error("BundleMgr::loadCompTable() Compressed sound %d (%s:%d) invalid (%s)", index, _file->getName(), _bundleTable[index].offset, tag2str(tag)); return false; } diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index 61b714a3e2..ab32992b03 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -110,9 +110,9 @@ void ScummEngine_v80he::parseEvent(Common::Event event) { void ScummEngine::parseEvent(Common::Event event) { switch (event.type) { case Common::EVENT_KEYDOWN: - if (event.kbd.keycode >= '0' && event.kbd.keycode <= '9' - && (event.kbd.flags == Common::KBD_ALT || - event.kbd.flags == Common::KBD_CTRL)) { + if (event.kbd.keycode >= '0' && event.kbd.keycode <= '9' && + ((event.kbd.flags == Common::KBD_ALT && canSaveGameStateCurrently()) || + (event.kbd.flags == Common::KBD_CTRL && canLoadGameStateCurrently()))) { _saveLoadSlot = event.kbd.keycode - '0'; // don't overwrite autosave (slot 0) @@ -302,17 +302,6 @@ void ScummEngine::processInput() { // _mouseAndKeyboardStat = 0; - // Interpret 'return' as left click and 'tab' as right click - if (lastKeyHit.keycode && _cursor.state > 0) { - if (lastKeyHit.keycode == Common::KEYCODE_TAB) { - _mouseAndKeyboardStat = MBS_RIGHT_CLICK; - lastKeyHit.reset(); - } else if (lastKeyHit.keycode == Common::KEYCODE_RETURN) { - _mouseAndKeyboardStat = MBS_LEFT_CLICK; - lastKeyHit.reset(); - } - } - if ((_leftBtnPressed & msClicked) && (_rightBtnPressed & msClicked) && _game.version >= 4) { // Pressing both mouse buttons is treated as if you pressed // the cutscene exit key (ESC) in V4+ games. That mimicks diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp index f29be071e0..2eab2cfa3a 100644 --- a/engines/scumm/object.cpp +++ b/engines/scumm/object.cpp @@ -181,7 +181,11 @@ void ScummEngine::clearOwnerOf(int obj) { // Alternatively, scan the inventory to see if the object is in there... for (i = 0; i < _numInventory; i++) { if (_inventory[i] == obj) { - assert(WIO_INVENTORY == whereIsObject(obj)); + if (_game.version == 0) + assert(WIO_INVENTORY == whereIsObjectInventory(obj)); + else + assert(WIO_INVENTORY == whereIsObject(obj)); + // Found the object! Nuke it from the inventory. _res->nukeResource(rtInventory, i); _inventory[i] = 0; @@ -286,7 +290,7 @@ int ScummEngine::getState(int obj) { // it. Fortunately this does not prevent frustrated players from // blowing up the mansion, should they feel the urge to. - if (_game.id == GID_MANIAC && (obj == 182 || obj == 193)) + if (_game.id == GID_MANIAC && _game.version != 0 && (obj == 182 || obj == 193)) _objectStateTable[obj] |= kObjectState_08; } @@ -317,6 +321,15 @@ int ScummEngine::getObjectIndex(int object) const { return -1; } +int ScummEngine::whereIsObjectInventory(int object) { + int res = 0; + _v0ObjectInInventory = true; + res = whereIsObject(object); + _v0ObjectInInventory = false; + + return res; +} + int ScummEngine::whereIsObject(int object) const { int i; @@ -326,7 +339,7 @@ int ScummEngine::whereIsObject(int object) const { if (object < 1) return WIO_NOT_FOUND; - if (_objectOwnerTable[object] != OF_OWNER_ROOM) { + if ((_objectOwnerTable[object] != OF_OWNER_ROOM && _game.version != 0) || _v0ObjectInInventory) { for (i = 0; i < _numInventory; i++) if (_inventory[i] == object) return WIO_INVENTORY; @@ -334,7 +347,7 @@ int ScummEngine::whereIsObject(int object) const { } for (i = (_numLocalObjects-1); i > 0; i--) - if (_objs[i].obj_nr == object) { + if ((_objs[i].obj_nr == object && !_v0ObjectIndex) || (_v0ObjectIndex && i == object)) { if (_objs[i].fl_object_index) return WIO_FLOBJECT; return WIO_ROOM; @@ -379,7 +392,7 @@ int ScummEngine::getObjectOrActorXY(int object, int &x, int &y) { * Returns X, Y and direction in angles */ void ScummEngine::getObjectXYPos(int object, int &x, int &y, int &dir) { - int idx = getObjectIndex(object); + int idx = (_v0ObjectIndex) ? object : getObjectIndex(object); assert(idx >= 0); ObjectData &od = _objs[idx]; int state; @@ -434,7 +447,7 @@ void ScummEngine::getObjectXYPos(int object, int &x, int &y, int &dir) { dir = oldDirToNewDir(od.actordir & 3); } -static int getDist(int x, int y, int x2, int y2) { +int ScummEngine::getDist(int x, int y, int x2, int y2) { int a = ABS(y - y2); int b = ABS(x - x2); return MAX(a, b); @@ -475,6 +488,14 @@ int ScummEngine::getObjActToObjActDist(int a, int b) { return getDist(x, y, x2, y2); } +int ScummEngine_v0::findObjectIndex(int x, int y) { + int objIdx; + _v0ObjectIndex = true; + objIdx = findObject(x, y); + _v0ObjectIndex = false; + return objIdx; +} + int ScummEngine::findObject(int x, int y) { int i, b; byte a; @@ -504,8 +525,12 @@ int ScummEngine::findObject(int x, int y) { } #endif if (_objs[i].x_pos <= x && _objs[i].width + _objs[i].x_pos > x && - _objs[i].y_pos <= y && _objs[i].height + _objs[i].y_pos > y) - return _objs[i].obj_nr; + _objs[i].y_pos <= y && _objs[i].height + _objs[i].y_pos > y) { + if (_game.version == 0 && _v0ObjectIndex) + return i; + else + return _objs[i].obj_nr; + } break; } } while ((_objs[b].state & mask) == a); @@ -811,6 +836,9 @@ void ScummEngine_v3old::resetRoomObjects() { if (_dumpScripts) { char buf[32]; sprintf(buf, "roomobj-%d-", _roomResource); + if (_game.version == 0) + sprintf(buf + 11, "%d-", od->flags); + dumpResource(buf, od->obj_nr, room + od->OBCDoffset); } } @@ -1033,6 +1061,10 @@ void ScummEngine::updateObjectStates() { int i; ObjectData *od = &_objs[1]; for (i = 1; i < _numLocalObjects; i++, od++) { + // V0 MM, Room objects with Flag == 1 are objects with 'no-state' (room specific objects, non-pickup) + if (_game.version == 0 && od->flags == 1) + continue; + if (od->obj_nr > 0) od->state = getState(od->obj_nr); } @@ -1155,7 +1187,7 @@ const byte *ScummEngine::getObjOrActorName(int obj) { void ScummEngine::setObjectName(int obj) { int i; - if (obj < _numActors) + if (obj < _numActors && _game.version != 0) error("Can't set actor %d name with new-name-of", obj); for (i = 0; i < _numNewNames; i++) { @@ -1181,8 +1213,13 @@ void ScummEngine::setObjectName(int obj) { uint32 ScummEngine::getOBCDOffs(int object) const { int i; - if (_objectOwnerTable[object] != OF_OWNER_ROOM) + if ((_objectOwnerTable[object] != OF_OWNER_ROOM && (_game.version != 0)) || _v0ObjectInInventory) return 0; + + // V0 MM Return by Index + if (_v0ObjectIndex) + return _objs[object].OBCDoffset; + for (i = (_numLocalObjects-1); i > 0; i--) { if (_objs[i].obj_nr == object) { if (_objs[i].fl_object_index != 0) @@ -1194,17 +1231,20 @@ uint32 ScummEngine::getOBCDOffs(int object) const { } byte *ScummEngine::getOBCDFromObject(int obj) { + bool useInventory = _v0ObjectInInventory; int i; byte *ptr; - if (_objectOwnerTable[obj] != OF_OWNER_ROOM) { + _v0ObjectInInventory = false; + + if ((_objectOwnerTable[obj] != OF_OWNER_ROOM && (_game.version != 0)) || useInventory) { for (i = 0; i < _numInventory; i++) { if (_inventory[i] == obj) return getResourceAddress(rtInventory, i); } } else { for (i = (_numLocalObjects-1); i > 0; --i) { - if (_objs[i].obj_nr == obj) { + if ((_objs[i].obj_nr == obj && !_v0ObjectIndex) || (_v0ObjectIndex && i == obj)) { if (_objs[i].fl_object_index) { assert(_objs[i].OBCDoffset == 8); ptr = getResourceAddress(rtFlObject, _objs[i].fl_object_index); diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp index 88802a205f..67baff97b3 100644 --- a/engines/scumm/resource.cpp +++ b/engines/scumm/resource.cpp @@ -229,7 +229,7 @@ void ScummEngine::askForDisk(const char *filename, int disknum) { sprintf(buf, "Cannot find file: '%s'\nInsert disc %d into drive %s\nPress OK to retry, Quit to exit", filename, disknum, _gameDataDir.getPath().c_str()); #endif - result = displayMessage("Quit", buf); + result = displayMessage("Quit", "%s", buf); if (!result) { error("Cannot find file: '%s'", filename); } @@ -253,10 +253,10 @@ void ScummEngine::readIndexFile() { if (_game.version <= 5) { // Figure out the sizes of various resources - while (!_fileHandle->eos()) { + while (true) { blocktype = _fileHandle->readUint32BE(); itemsize = _fileHandle->readUint32BE(); - if (_fileHandle->ioFailed()) + if (_fileHandle->eos() || _fileHandle->err()) break; switch (blocktype) { case MKID_BE('DOBJ'): @@ -285,7 +285,6 @@ void ScummEngine::readIndexFile() { } _fileHandle->seek(itemsize - 8, SEEK_CUR); } - _fileHandle->clearIOFailed(); _fileHandle->seek(0, SEEK_SET); } @@ -300,7 +299,7 @@ void ScummEngine::readIndexFile() { blocktype = _fileHandle->readUint32BE(); itemsize = _fileHandle->readUint32BE(); - if (_fileHandle->ioFailed()) + if (_fileHandle->eos() || _fileHandle->err()) break; numblock++; @@ -689,7 +688,7 @@ int ScummEngine::loadResource(int type, int idx) { dumpResource("script-", idx, getResourceAddress(rtScript, idx)); } - if (!_fileHandle->ioFailed()) { + if (!_fileHandle->err() && !_fileHandle->eos()) { return 1; } diff --git a/engines/scumm/resource_v2.cpp b/engines/scumm/resource_v2.cpp index 184f3d94df..e469c721b1 100644 --- a/engines/scumm/resource_v2.cpp +++ b/engines/scumm/resource_v2.cpp @@ -138,7 +138,7 @@ void ScummEngine_v2::readEnhancedIndexFile() { _fileHandle->seek(_numScripts * 3, SEEK_CUR); _numSounds = _fileHandle->readByte(); - _fileHandle->clearIOFailed(); + _fileHandle->clearErr(); _fileHandle->seek(0, SEEK_SET); readMAXS(0); diff --git a/engines/scumm/resource_v3.cpp b/engines/scumm/resource_v3.cpp index 420f71cf03..0728395055 100644 --- a/engines/scumm/resource_v3.cpp +++ b/engines/scumm/resource_v3.cpp @@ -80,7 +80,7 @@ void ScummEngine_v3old::readIndexFile() { _fileHandle->seek(_numScripts * 3, SEEK_CUR); _numSounds = _fileHandle->readByte(); - _fileHandle->clearIOFailed(); + _fileHandle->clearErr(); _fileHandle->seek(0, SEEK_SET); readMAXS(0); diff --git a/engines/scumm/resource_v4.cpp b/engines/scumm/resource_v4.cpp index 28e0fb05b5..75858f7b42 100644 --- a/engines/scumm/resource_v4.cpp +++ b/engines/scumm/resource_v4.cpp @@ -61,11 +61,11 @@ void ScummEngine_v4::readIndexFile() { closeRoom(); openRoom(0); - while (!_fileHandle->eos()) { + while (true) { // Figure out the sizes of various resources itemsize = _fileHandle->readUint32LE(); blocktype = _fileHandle->readUint16LE(); - if (_fileHandle->ioFailed()) + if (_fileHandle->eos() || _fileHandle->err()) break; switch (blocktype) { @@ -95,16 +95,15 @@ void ScummEngine_v4::readIndexFile() { _fileHandle->seek(itemsize - 8, SEEK_CUR); } - _fileHandle->clearIOFailed(); _fileHandle->seek(0, SEEK_SET); readMAXS(0); allocateArrays(); - while (1) { + while (true) { itemsize = _fileHandle->readUint32LE(); - if (_fileHandle->ioFailed()) + if (_fileHandle->eos() || _fileHandle->err()) break; blocktype = _fileHandle->readUint16LE(); diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index d474a43b05..aa4dce470e 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -86,6 +86,19 @@ bool ScummEngine::canLoadGameStateCurrently() { // FIXME: Actually, we might wish to support loading in more places. // As long as we are sure it won't cause any problems... Are we // aware of *any* spots where loading is not supported? + + // HE games are limited to original load and save interface only, + // due to numerous glitches (see bug #1726909) that can occur. + if (_game.heversion >= 60) + return false; + + // COMI always disables saving/loading (to tell the truth: + // the main menu) via its scripts, thus we need to make an + // exception here. This the same forced overwriting of the + // script decisions as in ScummEngine::processKeyboard. + if (_game.id == GID_CMI) + return true; + return (VAR_MAINMENU_KEY == 0xFF || VAR(VAR_MAINMENU_KEY) != 0); } @@ -99,7 +112,22 @@ bool ScummEngine::canSaveGameStateCurrently() { // TODO: Should we disallow saving in some more places, // e.g. when a SAN movie is playing? Not sure whether the // original EXE allowed this. - return (VAR_MAINMENU_KEY == 0xFF || VAR(VAR_MAINMENU_KEY) != 0); + + // HE games are limited to original load and save interface only, + // due to numerous glitches (see bug #1726909) that can occur. + if (_game.heversion >= 60) + return false; + + // COMI always disables saving/loading (to tell the truth: + // the main menu) via its scripts, thus we need to make an + // exception here. This the same forced overwriting of the + // script decisions as in ScummEngine::processKeyboard. + if (_game.id == GID_CMI) + return true; + + // SCUMM v4+ doesn't allow saving in room 0 or if + // VAR(VAR_MAINMENU_KEY) to set to zero. + return (VAR_MAINMENU_KEY == 0xFF || (VAR(VAR_MAINMENU_KEY) != 0 && _currentRoom != 0)); } @@ -1368,11 +1396,31 @@ void ScummEngine::saveOrLoad(Serializer *s) { } void ScummEngine_v0::saveOrLoad(Serializer *s) { + ScummEngine_v2::saveOrLoad(s); + + const SaveLoadEntry v0Entrys[] = { + MKLINE(ScummEngine_v0, _currentMode, sleByte, VER(78)), + MKLINE(ScummEngine_v0, _currentLights, sleByte, VER(78)), + MKEND() + }; + s->saveLoadEntries(this, v0Entrys); +} + + +void ScummEngine_v2::saveOrLoad(Serializer *s) { ScummEngine::saveOrLoad(s); - // TODO: Save additional variables - // _currentMode - // _currentLights + const SaveLoadEntry v2Entrys[] = { + MKLINE(ScummEngine_v2, _inventoryOffset, sleUint16, VER(79)), + MKEND() + }; + s->saveLoadEntries(this, v2Entrys); + + // In old saves we didn't store _inventoryOffset -> reset it to + // a sane default when loading one of those. + if (s->getVersion() < 79 && s->isLoading()) { + _inventoryOffset = 0; + } } void ScummEngine_v5::saveOrLoad(Serializer *s) { diff --git a/engines/scumm/saveload.h b/engines/scumm/saveload.h index 29184ad023..4f6adc5570 100644 --- a/engines/scumm/saveload.h +++ b/engines/scumm/saveload.h @@ -50,7 +50,7 @@ namespace Scumm { * only saves/loads those which are valid for the version of the savegame * which is being loaded/saved currently. */ -#define CURRENT_VER 77 +#define CURRENT_VER 79 /** * An auxillary macro, used to specify savegame versions. We use this instead diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp index 4d9447bee5..2c3fe09db2 100644 --- a/engines/scumm/script.cpp +++ b/engines/scumm/script.cpp @@ -23,10 +23,9 @@ * */ - - #include "common/config-manager.h" #include "common/util.h" +#include "common/system.h" #include "scumm/actor.h" #include "scumm/object.h" @@ -133,6 +132,8 @@ void ScummEngine::runObjectScript(int object, int entry, bool freezeResistant, b initializeLocals(slot, vars); + // V0 Ensure we don't try and access objects via index inside the script + _v0ObjectIndex = false; runScriptNested(slot); } @@ -786,92 +787,65 @@ void ScummEngine::runInventoryScript(int i) { } void ScummEngine::inventoryScriptIndy3Mac() { - VerbSlot *vs; - int args[24]; - int j, slot; + int slot; - memset(args, 0, sizeof(args)); + // VAR(67) controls the scroll offset of the inventory in Indy3 for Macintosh. + // The inventory consists of two columns with three items visible in each, + // so a maximum of six items are visible at once. - if (VAR(67) < 0) { - VAR(67) = 0; - } - args[5] = getInventoryCount(VAR(VAR_EGO)); - if (args[5] <= 6) { + // The scroll offset must be non-negative and if there are six or less items + // in the inventory, the inventory is fixed in the top position. + const int invCount = getInventoryCount(VAR(VAR_EGO)); + if (VAR(67) < 0 || invCount <= 6) { VAR(67) = 0; } - if (args[5] >= 6) { - args[5] -= 6; - } - args[6] = 0; - if (VAR(67) >= args[5]) { - VAR(67) = args[5]; - args[4] = args[5]; - args[5] /= 2; - args[5] *= 2; - args[4] -= args[5]; - if (args[4]) { + + // If there are more than six items in the inventory, clamp the scroll position + // to be at most invCount-6, rounded up to the next even integer. + bool scrolledToBottom = false; + if (invCount > 6 && VAR(67) >= invCount - 6) { + VAR(67) = invCount - 6; + // Odd number of inventory items? -> increment VAR(67) to make it even + if (invCount & 1) { VAR(67)++; } - args[6]++; - } - args[2] = 1; - for (j = 1; j < 7; j++) { - args[1] = (VAR(67) + args[2]); - args[3] = findInventory(VAR(VAR_EGO),args[1]); - VAR(82 + args[2]) = args[3]; - args[2]++; + scrolledToBottom = true; } - byte tmp[6]; - - tmp[0] = 0xFF; - tmp[1] = 0x06; - tmp[3] = 0x00; - tmp[4] = 0x00; - - for (j = 0; j < 6; j++) { - tmp[2] = 0x53 + j; - - slot = getVerbSlot(101 + j, 0); - vs = &_verbs[slot]; + // Now update var 83 till 89 to contain the inventory IDs of the + // corresponding inventory slots. + // Also setup fake verbs for the inventory + byte tmp[6] = { 0xFF, 0x06, 0x52, 0x00, 0x00, 0x00 }; + for (int j = 1; j < 7; j++) { + int tmpA = (VAR(67) + j); + int tmpB = findInventory(VAR(VAR_EGO), tmpA); + VAR(82 + j) = tmpB; + + // Setup fake verb + tmp[2] = 0x52 + j; + slot = getVerbSlot(100 + j, 0); loadPtrToResource(rtVerb, slot, tmp); + + VerbSlot *vs = &_verbs[slot]; vs->type = kTextVerbType; vs->imgindex = 0; vs->curmode = 1; drawVerb(slot, 0); } - args[5] = getInventoryCount(VAR(VAR_EGO)); - if (args[5] > 6) { - slot = getVerbSlot(107, 0); - if (VAR(67)) { - vs = &_verbs[slot]; - vs->curmode = 1; - } else { - vs = &_verbs[slot]; - vs->curmode = 0; - } - drawVerb(slot, 0); - slot = getVerbSlot(108, 0); - if (!args[6]) { - vs = &_verbs[slot]; - vs->curmode = 1; - } else { - vs = &_verbs[slot]; - vs->curmode = 0; - } - drawVerb(slot, 0); - } else { - slot = getVerbSlot(107, 0); - vs = &_verbs[slot]; - vs->curmode = 0; - drawVerb(slot, 0); - slot = getVerbSlot(108, 0); - vs = &_verbs[slot]; - vs->curmode = 0; - drawVerb(slot, 0); - } + // Enable up arrow if there are more than six items and we are not already + // scrolled all the way up. + slot = getVerbSlot(107, 0); + _verbs[slot].curmode = (invCount > 6 && VAR(67)) ? 1 : 0; + drawVerb(slot, 0); + + // Enable down arrow if there are more than six items and we are not already + // scrolled all the way down. + slot = getVerbSlot(108, 0); + _verbs[slot].curmode = (invCount > 6 && !scrolledToBottom) ? 1 : 0; + drawVerb(slot, 0); + // Redraw! verbMouseOver(0); } @@ -1204,7 +1178,7 @@ void ScummEngine::runInputScript(int clickArea, int val, int mode) { args[4] = VAR(VAR_VIRT_MOUSE_Y); } - // Macintosh verison of indy3ega used different interface, so adjust values. + // Macintosh version of indy3ega used different interface, so adjust values. if (_game.id == GID_INDY3 && _game.platform == Common::kPlatformMacintosh) { if (clickArea == kVerbClickArea && (val >= 101 && val <= 108)) { if (val == 107) { @@ -1216,10 +1190,16 @@ void ScummEngine::runInputScript(int clickArea, int val, int mode) { inventoryScriptIndy3Mac(); return; } else { - args[0] = 3; - args[1] = VAR(83 + (val - 101)); + args[0] = kInventoryClickArea; + args[1] = VAR(82 + (val - 100)); } } + + // Clicks are handled differently in Indy3 mac: param 2 of the + // input script is set to 0 for normal clicks, and to 1 for double clicks. + uint32 time = _system->getMillis(); + args[2] = (time < _lastInputScriptTime + 500); // 500 ms double click delay + _lastInputScriptTime = time; } if (verbScript) diff --git a/engines/scumm/script_v0.cpp b/engines/scumm/script_v0.cpp index 1b8368d636..873f2fa281 100644 --- a/engines/scumm/script_v0.cpp +++ b/engines/scumm/script_v0.cpp @@ -410,41 +410,43 @@ void ScummEngine_v0::decodeParseString() { actorTalk(buffer); } -void ScummEngine_v0::drawSentence() { - Common::Rect sentenceline; +void ScummEngine_v0::drawSentenceWord(int object, bool usePrep, bool objInInventory) { const byte *temp; int sentencePrep = 0; + + // If object not in inventory, we except an index + if (!objInInventory) + _v0ObjectIndex = true; + else + _v0ObjectInInventory = true; - if (!(_userState & 32)) - return; + temp = getObjOrActorName(object); - if (getResourceAddress(rtVerb, _activeVerb)) { - strcpy(_sentenceBuf, (char*)getResourceAddress(rtVerb, _activeVerb)); - } else { - return; + _v0ObjectInInventory = false; + _v0ObjectIndex = false; + + // Append the 'object-name' + if (temp) { + strcat(_sentenceBuf, " "); + strcat(_sentenceBuf, (const char*)temp); } - if (_activeObject > 0) { - temp = getObjOrActorName(_activeObject); - if (temp) { - strcat(_sentenceBuf, " "); - strcat(_sentenceBuf, (const char*)temp); - } + // Append the modifier? (With / On / To / In) + if (!usePrep) + return; - if (_verbs[_activeVerb].prep == 0xFF) { - byte *ptr = getOBCDFromObject(_activeObject); - assert(ptr); - sentencePrep = (*(ptr + 11) >> 5); - } else { - sentencePrep = _verbs[_activeVerb].prep; - } + if (_verbs[_activeVerb].prep == 0xFF) { + _v0ObjectInInventory = objInInventory; + sentencePrep = verbPrep(object); + } else { + sentencePrep = _verbs[_activeVerb].prep; } if (sentencePrep > 0 && sentencePrep <= 4) { // The prepositions, like the fonts, were hard code in the engine. Thus // we have to do that, too, and provde localized versions for all the // languages MM/Zak are available in. - const char *prepositions[][5] = { + static const char *prepositions[][5] = { { " ", " in", " with", " on", " to" }, // English { " ", " mit", " mit", " mit", " zu" }, // German { " ", " dans", " avec", " sur", " <" }, // French @@ -471,13 +473,65 @@ void ScummEngine_v0::drawSentence() { strcat(_sentenceBuf, prepositions[lang][sentencePrep]); } +} + +void ScummEngine_v0::drawSentence() { + Common::Rect sentenceline; + bool inventoryFirst = false; + + if (!(_userState & 32)) + return; + + // Current Verb, Walk/Use + if (getResourceAddress(rtVerb, _activeVerb)) { + strcpy(_sentenceBuf, (char*)getResourceAddress(rtVerb, _activeVerb)); + } else { + return; + } - if (_activeInventory > 0) { - temp = getObjOrActorName(_activeInventory); - if (temp) { - strcat(_sentenceBuf, " "); - strcat(_sentenceBuf, (const char*)temp); + // If using inventory first, draw it first + if (_activeInvExecute && _activeInventory) { + drawSentenceWord(_activeInventory, true, true); + } else { + // Not using inventory, use selected object + if (_activeObject) + drawSentenceWord(_activeObjectIndex, true, false); + else + inventoryFirst = true; + } + + + // Draw the inventory? + if (_activeInventory > 0 && _activeObject2 == 0) { + // Only if inventory isnt first (it will already be drawn by now) + if (!_activeInvExecute) { + drawSentenceWord(_activeInventory, inventoryFirst, true); + } else { + // Draw the active object, which could be inventory based, or room based + if (_activeObject && !_activeObjectIndex) { + drawSentenceWord(_activeObject, inventoryFirst, true); + } else // Room based + drawSentenceWord(_activeObjectIndex, inventoryFirst, false); } + + // Draw the 2nd active object + } else if (_activeObject2) { + + // 2nd Object is in inventory + if (_activeObject2Inv) { + _v0ObjectInInventory = true; + drawSentenceWord(_activeObject2, inventoryFirst, true); + } else { + drawSentenceWord(_activeObject2Index, inventoryFirst, false); + } + } + + // Draw the active actor + if (_activeActor) { + Actor *a = derefActor(_activeActor, ""); + + strcat(_sentenceBuf, " "); + strcat(_sentenceBuf, (const char*)a->getActorName()); } _string[2].charset = 1; @@ -664,9 +718,22 @@ void ScummEngine_v0::o_animateActor() { int act = getVarOrDirectByte(PARAM_1); int anim = getVarOrDirectByte(PARAM_2); int unk = fetchScriptByte(); + debug(0,"o_animateActor: unk %d", unk); - Actor *a = derefActor(act, "o_animateActor"); + ActorC64 *a = (ActorC64*) derefActor(act, "o_animateActor"); + + // 0x6993 + if (anim == 0xFE) { + a->_speaking = 0x80; // Enabled, but not switching + return; + } + // 0x69A3 + if (anim == 0xFD) { + a->_speaking = 0x00; + return; + } + a->animateActor(anim); } @@ -713,9 +780,9 @@ void ScummEngine_v0::o_pickupObject() { if (getObjectIndex(obj) == -1) return; - if (whereIsObject(obj) == WIO_INVENTORY) /* Don't take an */ + if (whereIsObjectInventory(_activeObject2) == WIO_INVENTORY) /* Don't take an */ return; /* object twice */ - + addObjectToInventory(obj, _roomResource); markObjectRectAsDirty(obj); putOwner(obj, VAR(VAR_EGO)); @@ -738,8 +805,13 @@ void ScummEngine_v0::o_setActorBitVar() { byte act = getVarOrDirectByte(PARAM_1); byte mask = getVarOrDirectByte(PARAM_2); byte mod = getVarOrDirectByte(PARAM_3); + + // 0x63ED + if (act >= _numActors) + return; ActorC64 *a = (ActorC64 *)derefActor(act, "o_setActorBitVar"); + if (mod) a->_miscflags |= mask; else @@ -900,10 +972,25 @@ void ScummEngine_v0::o_setOwnerOf() { setOwnerOf(obj, owner); } -void ScummEngine_v0::resetSentence() { - _activeInventory = 0; - _activeObject = 0; +void ScummEngine_v0::resetSentence(bool walking) { _activeVerb = 13; + + if (!walking) { + _activeInventory = 0; + _activeObject = 0; + _activeObject2 = 0; + _activeObjectIndex = 0; + _activeObject2Index = 0; + } + + _verbExecuting = false; + _verbPickup = false; + + _activeActor = 0; + _activeInvExecute = false; + _activeObject2Inv = false; + _activeObjectObtained = false; + _activeObject2Obtained = false; } } // End of namespace Scumm diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index 1ce38fd800..f83e7f2879 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -1138,9 +1138,19 @@ void ScummEngine_v5::o5_ifClassOfIs() { while ((_opcode = fetchScriptByte()) != 0xFF) { cls = getVarOrDirectWord(PARAM_1); - b = getClass(obj, cls); - if (((cls & 0x80) && !b) || (!(cls & 0x80) && b)) - cond = false; + + // WORKAROUND bug #1668393: Due to a script bug, the wrong opcode is used + // to check the state of the inside door (object 465) of the Hostel on Mars, + // when opening the Hostel door from the outside. + if (_game.id == GID_ZAK && _game.platform == Common::kPlatformFMTowns && + vm.slot[_currentScript].number == 205 && _currentRoom == 185 && + obj == 465 && cls == 0) { + cond = (getState(obj) == 0); + } else { + b = getClass(obj, cls); + if (((cls & 0x80) && !b) || (!(cls & 0x80) && b)) + cond = false; + } } jumpRelative(cond); } @@ -1775,7 +1785,7 @@ void ScummEngine_v5::o5_roomOps() { while ((chr = fetchScriptByte())) filename += chr; - if (filename.hasPrefix("iq-") || filename.hasPrefix("IQ-") || filename.hasSuffix("-iq")) { + if (filename.hasPrefix("iq-") || filename.hasPrefix("IQ-") || filename.hasSuffix("-iq") || filename.hasSuffix("-IQ")) { filename = _targetName + ".iq"; } else { error("SO_LOAD_STRING: Unsupported filename %s", filename.c_str()); diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp index dcd60352c7..6df3c0c494 100644 --- a/engines/scumm/script_v6.cpp +++ b/engines/scumm/script_v6.cpp @@ -701,6 +701,14 @@ void ScummEngine_v6::o6_ifNot() { void ScummEngine_v6::o6_jump() { int offset = fetchScriptWordSigned(); + + // WORKAROUND bug #2826144: Talking to the guard at the bigfoot party, after + // he's let you inside, will cause the game to hang, if you end the conversation. + // This is a script bug, due to a missing jump in one segment of the script. + if (_game.id == GID_SAMNMAX && vm.slot[_currentScript].number == 101 && readVar(0x8000 + 97) == 1 && offset == 1) { + offset = -18; + } + _scriptPointer += offset; } diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h index 5bb0e097dc..cb7f906f13 100644 --- a/engines/scumm/scumm-md5.h +++ b/engines/scumm/scumm-md5.h @@ -1,5 +1,5 @@ /* - This file was generated by the md5table tool on Sat Jul 11 01:37:44 2009 + This file was generated by the md5table tool on Thu Jul 30 10:23:41 2009 DO NOT EDIT MANUALLY! */ @@ -17,20 +17,20 @@ static const MD5Table md5table[] = { { "008e76ec3ae58d0add637ea7aa299a2c", "freddi3", "", "", -1, Common::FR_FRA, Common::kPlatformMacintosh }, { "02cae0e7ff8504f73618391873d5781a", "freddi3", "HE 98.5", "", -1, Common::DE_DEU, Common::kPlatformWindows }, { "0305e850382b812fec6e5998ef88a966", "pajama", "", "Demo", -1, Common::NL_NLD, Common::kPlatformWindows }, - { "035deab53b47bc43abc763560d0f8d4b", "atlantis", "", "Demo", -1, Common::EN_ANY, Common::kPlatformPC }, + { "035deab53b47bc43abc763560d0f8d4b", "atlantis", "Floppy", "Demo", -1, Common::EN_ANY, Common::kPlatformPC }, { "037385a953789190298494d92b89b3d0", "catalog", "HE 72", "Demo", -1, Common::EN_ANY, Common::kPlatformWindows }, { "03d3b18ee3fd68114e2a687c871e38d5", "freddi4", "HE 99", "Mini Game", -1, Common::EN_USA, Common::kPlatformWindows }, - { "0425954a9db5c340861672892c3e678d", "samnmax", "CD", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown }, + { "0425954a9db5c340861672892c3e678d", "samnmax", "", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown }, { "04401d747f1a2c1c4b388daff71ed378", "ft", "", "", 535405461, Common::DE_DEU, Common::kPlatformMacintosh }, { "04687cdf7f975a89d2474929f7b80946", "indy3", "FM-TOWNS", "", 7552, Common::EN_ANY, Common::kPlatformFMTowns }, { "0557df19f046a84c2fdc63507c6616cb", "farm", "HE 72", "Demo", -1, Common::NL_NLD, Common::kPlatformWindows }, { "055ffe4f47753e47594ac67823220c54", "puttrace", "HE 99", "", -1, Common::DE_DEU, Common::kPlatformUnknown }, { "057c9b456dedcc4d71b991a3072a20b3", "monkey", "SEGA", "", 9465, Common::JA_JPN, Common::kPlatformSegaCD }, { "0650e8ab1432564607cd651c0fa3f344", "loom", "PC-Engine", "", -1, Common::EN_ANY, Common::kPlatformPCEngine }, - { "06b187468113f9ae5a400b148a847fac", "atlantis", "", "Floppy", 12075, Common::EN_ANY, Common::kPlatformMacintosh }, + { "06b187468113f9ae5a400b148a847fac", "atlantis", "Floppy", "Floppy", 12075, Common::EN_ANY, Common::kPlatformMacintosh }, { "06c3cf4f31daad8b1cd93153491db9e6", "pajama3", "", "", -1, Common::NL_NLD, Common::kPlatformMacintosh }, { "07433205acdca3bc553d0e731588b35f", "airport", "", "", -1, Common::EN_ANY, Common::kPlatformWindows }, - { "07a1eefd8ca95d77310311446c0f53d0", "brstorm", "", "Demo", 5433, Common::EN_ANY, Common::kPlatformUnknown }, + { "07a1eefd8ca95d77310311446c0f53d0", "brstorm", "", "", 5433, Common::EN_ANY, Common::kPlatformUnknown }, { "07b810e37be7489263f7bc7627d4765d", "freddi4", "unenc", "Unencrypted", -1, Common::RU_RUS, Common::kPlatformWindows }, { "084ed0fa98a6d1e9368d67fe9cfbd417", "freddi", "HE 71", "Demo", -1, Common::EN_ANY, Common::kPlatformWindows }, { "0855496dde35356b1a9691e22ba84cdc", "freddi", "HE 73", "Demo", -1, Common::EN_ANY, Common::kPlatformWindows }, @@ -49,14 +49,14 @@ static const MD5Table md5table[] = { { "0c45eb4baff0c12c3d9dfa889c8070ab", "pajama3", "", "Demo", -1, Common::DE_DEU, Common::kPlatformUnknown }, { "0cccfa5223099a60e76cfcca57a1a141", "freddi3", "", "", -1, Common::NL_NLD, Common::kPlatformUnknown }, { "0d1b69471605201ef2fa9cec1f5f02d2", "maniac", "V2", "V2", -1, Common::ES_ESP, Common::kPlatformPC }, - { "0e4c5d54a0ad4b26132e78b5ea76642a", "samnmax", "", "Demo", 6485, Common::EN_ANY, Common::kPlatformPC }, + { "0e4c5d54a0ad4b26132e78b5ea76642a", "samnmax", "Floppy", "Demo", 6485, Common::EN_ANY, Common::kPlatformPC }, { "0e96ab45a4eb72acc1b46813976589fd", "activity", "", "", -1, Common::EN_ANY, Common::kPlatformMacintosh }, { "0e9b01430e31d9fcd94071d433bbc6bf", "loom", "No Adlib", "EGA", -1, Common::FR_FRA, Common::kPlatformAtariST }, { "0f5935bd5e88ba6f09e558d64459746d", "thinker1", "", "Demo", 30919, Common::EN_USA, Common::kPlatformWindows }, - { "0f6f2e716ba896a44e5059bba1de7ca9", "samnmax", "CD", "CD", -1, Common::IT_ITA, Common::kPlatformUnknown }, + { "0f6f2e716ba896a44e5059bba1de7ca9", "samnmax", "", "CD", -1, Common::IT_ITA, Common::kPlatformUnknown }, { "0f9c7a76657f0840b8f7ccb5bffeb9f4", "indy3", "No Adlib", "EGA", -1, Common::FR_FRA, Common::kPlatformAtariST }, { "0f9d3317910ac7a9f449243118884ada", "puttzoo", "", "", 42070, Common::DE_DEU, Common::kPlatformWindows }, - { "0fb73eddfcf584c02ba097984df131ba", "samnmax", "CD", "CD", 9080, Common::DE_DEU, Common::kPlatformUnknown }, + { "0fb73eddfcf584c02ba097984df131ba", "samnmax", "", "CD", 9080, Common::DE_DEU, Common::kPlatformUnknown }, { "1005456bfe351c1b679e1ff2dc2849e9", "puttzoo", "", "", -1, Common::UNK_LANG, Common::kPlatformWindows }, { "100b4c8403ad6a83d4bf7dbf83e44dc4", "spyfox", "", "", -1, Common::FR_FRA, Common::kPlatformWindows }, { "10d8e66cd11049ce64815ebb9fd76eb3", "spyozon", "", "", -1, Common::FR_FRA, Common::kPlatformUnknown }, @@ -72,22 +72,22 @@ static const MD5Table md5table[] = { { "15240c59d3681ed53f714f8d925cb2d6", "maniac", "V2", "V2", -1, Common::ES_ESP, Common::kPlatformAtariST }, { "157367c3c21e0d03a0cba44361b4cf65", "indy3", "No Adlib", "EGA", -1, Common::EN_ANY, Common::kPlatformAtariST }, { "15e03ffbfeddb9c2aebc13dcb2a4a8f4", "monkey", "VGA", "VGA", 8357, Common::EN_ANY, Common::kPlatformPC }, - { "15f588e887e857e8c56fe6ade4956168", "atlantis", "", "Floppy", -1, Common::ES_ESP, Common::kPlatformAmiga }, + { "15f588e887e857e8c56fe6ade4956168", "atlantis", "Floppy", "Floppy", -1, Common::ES_ESP, Common::kPlatformAmiga }, { "16542a7342a918bfe4ba512007d36c47", "FreddisFunShop", "HE 99L", "", -1, Common::EN_USA, Common::kPlatformUnknown }, - { "166553538ff320c69edafeee29525419", "samnmax", "CD", "CD", -1, Common::EN_ANY, Common::kPlatformMacintosh }, + { "166553538ff320c69edafeee29525419", "samnmax", "", "CD", -1, Common::EN_ANY, Common::kPlatformMacintosh }, { "16effd200aa6b8abe9c569c3e578814d", "freddi4", "HE 99", "Demo", -1, Common::NL_NLD, Common::kPlatformWindows }, { "179879b6e35c1ead0d93aab26db0951b", "fbear", "HE 70", "", 13381, Common::EN_ANY, Common::kPlatformWindows }, { "17b5d5e6af4ae89d62631641d66d5a05", "indy3", "VGA", "VGA", -1, Common::IT_ITA, Common::kPlatformPC }, { "17f7296f63c78642724f057fd8e736a7", "maniac", "NES", "extracted", -1, Common::EN_GRB, Common::kPlatformNES }, - { "17fa250eb72dae2dad511ba79c0b6b0a", "tentacle", "CD", "Demo", -1, Common::FR_FRA, Common::kPlatformPC }, - { "182344899c2e2998fca0bebcd82aa81a", "atlantis", "CD", "CD", 12035, Common::EN_ANY, Common::kPlatformPC }, + { "17fa250eb72dae2dad511ba79c0b6b0a", "tentacle", "", "Demo", -1, Common::FR_FRA, Common::kPlatformPC }, + { "182344899c2e2998fca0bebcd82aa81a", "atlantis", "", "CD", 12035, Common::EN_ANY, Common::kPlatformPC }, { "183d7464902d40d00800e8ee1f04117c", "maniac", "V2", "V2", 1988, Common::DE_DEU, Common::kPlatformPC }, { "1875b90fade138c9253a8e967007031a", "indy3", "VGA", "VGA", 6295, Common::EN_ANY, Common::kPlatformPC }, { "187d315f6b5168f68680dfe8c3d76a3e", "loom", "EGA", "EGA", -1, Common::HB_ISR, Common::kPlatformPC }, { "1900e501a52fbf55bde6e4196f6d2aa6", "zak", "V2", "V2", -1, Common::IT_ITA, Common::kPlatformPC }, { "19263586f749a560c1adf8b3393a9593", "socks", "HE 85", "", -1, Common::RU_RUS, Common::kPlatformWindows }, { "19bf6938a94698296bcb0c99c31c91a7", "spyfox2", "", "Demo", -1, Common::EN_GRB, Common::kPlatformWindows }, - { "1a6e5ae2777a6a33f06ffc0226210934", "atlantis", "CD", "CD", -1, Common::EN_ANY, Common::kPlatformMacintosh }, + { "1a6e5ae2777a6a33f06ffc0226210934", "atlantis", "", "CD", -1, Common::EN_ANY, Common::kPlatformMacintosh }, { "1c792d28376d45e145cb916bca0400a2", "spyfox2", "", "Demo", -1, Common::NL_NLD, Common::kPlatformUnknown }, { "1c7e7db2cfab1ad62746ab680a634204", "maniac", "NES", "extracted", -1, Common::FR_FRA, Common::kPlatformNES }, { "1ca86e2cf9aaa2068738a1e5ba477e60", "zak", "FM-TOWNS", "", -1, Common::JA_JPN, Common::kPlatformFMTowns }, @@ -97,12 +97,12 @@ static const MD5Table md5table[] = { { "1dd7aa088e09f96d06818aa9a9deabe0", "indy3", "No Adlib", "EGA", 5361, Common::EN_ANY, Common::kPlatformMacintosh }, { "1ed22f601f8b3695804a6583cc3083f1", "puttrace", "HE 98.5", "", -1, Common::NL_NLD, Common::kPlatformUnknown }, { "1f2e62b5a9c50589fc342285a6bb3a27", "freddi", "HE 73", "", -1, Common::HB_ISR, Common::kPlatformWindows }, - { "1fbebd7b2b692df5297870447a80cfed", "atlantis", "", "Floppy", 12030, Common::DE_DEU, Common::kPlatformPC }, + { "1fbebd7b2b692df5297870447a80cfed", "atlantis", "Floppy", "Floppy", 12030, Common::DE_DEU, Common::kPlatformPC }, { "1ff5997c78fbd0a841a75ef15a05d9d5", "BluesBirthday", "", "Red", -1, Common::EN_ANY, Common::kPlatformWindows }, { "2012f854d83d9cc6f73b2b544cd8bbf8", "water", "HE 80", "", -1, Common::RU_RUS, Common::kPlatformWindows }, { "20176076d708bf14407bcc9bdcd7a418", "pajama3", "", "", -1, Common::RU_RUS, Common::kPlatformWindows }, { "204453e33456c4faa26e276229fe5b76", "spyfox2", "", "Demo", 14689, Common::DE_DEU, Common::kPlatformWindows }, - { "20da6fce37805423966aaa8f3c2426aa", "atlantis", "", "Floppy", -1, Common::FR_FRA, Common::kPlatformAmiga }, + { "20da6fce37805423966aaa8f3c2426aa", "atlantis", "Floppy", "Floppy", -1, Common::FR_FRA, Common::kPlatformAmiga }, { "2108d83dcf09f8adb4bc524669c8cf51", "PuttTime", "HE 99", "Updated", -1, Common::EN_USA, Common::kPlatformUnknown }, { "21a6592322f92550f144f68a8a4e685e", "dig", "", "", -1, Common::FR_FRA, Common::kPlatformMacintosh }, { "21abe302e1b1e2b66d6f5c12e241ebfd", "freddicove", "unenc", "Unencrypted", -1, Common::RU_RUS, Common::kPlatformWindows }, @@ -114,14 +114,14 @@ static const MD5Table md5table[] = { { "22f4ea88a09da12df9308ba30bcb7d0f", "loom", "EGA", "EGA", -1, Common::EN_ANY, Common::kPlatformPC }, { "23394c8d29cc63c61313959431a12476", "spyfox", "HE 100", "Updated", -1, Common::EN_ANY, Common::kPlatformWindows }, { "257f8c14d8c584f7ddd601bcb00920c7", "maniac", "NES", "", 262144, Common::DE_DEU, Common::kPlatformNES }, - { "2723fea3dae0cb47768c424b145ae0e7", "tentacle", "", "Floppy", 7932, Common::EN_ANY, Common::kPlatformPC }, + { "2723fea3dae0cb47768c424b145ae0e7", "tentacle", "Floppy", "Floppy", 7932, Common::EN_ANY, Common::kPlatformPC }, { "27b2ef1653089fe5b897d9cc89ce784f", "balloon", "HE 80", "", -1, Common::RU_RUS, Common::kPlatformWindows }, { "27b3a4224ad63d5b04627595c1c1a025", "zak", "V2", "V2", -1, Common::IT_ITA, Common::kPlatformAmiga }, - { "28d24a33448fab6795850bc9f159a4a2", "atlantis", "CD", "Demo", 11170, Common::JA_JPN, Common::kPlatformFMTowns }, + { "28d24a33448fab6795850bc9f159a4a2", "atlantis", "", "Demo", 11170, Common::JA_JPN, Common::kPlatformFMTowns }, { "28ef68ee3ed76d7e2ee8ee13c15fbd5b", "loom", "EGA", "EGA", 5748, Common::EN_ANY, Common::kPlatformPC }, { "28f07458f1b6c24e118a1ea056827701", "lost", "HE 99", "", -1, Common::NL_NLD, Common::kPlatformUnknown }, { "2a208ffbcd0e83e86f4356e6f64aa6e1", "loom", "EGA", "EGA", -1, Common::ES_ESP, Common::kPlatformPC }, - { "2a41b53cf1a90b6e6f26c10cc6041084", "tentacle", "CD", "Demo", 2439158, Common::EN_ANY, Common::kPlatformMacintosh }, + { "2a41b53cf1a90b6e6f26c10cc6041084", "tentacle", "", "Demo", 2439158, Common::EN_ANY, Common::kPlatformMacintosh }, { "2a446817ffcabfef8716e0c456ecaf81", "puttzoo", "", "Demo", -1, Common::DE_DEU, Common::kPlatformWindows }, { "2a8658dbd13d84d1bce64a71a35995eb", "pajama2", "HE 99", "Demo", -1, Common::HB_ISR, Common::kPlatformWindows }, { "2c04aacffb8428f30ccf4f734fbe3adc", "activity", "", "", -1, Common::EN_ANY, Common::kPlatformPC }, @@ -130,7 +130,7 @@ static const MD5Table md5table[] = { { "2d388339d6050d8ccaa757b64633954e", "zak", "FM-TOWNS", "Demo", 7520, Common::EN_ANY, Common::kPlatformFMTowns }, { "2d4536a56e01da4b02eb021e7770afa2", "zak", "FM-TOWNS", "", 7520, Common::EN_ANY, Common::kPlatformFMTowns }, { "2d4acbdcfd8e374c9da8c2e7303a5cd0", "BluesBirthday", "", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown }, - { "2d9d46f23cb07bbc90b8ad464d3e4ff8", "atlantis", "CD", "CD", -1, Common::EN_ANY, Common::kPlatformMacintosh }, + { "2d9d46f23cb07bbc90b8ad464d3e4ff8", "atlantis", "", "CD", -1, Common::EN_ANY, Common::kPlatformMacintosh }, { "2e85f7aa054930c692a5b1bed1dfc295", "football2002", "", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown }, { "2e8a1f76ea33bc5e04347646feee173d", "pajama3", "", "", -1, Common::DE_DEU, Common::kPlatformUnknown }, { "2fe369ad70f52a8cf7ad6077ee64f81a", "loom", "EGA", "EGA", -1, Common::DE_DEU, Common::kPlatformAmiga }, @@ -157,18 +157,18 @@ static const MD5Table md5table[] = { { "3824e60cdf639d22f6df92a03dc4b131", "fbear", "HE 61", "", 7732, Common::EN_ANY, Common::kPlatformPC }, { "387a544b8b10b26912d8413bab63a853", "monkey2", "", "Demo", -1, Common::EN_ANY, Common::kPlatformPC }, { "3905799e081b80a61d4460b7b733c206", "maniac", "NES", "", 262144, Common::EN_USA, Common::kPlatformNES }, - { "3938ee1aa4433fca9d9308c9891172b1", "zak", "FM-TOWNS", "Demo", -1, Common::EN_ANY, Common::kPlatformFMTowns }, + { "3938ee1aa4433fca9d9308c9891172b1", "zak", "FM-TOWNS", "Demo", 7520, Common::EN_ANY, Common::kPlatformFMTowns }, { "399b217b0c8d65d0398076da486363a9", "indy3", "VGA", "VGA", 6295, Common::DE_DEU, Common::kPlatformPC }, { "39cb9dec16fa16f38d79acd80effb059", "loom", "EGA", "EGA", -1, Common::FR_FRA, Common::kPlatformAmiga }, { "39cb9dec16fa16f38d79acd80effb059", "loom", "EGA", "EGA", -1, Common::IT_ITA, Common::kPlatformAmiga }, { "39fd6db10d0222d817025c4d3346e3b4", "farm", "", "Demo", -1, Common::EN_ANY, Common::kPlatformMacintosh }, - { "3a03dab514e4038df192d8a8de469788", "atlantis", "", "Floppy", -1, Common::EN_ANY, Common::kPlatformAmiga }, + { "3a03dab514e4038df192d8a8de469788", "atlantis", "Floppy", "Floppy", -1, Common::EN_ANY, Common::kPlatformAmiga }, { "3a0c35f3c147b98a2bdf8d400cfc4ab5", "indy3", "FM-TOWNS", "", -1, Common::JA_JPN, Common::kPlatformFMTowns }, { "3a3e592b074f595489f7f11e150c398d", "puttzoo", "HE 99", "Updated", -1, Common::EN_USA, Common::kPlatformWindows }, - { "3a5d13675e9a23aedac0bac7730f0ac1", "samnmax", "CD", "CD", -1, Common::FR_FRA, Common::kPlatformMacintosh }, + { "3a5d13675e9a23aedac0bac7730f0ac1", "samnmax", "", "CD", -1, Common::FR_FRA, Common::kPlatformMacintosh }, { "3a5ec90d556d4920976c5578bfbfaf79", "maniac", "NES", "extracted", -1, Common::DE_DEU, Common::kPlatformNES }, { "3af61c5edf8e15b43dbafd285b2e9777", "puttcircus", "", "Demo", -1, Common::HB_ISR, Common::kPlatformWindows }, - { "3b301b7892f883ce42ab4be6a274fea6", "samnmax", "", "Floppy", -1, Common::EN_ANY, Common::kPlatformPC }, + { "3b301b7892f883ce42ab4be6a274fea6", "samnmax", "Floppy", "Floppy", -1, Common::EN_ANY, Common::kPlatformPC }, { "3b832f4a90740bf22e9b8ed42ca0128c", "freddi4", "HE 99", "", -1, Common::EN_GRB, Common::kPlatformWindows }, { "3cce1913a3bc586b51a75c3892ff18dd", "indy3", "VGA", "VGA", -1, Common::RU_RUS, Common::kPlatformPC }, { "3d219e7546039543307b55a91282bf18", "funpack", "", "", -1, Common::EN_ANY, Common::kPlatformPC }, @@ -176,7 +176,7 @@ static const MD5Table md5table[] = { { "3df6ead57930488bc61e6e41901d0e97", "fbear", "HE 61", "", -1, Common::EN_ANY, Common::kPlatformMacintosh }, { "3e48298920fab9b7aec5a971e1bd1fab", "pajama3", "", "Demo", -1, Common::EN_GRB, Common::kPlatformWindows }, { "40564ec47da48a67787d1f9bd043902a", "maniac", "V2 Demo", "V2 Demo", 1988, Common::EN_ANY, Common::kPlatformPC }, - { "4167a92a1d46baa4f4127d918d561f88", "tentacle", "CD", "CD", 7932, Common::EN_ANY, Common::kPlatformUnknown }, + { "4167a92a1d46baa4f4127d918d561f88", "tentacle", "", "CD", 7932, Common::EN_ANY, Common::kPlatformUnknown }, { "41958e24d03181ff9a381a66d048a581", "ft", "", "", -1, Common::PT_BRA, Common::kPlatformUnknown }, { "425205754fa749f4f0b0dd9d09fa45fd", "football", "", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown }, { "430bc518017b6fac046f58bab6baad5d", "monkey2", "", "", -1, Common::JA_JPN, Common::kPlatformFMTowns }, @@ -195,13 +195,13 @@ static const MD5Table md5table[] = { { "4aa93cb30e485b728504ba3a693f12bf", "pajama", "HE 100", "", -1, Common::RU_RUS, Common::kPlatformWindows }, { "4af4a6b248103c1fe9edef619677f540", "puttmoon", "", "Demo", -1, Common::EN_ANY, Common::kPlatformMacintosh }, { "4ba37f835be11a59d969f90f272f575b", "water", "HE 80", "", -1, Common::EN_USA, Common::kPlatformUnknown }, - { "4ba7fb331296c283e73d8f5b2096e551", "samnmax", "CD", "CD", -1, Common::ES_ESP, Common::kPlatformUnknown }, + { "4ba7fb331296c283e73d8f5b2096e551", "samnmax", "", "CD", -1, Common::ES_ESP, Common::kPlatformUnknown }, { "4bedb49943df95a9c900a5a82ccbe9de", "ft", "", "", -1, Common::FR_FRA, Common::kPlatformUnknown }, { "4bfa4a43684bcb437f7fb47f457a0aa5", "socks", "HE 99", "", -1, Common::NL_NLD, Common::kPlatformUnknown }, { "4c4820518e16e1a0e3616a3b021a04f3", "catalog", "HE CUP", "Preview", 10927456, Common::DE_DEU, Common::kPlatformUnknown }, { "4cb9c3618f71668f8e4346c8f323fa82", "monkey2", "", "", 10700, Common::EN_ANY, Common::kPlatformMacintosh }, { "4ce2d5b355964bbcb5e5ce73236ef868", "freddicove", "HE 100", "", -1, Common::RU_RUS, Common::kPlatformWindows }, - { "4d34042713958b971cb139fba4658586", "atlantis", "CD", "", -1, Common::JA_JPN, Common::kPlatformFMTowns }, + { "4d34042713958b971cb139fba4658586", "atlantis", "", "", -1, Common::JA_JPN, Common::kPlatformFMTowns }, { "4dbff3787aedcd96b0b325f2d92d7ad9", "maze", "HE 100", "Updated", -1, Common::EN_USA, Common::kPlatformUnknown }, { "4dc780f1bc587a193ce8a97652791438", "loom", "EGA", "EGA", -1, Common::EN_ANY, Common::kPlatformAmiga }, { "4e5867848ee61bc30d157e2c94eee9b4", "PuttTime", "HE 90", "Demo", 18394, Common::EN_USA, Common::kPlatformUnknown }, @@ -209,15 +209,15 @@ static const MD5Table md5table[] = { { "4f04b321a95d4315ce6d65f8e1dd0368", "maze", "HE 80", "", -1, Common::EN_USA, Common::kPlatformUnknown }, { "4f138ac6f9b2ac5a41bc68b2c3296064", "freddi4", "HE 99", "", -1, Common::FR_FRA, Common::kPlatformWindows }, { "4f1d6f8b38343dba405472538b5037ed", "fbear", "HE 61", "", 7717, Common::EN_ANY, Common::kPlatformPC }, - { "4f267a901719623de7dde83e47d5b474", "atlantis", "", "Floppy", -1, Common::DE_DEU, Common::kPlatformAmiga }, + { "4f267a901719623de7dde83e47d5b474", "atlantis", "Floppy", "Floppy", -1, Common::DE_DEU, Common::kPlatformAmiga }, { "4f580a021eee026f3b4589e17d130d78", "freddi4", "", "", -1, Common::UNK_LANG, Common::kPlatformUnknown }, { "4fa6870d9bc8c313b65d54b1da5a1891", "pajama", "", "", -1, Common::NL_NLD, Common::kPlatformWindows }, - { "4fbbe9f64b8bc547503a379a301183ce", "tentacle", "CD", "CD", -1, Common::IT_ITA, Common::kPlatformUnknown }, + { "4fbbe9f64b8bc547503a379a301183ce", "tentacle", "", "CD", -1, Common::IT_ITA, Common::kPlatformUnknown }, { "4fe6a2e8df3c4536b278fdd2fbcb181e", "pajama3", "", "Mini Game", -1, Common::EN_ANY, Common::kPlatformWindows }, { "5057fb0e99e5aa29df1836329232f101", "freddi2", "HE 80", "", -1, Common::UNK_LANG, Common::kPlatformWindows }, { "507bb360688dc4180fdf0d7597352a69", "freddi", "HE 73", "", 26402, Common::SE_SWE, Common::kPlatformWindows }, { "50b831f11b8c4b83784cf81f4dcc69ea", "spyfox", "HE 100", "", -1, Common::EN_ANY, Common::kPlatformWii }, - { "50fcdc982a25063b78ad46bf389b8e8d", "tentacle", "", "Floppy", -1, Common::IT_ITA, Common::kPlatformPC }, + { "50fcdc982a25063b78ad46bf389b8e8d", "tentacle", "Floppy", "Floppy", -1, Common::IT_ITA, Common::kPlatformPC }, { "51305e929e330e24a75a0351c8f9975e", "freddi2", "HE 99", "Updated", -1, Common::EN_USA, Common::kPlatformUnknown }, { "513f91a9dbe8d5490b39e56a3ac5bbdf", "pajama2", "HE 98.5", "", -1, Common::NL_NLD, Common::kPlatformMacintosh }, { "5262a27afcaee04e5c4900220bd463e7", "PuttsFunShop", "", "", -1, Common::EN_USA, Common::kPlatformUnknown }, @@ -229,10 +229,10 @@ static const MD5Table md5table[] = { { "55e4cc866ff9046824e1c638ba2b8c7f", "ft", "", "", -1, Common::RU_RUS, Common::kPlatformUnknown }, { "566165a7338fa11029e7c14d94fa70d0", "freddi", "HE 73", "Demo", 9800, Common::EN_ANY, Common::kPlatformWindows }, { "5719fc8a13b4638b78d9d8d12f091f94", "puttrace", "HE 99", "", -1, Common::FR_FRA, Common::kPlatformWindows }, - { "5798972220cd458be2626d54c80f71d7", "atlantis", "", "Floppy", -1, Common::IT_ITA, Common::kPlatformAmiga }, + { "5798972220cd458be2626d54c80f71d7", "atlantis", "Floppy", "Floppy", -1, Common::IT_ITA, Common::kPlatformAmiga }, { "57a17febe2183f521250e55d55b83e60", "PuttTime", "HE 99", "", -1, Common::FR_FRA, Common::kPlatformWindows }, { "57a5cfec9ef231a007043cc1917e8988", "freddi", "HE 100", "", -1, Common::EN_ANY, Common::kPlatformWii }, - { "57b0d89af79befe1cabce3bece869e7f", "tentacle", "", "Floppy", -1, Common::DE_DEU, Common::kPlatformPC }, + { "57b0d89af79befe1cabce3bece869e7f", "tentacle", "Floppy", "Floppy", -1, Common::DE_DEU, Common::kPlatformPC }, { "58436e634f4fae1d9973591c2ffa1fcb", "spyfox", "HE 99", "Updated", -1, Common::EN_ANY, Common::kPlatformUnknown }, { "589601b676c98b1c0c987bc031ab68b3", "chase", "HE 95", "", -1, Common::EN_USA, Common::kPlatformUnknown }, { "58fdf4c7ad13540a734e18f8584cad89", "puttzoo", "", "", -1, Common::EN_ANY, Common::kPlatformMacintosh }, @@ -289,9 +289,9 @@ static const MD5Table md5table[] = { { "6bf70eee5de3d24d2403e0dd3d267e8a", "spyfox", "", "", 49221, Common::UNK_LANG, Common::kPlatformWindows }, { "6c2bff0e327f2962e809c2e1a82d7309", "monkey", "VGA", "VGA", -1, Common::EN_ANY, Common::kPlatformAmiga }, { "6d1baa1065ac5f7b210be8ebe4235e49", "freddi", "HE 73", "", -1, Common::NL_NLD, Common::kPlatformMacintosh }, - { "6dead580b0ff14d5f7b33b4219f04159", "samnmax", "CD", "Demo", 16556335, Common::EN_ANY, Common::kPlatformMacintosh }, + { "6dead580b0ff14d5f7b33b4219f04159", "samnmax", "", "Demo", 16556335, Common::EN_ANY, Common::kPlatformMacintosh }, { "6df20c50c1ab19799de9be7ae7716881", "fbear", "HE 61", "Demo", -1, Common::EN_ANY, Common::kPlatformMacintosh }, - { "6e959d65358eedf9b68b81e304b97fa4", "tentacle", "CD", "CD", 7932, Common::DE_DEU, Common::kPlatformUnknown }, + { "6e959d65358eedf9b68b81e304b97fa4", "tentacle", "", "CD", 7932, Common::DE_DEU, Common::kPlatformUnknown }, { "6ea966b4d660c870b9ee790d1fbfc535", "monkey2", "", "", -1, Common::ES_ESP, Common::kPlatformAmiga }, { "6f0be328c64d689bb606d22a389e1b0f", "loom", "No Adlib", "EGA", 5748, Common::EN_ANY, Common::kPlatformMacintosh }, { "6f6ef668c608c7f534fea6e6d3878dde", "indy3", "EGA", "EGA", -1, Common::DE_DEU, Common::kPlatformPC }, @@ -332,7 +332,7 @@ static const MD5Table md5table[] = { { "7ddeaf52c8b9a50551ce0aa2ac811d07", "BluesABCTime", "", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown }, { "7e151c17adf624f1966c8fc5827c95e9", "puttputt", "HE 61", "", -1, Common::EN_ANY, Common::kPlatform3DO }, { "7ea2da67ebabea4ac20cee9f4f9d2934", "airport", "", "Demo", -1, Common::EN_ANY, Common::kPlatformMacintosh }, - { "7edd665bbede7ea8b7233f8e650be6f8", "samnmax", "CD", "CD", -1, Common::FR_FRA, Common::kPlatformUnknown }, + { "7edd665bbede7ea8b7233f8e650be6f8", "samnmax", "", "CD", -1, Common::FR_FRA, Common::kPlatformUnknown }, { "7f45ddd6dbfbf8f80c0c0efea4c295bc", "maniac", "V1", "V1", 1972, Common::EN_ANY, Common::kPlatformPC }, { "7f945525abcd48015adf1632637a44a1", "pajama", "", "Demo", -1, Common::FR_FRA, Common::kPlatformUnknown }, { "7fc6cdb46b4c9d384c52327f4bca6416", "football", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown }, @@ -354,12 +354,12 @@ static const MD5Table md5table[] = { { "87df3e0074624040407764b7c5e710b9", "pajama", "", "Demo", 18354, Common::NL_NLD, Common::kPlatformWindows }, { "87f6e8037b7cc996e13474b491a7a98e", "maniac", "V2", "V2", -1, Common::IT_ITA, Common::kPlatformPC }, { "8801fb4a1200b347f7a38523339526dd", "jungle", "", "", -1, Common::EN_ANY, Common::kPlatformWindows }, - { "883af4b0af4f77a92f1dcf1d0a283140", "tentacle", "CD", "CD", -1, Common::ES_ESP, Common::kPlatformUnknown }, + { "883af4b0af4f77a92f1dcf1d0a283140", "tentacle", "", "CD", -1, Common::ES_ESP, Common::kPlatformUnknown }, { "898ce8eb1234a955ef75e87141902bb3", "freddi3", "", "", -1, Common::RU_RUS, Common::kPlatformWindows }, { "898eaa21f79cf8d4f08db856244689ff", "pajama", "HE 99", "Updated", 66505, Common::EN_ANY, Common::kPlatformWindows }, { "89cfc425566003ff74b7dc7b3e6fd469", "indy3", "EGA", "EGA", -1, Common::FR_FRA, Common::kPlatformPC }, { "8a484262363a8e18be87112454f1456b", "pjgames", "", "", -1, Common::EN_USA, Common::kPlatformUnknown }, - { "8aa05d3cdb0e795436043f0546af2da2", "tentacle", "CD", "CD?", -1, Common::FR_FRA, Common::kPlatformUnknown }, + { "8aa05d3cdb0e795436043f0546af2da2", "tentacle", "", "CD?", -1, Common::FR_FRA, Common::kPlatformUnknown }, { "8aed489aba45d2b9fb8a04079c9c6e6a", "baseball", "HE CUP", "Preview", 12876596, Common::UNK_LANG, Common::kPlatformUnknown }, { "8afb3cf9f95abf208358e984f0c9e738", "funpack", "", "", -1, Common::EN_ANY, Common::kPlatform3DO }, { "8bdb0bf87b5e303dd35693afb9351215", "ft", "", "", -1, Common::DE_DEU, Common::kPlatformUnknown }, @@ -367,11 +367,11 @@ static const MD5Table md5table[] = { { "8de13897f0121c79d29a2377159f9ad0", "socks", "HE 99", "Updated", -1, Common::EN_ANY, Common::kPlatformWindows }, { "8e3241ddd6c8dadf64305e8740d45e13", "balloon", "HE 100", "Updated", -1, Common::EN_ANY, Common::kPlatformUnknown }, { "8e4ee4db46954bfe2912e259a16fad82", "monkey2", "", "", -1, Common::FR_FRA, Common::kPlatformPC }, - { "8e9417564f33790815445b2136efa667", "atlantis", "CD", "CD", 11915, Common::JA_JPN, Common::kPlatformMacintosh }, + { "8e9417564f33790815445b2136efa667", "atlantis", "", "CD", 11915, Common::JA_JPN, Common::kPlatformMacintosh }, { "8e9830a6f2702be5b22c8fa0a6aaf977", "freddi2", "HE 80", "", -1, Common::NL_NLD, Common::kPlatformMacintosh }, { "8eb84cee9b429314c7f0bdcf560723eb", "monkey", "FM-TOWNS", "", -1, Common::EN_ANY, Common::kPlatformFMTowns }, { "8ee63cafb1fe9d62aa0d5a23117e70e7", "freddi2", "HE 100", "Updated", -1, Common::EN_USA, Common::kPlatformUnknown }, - { "8f3758ff98c9c5d78e5d635222cad026", "atlantis", "", "Floppy", -1, Common::IT_ITA, Common::kPlatformPC }, + { "8f3758ff98c9c5d78e5d635222cad026", "atlantis", "Floppy", "Floppy", -1, Common::IT_ITA, Common::kPlatformPC }, { "8fec68383202d38c0d25e9e3b757c5df", "comi", "Demo", "Demo", 18041, Common::UNK_LANG, Common::kPlatformWindows }, { "8ffd618a776a4c0d8922bb28b09f8ce8", "airport", "", "Demo", -1, Common::EN_ANY, Common::kPlatformWindows }, { "90a329d8ad5b7ce0690429e98cfbb32f", "funpack", "", "", -1, Common::HB_ISR, Common::kPlatformPC }, @@ -381,10 +381,10 @@ static const MD5Table md5table[] = { { "91469353f7be1b122fa88d23480a1320", "zak", "V2", "V2", -1, Common::FR_FRA, Common::kPlatformAmiga }, { "91d5db93187fab54d823f73bd6441cb6", "maniac", "NES", "extracted", -1, Common::EN_USA, Common::kPlatformNES }, { "927a764615c7fcdd72f591355e089d8c", "monkey", "No Adlib", "EGA", -1, Common::DE_DEU, Common::kPlatformAtariST }, - { "92b078d9d6d9d751da9c26b8b3075779", "tentacle", "", "Floppy", -1, Common::FR_FRA, Common::kPlatformPC }, + { "92b078d9d6d9d751da9c26b8b3075779", "tentacle", "Floppy", "Floppy", -1, Common::FR_FRA, Common::kPlatformPC }, { "92e7727e67f5cd979d8a1070e4eb8cb3", "puttzoo", "HE 98.5", "Updated", -1, Common::EN_ANY, Common::kPlatformUnknown }, { "92fc0073a4cf259ff36070ecb8628ba8", "thinkerk", "", "", -1, Common::EN_USA, Common::kPlatformUnknown }, - { "94aaedbb8f26d71ed3ad6dd34490e29e", "tentacle", "", "Floppy", -1, Common::FR_FRA, Common::kPlatformPC }, + { "94aaedbb8f26d71ed3ad6dd34490e29e", "tentacle", "Floppy", "Floppy", -1, Common::FR_FRA, Common::kPlatformPC }, { "94db6519da85b8d08c976d8e9a858ea7", "baseball", "HE CUP", "Preview", 10044774, Common::UNK_LANG, Common::kPlatformUnknown }, { "95818b178d473c989ac753574e8892aa", "readtime", "", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown }, { "95b3806e043be08668c54c3ffe98650f", "BluesABCTime", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown }, @@ -392,13 +392,13 @@ static const MD5Table md5table[] = { { "9708cf716ed8bcc9ff3fcfc69413b746", "puttputt", "HE 61", "", -1, Common::EN_ANY, Common::kPlatformPC }, { "9781422e4288dbc090720e4563168ba7", "puttzoo", "", "", -1, Common::FR_FRA, Common::kPlatformWindows }, { "981e1e1891f2be7e25a01f50ae55a5af", "puttrace", "HE 98", "", -1, Common::EN_USA, Common::kPlatformUnknown }, - { "98744fe66ff730e8c2b3b1f58803ab0b", "atlantis", "", "Demo", -1, Common::EN_ANY, Common::kPlatformPC }, + { "98744fe66ff730e8c2b3b1f58803ab0b", "atlantis", "Floppy", "Demo", -1, Common::EN_ANY, Common::kPlatformPC }, { "99128b6a5bdd9831d9682fb8b5cbf8d4", "BluesBirthday", "", "Yellow", -1, Common::EN_ANY, Common::kPlatformUnknown }, { "99a3699f80b8f776efae592b44b9b991", "maniac", "V2", "V2", -1, Common::FR_FRA, Common::kPlatformPC }, - { "99b6f822b0b2612415407865438697d6", "atlantis", "CD", "Demo", -1, Common::EN_ANY, Common::kPlatformPC }, + { "99b6f822b0b2612415407865438697d6", "atlantis", "", "Demo", -1, Common::EN_ANY, Common::kPlatformPC }, { "9b7452b5cd6d3ffb2b2f5118010af84f", "ft", "Demo", "Demo", 116463537, Common::EN_ANY, Common::kPlatformMacintosh }, { "9bc548e179cdb0767009401c094d0895", "maniac", "V2", "V2", -1, Common::DE_DEU, Common::kPlatformAmiga }, - { "9bd2a8f72613e715c199246dd511e10f", "atlantis", "", "Floppy", -1, Common::ES_ESP, Common::kPlatformPC }, + { "9bd2a8f72613e715c199246dd511e10f", "atlantis", "Floppy", "Floppy", -1, Common::ES_ESP, Common::kPlatformPC }, { "9bda5fee51d2fda5253d02c642016bf4", "spyfox", "HE 98.5", "", -1, Common::NL_NLD, Common::kPlatformUnknown }, { "9c0ee9c252785e9fca0143e42ac4b256", "freddi2", "HE 99", "Updated", -1, Common::DE_DEU, Common::kPlatformWindows }, { "9c0fee288ad564a7d25ec3e841810d79", "indy3", "EGA", "EGA", -1, Common::EN_ANY, Common::kPlatformAmiga }, @@ -420,7 +420,7 @@ static const MD5Table md5table[] = { { "a2386da005672cbd5136f4f27a626c5f", "farm", "", "", 87061, Common::NL_NLD, Common::kPlatformWindows }, { "a28135a7ade38cc0208b04507c46efd1", "spyfox", "HE 99", "", -1, Common::DE_DEU, Common::kPlatformUnknown }, { "a2bb6aa0537402c1b3c2ea899ccef64b", "lost", "HE 99", "Demo", 15540, Common::EN_ANY, Common::kPlatformWindows }, - { "a3036878840720fbefa41e6965fa4a0a", "samnmax", "", "Floppy", -1, Common::EN_ANY, Common::kPlatformPC }, + { "a3036878840720fbefa41e6965fa4a0a", "samnmax", "Floppy", "Floppy", -1, Common::EN_ANY, Common::kPlatformPC }, { "a336134914eaab4892d35625aa15ad1d", "freddi4", "HE 99", "", -1, Common::RU_RUS, Common::kPlatformWindows }, { "a525c1753c1db5011c00417da37887ef", "PuttTime", "HE 100", "Updated", -1, Common::EN_USA, Common::kPlatformUnknown }, { "a561d2e2413cc1c71d5a1bf87bf493ea", "lost", "HE 100", "Updated", -1, Common::EN_USA, Common::kPlatformUnknown }, @@ -441,16 +441,16 @@ static const MD5Table md5table[] = { { "aaa587701cde7e74692c68c1024b85eb", "puttrace", "HE 99", "Demo", -1, Common::NL_NLD, Common::kPlatformUnknown }, { "aaa7f36a253f277dd29dd1c051b0e4b9", "indy3", "No Adlib", "EGA", -1, Common::DE_DEU, Common::kPlatformAtariST }, { "ab0693e9324cfcf498fdcbb12acf8bb4", "puttcircus", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown }, - { "ac1642b6edfb8521ca03760126f1c250", "tentacle", "CD", "Demo", -1, Common::DE_DEU, Common::kPlatformPC }, + { "ac1642b6edfb8521ca03760126f1c250", "tentacle", "", "Demo", -1, Common::DE_DEU, Common::kPlatformPC }, { "ac62d50e39492ee3738b4e83a5ac780f", "freddi2", "HE 80", "", -1, Common::NL_NLD, Common::kPlatformWindows }, - { "acad97ab1c6fc2a5b2d98abf6db4a190", "tentacle", "", "Floppy", -1, Common::EN_ANY, Common::kPlatformUnknown }, - { "ae94f110a14ce71fc515d5b648827a8f", "tentacle", "", "Floppy", -1, Common::ES_ESP, Common::kPlatformPC }, + { "acad97ab1c6fc2a5b2d98abf6db4a190", "tentacle", "Floppy", "Floppy", -1, Common::EN_ANY, Common::kPlatformUnknown }, + { "ae94f110a14ce71fc515d5b648827a8f", "tentacle", "Floppy", "Floppy", -1, Common::ES_ESP, Common::kPlatformPC }, { "aefa244ea034b7cd2041f0a44be7d9ba", "pajama3", "", "", -1, Common::EN_ANY, Common::kPlatformMacintosh }, { "af2bd1a43b50b55915d87994e093203d", "freddi", "HE 99", "Updated", 34829, Common::DE_DEU, Common::kPlatformWindows }, { "b100abf7ff83146df50db78dbd5e9cfa", "freddicove", "HE 100", "", -1, Common::FR_FRA, Common::kPlatformUnknown }, { "b23f7cd7c304d7dff08e92a96120d5b4", "zak", "V1", "V1", -1, Common::EN_ANY, Common::kPlatformPC }, { "b250d0f9cc83f80ced56fe11a4fb057c", "maniac", "V2", "V2", 1988, Common::EN_ANY, Common::kPlatformPC }, - { "b289a2a8cbedbf45786e0b4ad2f510f1", "samnmax", "", "Floppy", -1, Common::IT_ITA, Common::kPlatformPC }, + { "b289a2a8cbedbf45786e0b4ad2f510f1", "samnmax", "Floppy", "Floppy", -1, Common::IT_ITA, Common::kPlatformPC }, { "b47be81e39a9710f6f595f7b527b60f8", "puttrace", "HE 99", "", -1, Common::EN_GRB, Common::kPlatformWindows }, { "b5298a5c15ffbe8b381d51ea4e26d35c", "freddi4", "HE 99", "", -1, Common::DE_DEU, Common::kPlatformUnknown }, { "b597e0403cc0002f69170e6caba7edd9", "indy3", "EGA", "EGA Demo", 5361, Common::EN_ANY, Common::kPlatformPC }, @@ -479,7 +479,7 @@ static const MD5Table md5table[] = { { "c24c490373aeb48fbd54caa8e7ae376d", "loom", "No Adlib", "EGA", -1, Common::DE_DEU, Common::kPlatformAtariST }, { "c25755b08a8d0d47695e05f1e2111bfc", "freddi4", "", "Demo", -1, Common::EN_USA, Common::kPlatformUnknown }, { "c30ef068add4277104243c31ce46c12b", "monkey2", "", "", -1, Common::FR_FRA, Common::kPlatformAmiga }, - { "c3196c5349e53e387aaff1533d95e53a", "samnmax", "", "Demo", -1, Common::EN_ANY, Common::kPlatformPC }, + { "c3196c5349e53e387aaff1533d95e53a", "samnmax", "Floppy", "Demo", -1, Common::EN_ANY, Common::kPlatformPC }, { "c3b22fa4654bb580b20325ebf4174841", "puttzoo", "", "", -1, Common::NL_NLD, Common::kPlatformWindows }, { "c3df37df9d3b481b45f75283a9907c47", "loom", "EGA", "EGA", -1, Common::IT_ITA, Common::kPlatformPC }, { "c4787c3e8b5e2dfda90850ee800af00f", "zak", "V2", "V2", -1, Common::FR_FRA, Common::kPlatformPC }, @@ -487,22 +487,22 @@ static const MD5Table md5table[] = { { "c4ffae9fac495475d6bc3343ccc8faf9", "Soccer2004", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown }, { "c5cc7cba02a2fbd539c4439e775b0536", "puttzoo", "HE 99", "Updated", 43470, Common::DE_DEU, Common::kPlatformWindows }, { "c5d10e190d4b4d59114b824f2fdbd00e", "loom", "FM-TOWNS", "", -1, Common::EN_ANY, Common::kPlatformFMTowns }, - { "c63ee46143ba65f9ce14cf539ca51bd7", "atlantis", "", "Floppy", -1, Common::EN_ANY, Common::kPlatformPC }, + { "c63ee46143ba65f9ce14cf539ca51bd7", "atlantis", "Floppy", "Floppy", -1, Common::EN_ANY, Common::kPlatformPC }, { "c666a998af90d81db447eccba9f72c8d", "monkey", "No Adlib", "EGA", -1, Common::EN_ANY, Common::kPlatformAtariST }, { "c6907d44f1166941d982864cd42cdc89", "pajama2", "HE 99", "", -1, Common::DE_DEU, Common::kPlatformUnknown }, { "c782fbbe74a987c3df8ac73cd3e289ed", "freddi", "HE 73", "", -1, Common::SE_SWE, Common::kPlatformMacintosh }, { "c7890e038806df2bb5c0c8c6f1986ea2", "monkey", "VGA", "VGA", -1, Common::EN_ANY, Common::kPlatformPC }, - { "c7be10f775404fd9785a8b92a06d240c", "atlantis", "CD", "", -1, Common::EN_ANY, Common::kPlatformFMTowns }, + { "c7be10f775404fd9785a8b92a06d240c", "atlantis", "", "", -1, Common::EN_ANY, Common::kPlatformFMTowns }, { "c7c492a107ec520d7a7943037d0ca54a", "freddi", "HE 71", "Demo", -1, Common::NL_NLD, Common::kPlatformWindows }, - { "c83079157ec765a28de445aec9768d60", "tentacle", "CD", "Demo", 7477, Common::EN_ANY, Common::kPlatformUnknown }, + { "c83079157ec765a28de445aec9768d60", "tentacle", "", "Demo", 7477, Common::EN_ANY, Common::kPlatformUnknown }, { "c8575e0b973ff1723aba6cd92c642db2", "puttrace", "HE 99", "Demo", -1, Common::FR_FRA, Common::kPlatformWindows }, { "c8aac5e3e701874e2fa4117896f9e1b1", "freddi", "HE 73", "Demo", -1, Common::EN_ANY, Common::kPlatformMacintosh }, { "c8c5baadcbfc8d0372ed4335abace8a7", "pajama3", "", "Demo", -1, Common::FR_FRA, Common::kPlatformWindows }, { "c9717ee6059f1e43b768b464493d2fba", "fbpack", "", "", -1, Common::JA_JPN, Common::kPlatform3DO }, { "cb1559e8405d17a5a278a6b5ad9338d1", "freddi3", "", "Demo", 22718, Common::EN_ANY, Common::kPlatformUnknown }, - { "cc04a076779379524ed4d9c5ee3c6fb1", "tentacle", "CD", "CD", 282467632, Common::EN_ANY, Common::kPlatformMacintosh }, + { "cc04a076779379524ed4d9c5ee3c6fb1", "tentacle", "", "CD", 282467632, Common::EN_ANY, Common::kPlatformMacintosh }, { "cc0c4111449054f1692bb3c0c5e04629", "BluesBirthday", "", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown }, - { "cc8ba2b0df2f9c450bcf055fe2711979", "samnmax", "", "Demo", 7485, Common::DE_DEU, Common::kPlatformPC }, + { "cc8ba2b0df2f9c450bcf055fe2711979", "samnmax", "Floppy", "Demo", 7485, Common::DE_DEU, Common::kPlatformPC }, { "cd424f143a141bc59226ad83a6e40f51", "maze", "HE 98.5", "", -1, Common::NL_NLD, Common::kPlatformUnknown }, { "cd46c9f122272d02bbf79332ff521898", "loom", "EGA", "EGA", 5748, Common::RU_RUS, Common::kPlatformPC }, { "cd9c05e755d7bf8e9b9590ad1ebe273e", "dig", "Demo", "Demo", 45156007, Common::EN_ANY, Common::kPlatformMacintosh }, @@ -525,7 +525,7 @@ static const MD5Table md5table[] = { { "d220d154aafbfa12bd6f3ab1b2dae420", "puttzoo", "", "Demo", -1, Common::DE_DEU, Common::kPlatformMacintosh }, { "d2cc8e31bce61e6cf2951249e10638fe", "basketball", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown }, { "d37c55388294b66e53e7ced3af88fa68", "freddi2", "HE 100", "Updated Demo", -1, Common::EN_ANY, Common::kPlatformUnknown }, - { "d43352a805d78b5f4936c6d7779bf575", "samnmax", "CD", "CD", -1, Common::RU_RUS, Common::kPlatformPC }, + { "d43352a805d78b5f4936c6d7779bf575", "samnmax", "", "CD", -1, Common::RU_RUS, Common::kPlatformPC }, { "d4aac997e2f4e15341f0bfbf905419bd", "PuttTime", "HE 99", "", 62698, Common::EN_GRB, Common::kPlatformWindows }, { "d4b8ee426b1afd3e53bc0cf020418cf6", "dog", "HE 99", "", -1, Common::EN_ANY, Common::kPlatformWindows }, { "d4cccb5af88f3e77f370896e9ba8c5f9", "freddi", "HE 71", "", -1, Common::UNK_LANG, Common::kPlatformWindows }, @@ -535,7 +535,7 @@ static const MD5Table md5table[] = { { "d62047a6729349ab36f7ee065bf26509", "dig", "", "", -1, Common::RU_RUS, Common::kPlatformUnknown }, { "d62d248c3df6ec177405e2cb23d923b2", "indy3", "EGA", "EGA", -1, Common::IT_ITA, Common::kPlatformPC }, { "d6334a5a9b61afe18c368540fdf522ca", "airport", "", "", -1, Common::EN_ANY, Common::kPlatformMacintosh }, - { "d6dd0646404768a63e963891a96daadd", "atlantis", "", "Floppy", 12035, Common::EN_ANY, Common::kPlatformMacintosh }, + { "d6dd0646404768a63e963891a96daadd", "atlantis", "Floppy", "Floppy", 12035, Common::EN_ANY, Common::kPlatformMacintosh }, { "d73c851b942af44deb9b6d5f416a0972", "freddi3", "HE 99", "Demo", -1, Common::HB_ISR, Common::kPlatformWindows }, { "d74122362a77ec24525fdd50297dfd82", "freddi4", "", "", -1, Common::FR_FRA, Common::kPlatformMacintosh }, { "d7ab7cd6105546016e6a0d46fb36b964", "pajama", "HE 100", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown }, @@ -543,8 +543,8 @@ static const MD5Table md5table[] = { { "d831f7c048574dd9d5d85db2a1468099", "maniac", "C64", "", -1, Common::EN_ANY, Common::kPlatformC64 }, { "d8323015ecb8b10bf53474f6e6b0ae33", "dig", "", "", 16304, Common::UNK_LANG, Common::kPlatformUnknown }, { "d8d07efcb88f396bee0b402b10c3b1c9", "maniac", "NES", "", 262144, Common::EN_GRB, Common::kPlatformNES }, - { "d917f311a448e3cc7239c31bddb00dd2", "samnmax", "CD", "CD", 9080, Common::EN_ANY, Common::kPlatformUnknown }, - { "d9d0dd93d16ab4dec55cabc2b86bbd17", "samnmax", "CD", "Demo", 6478, Common::EN_ANY, Common::kPlatformPC }, + { "d917f311a448e3cc7239c31bddb00dd2", "samnmax", "", "CD", 9080, Common::EN_ANY, Common::kPlatformUnknown }, + { "d9d0dd93d16ab4dec55cabc2b86bbd17", "samnmax", "", "Demo", 6478, Common::EN_ANY, Common::kPlatformPC }, { "da09e666fc8f5b78d7b0ac65d1a3b56e", "monkey2", "", "", 11135, Common::EN_ANY, Common::kPlatformFMTowns }, { "da6269b18fcb08189c0aa9c95533cce2", "monkey", "CD", "CD", 8955, Common::IT_ITA, Common::kPlatformPC }, { "da669b20271b85182e9c17a2a37ea02e", "monkey2", "", "", -1, Common::DE_DEU, Common::kPlatformAmiga }, @@ -566,7 +566,7 @@ static const MD5Table md5table[] = { { "e361a7058ed8e8ebb462663c0a3ae8d6", "puttputt", "HE 61", "", -1, Common::HB_ISR, Common::kPlatformPC }, { "e41de1c2a15abbcdbf9977e2d7e8a340", "freddi2", "HE 100", "Updated", -1, Common::RU_RUS, Common::kPlatformWindows }, { "e44ea295a3f8fe4f41983080dab1e9ce", "freddi", "HE 90", "Updated", -1, Common::FR_FRA, Common::kPlatformMacintosh }, - { "e534d29afb3c6e0ee9dc3d53c5956714", "atlantis", "", "Floppy", -1, Common::DE_DEU, Common::kPlatformAmiga }, + { "e534d29afb3c6e0ee9dc3d53c5956714", "atlantis", "Floppy", "Floppy", -1, Common::DE_DEU, Common::kPlatformAmiga }, { "e5563c8358443c4352fcddf7402a5e0a", "pajama2", "HE 98.5", "", -1, Common::FR_FRA, Common::kPlatformWindows }, { "e5c112140ad6574997de033a8e2a2964", "readtime", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown }, { "e62056ba675ad65d8854ab3c5ad4b3c0", "spyfox2", "", "Mini Game", -1, Common::EN_ANY, Common::kPlatformWindows }, @@ -584,11 +584,11 @@ static const MD5Table md5table[] = { { "ecc4340c2b801f5af8da4e00c0e432d9", "puttcircus", "", "", -1, Common::NL_NLD, Common::kPlatformUnknown }, { "ed2b074bc3166087a747acb2a3c6abb0", "freddi3", "HE 98.5", "Demo", -1, Common::DE_DEU, Common::kPlatformUnknown }, { "ed361270102e355afe5236954216aba2", "lost", "", "", -1, Common::EN_USA, Common::kPlatformUnknown }, - { "ede149fda3edfc1dbd7347e0737cb583", "tentacle", "CD", "CD", -1, Common::FR_FRA, Common::kPlatformMacintosh }, - { "edfdb24a499d92c59f824c52987c0eec", "atlantis", "", "Floppy", -1, Common::FR_FRA, Common::kPlatformPC }, + { "ede149fda3edfc1dbd7347e0737cb583", "tentacle", "", "CD", -1, Common::FR_FRA, Common::kPlatformMacintosh }, + { "edfdb24a499d92c59f824c52987c0eec", "atlantis", "Floppy", "Floppy", -1, Common::FR_FRA, Common::kPlatformPC }, { "ee41f6afbc5b26fa475754b56fe92048", "puttputt", "HE 61", "", 8032, Common::JA_JPN, Common::kPlatform3DO }, { "ee785fe2569bc9965526e774f7ab86f1", "spyfox", "HE 99", "", -1, Common::FR_FRA, Common::kPlatformMacintosh }, - { "ef347474f3c7be3b29584eaa133cca05", "samnmax", "", "Floppy", -1, Common::FR_FRA, Common::kPlatformPC }, + { "ef347474f3c7be3b29584eaa133cca05", "samnmax", "Floppy", "Floppy", -1, Common::FR_FRA, Common::kPlatformPC }, { "ef71a322b6530ac45b1a070f7c0795f7", "moonbase", "Demo", "Demo", -1, Common::EN_ANY, Common::kPlatformWindows }, { "ef74d9071d4e564b037cb44bd6774de7", "fbear", "HE 61", "", -1, Common::HB_ISR, Common::kPlatformPC }, { "efe0a04a703e765ebebe92b6c8aa6b86", "baseball2003", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown }, @@ -598,11 +598,11 @@ static const MD5Table md5table[] = { { "f163cf53f7850e43fb482471e5c52e1a", "maniac", "NES", "", 262144, Common::ES_ESP, Common::kPlatformNES }, { "f1b0e0d587b85052de5534a3847e68fe", "water", "HE 99", "Updated", -1, Common::EN_ANY, Common::kPlatformUnknown }, { "f237bf8a5ef9af78b2a6a4f3901da341", "pajama", "", "Demo", 18354, Common::EN_ANY, Common::kPlatformUnknown }, - { "f27b1ba0eadaf2a6617b2b58192d1dbf", "samnmax", "", "Floppy", -1, Common::DE_DEU, Common::kPlatformPC }, + { "f27b1ba0eadaf2a6617b2b58192d1dbf", "samnmax", "Floppy", "Floppy", -1, Common::DE_DEU, Common::kPlatformPC }, { "f3d55aea441e260e9e9c7d2a187097e0", "puttzoo", "", "Demo", 14337, Common::EN_ANY, Common::kPlatformWindows }, { "f40a7f495f59188ca57a9d1d50301bb6", "puttputt", "Demo", "Demo", -1, Common::EN_ANY, Common::kPlatformMacintosh }, { "f5228b0cc1c19e6ea8268ba2eeb61f60", "freddi", "HE 73", "Demo", -1, Common::FR_FRA, Common::kPlatformWindows }, - { "f73883f13b5a302749a5bad31d909780", "tentacle", "CD", "CD", -1, Common::DE_DEU, Common::kPlatformMacintosh }, + { "f73883f13b5a302749a5bad31d909780", "tentacle", "", "CD", -1, Common::DE_DEU, Common::kPlatformMacintosh }, { "f7711f9264d4d43c2a1518ec7c10a607", "pajama3", "", "", 79382, Common::EN_USA, Common::kPlatformUnknown }, { "f79e60c17cca601e411f1f75e8ee9b5a", "spyfox2", "", "", 51286, Common::UNK_LANG, Common::kPlatformUnknown }, { "f8be685007a8b425ba2a455da732f59f", "pajama2", "HE 99", "", -1, Common::FR_FRA, Common::kPlatformMacintosh }, @@ -613,7 +613,7 @@ static const MD5Table md5table[] = { { "fbb697d89d2beca87360a145f467bdae", "PuttTime", "HE 90", "Demo", -1, Common::DE_DEU, Common::kPlatformUnknown }, { "fbbbb38a81fc9d6a61d509278390a290", "farm", "", "", -1, Common::EN_ANY, Common::kPlatformMacintosh }, { "fbdd947d21e8f5bac6d6f7a316af1c5a", "spyfox", "", "Demo", 15693, Common::EN_ANY, Common::kPlatformUnknown }, - { "fc53ce0e5f6562b1c1e1b4b8203acafb", "samnmax", "", "Floppy", -1, Common::ES_ESP, Common::kPlatformPC }, + { "fc53ce0e5f6562b1c1e1b4b8203acafb", "samnmax", "Floppy", "Floppy", -1, Common::ES_ESP, Common::kPlatformPC }, { "fc6b6148e80d67939d9a18697c0f626a", "monkey", "EGA", "EGA", -1, Common::DE_DEU, Common::kPlatformPC }, { "fc8d197a22146e74766e9cb0cfcaf1da", "freddi2", "HE 80", "Demo", 27298, Common::EN_ANY, Common::kPlatformUnknown }, { "fcb78ebecab2757264c590890c319cc5", "PuttTime", "HE 85", "", -1, Common::NL_NLD, Common::kPlatformUnknown }, diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index abf9848451..9d6673d308 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -26,6 +26,7 @@ #include "common/config-manager.h" #include "common/md5.h" #include "common/events.h" +#include "common/EventRecorder.h" #include "common/system.h" #include "gui/message.h" @@ -135,6 +136,8 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) // Init all vars + _v0ObjectIndex = false; + _v0ObjectInInventory = false; _imuse = NULL; _imuseDigital = NULL; _musicEngine = NULL; @@ -182,6 +185,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _mouseAndKeyboardStat = 0; _leftBtnPressed = 0; _rightBtnPressed = 0; + _lastInputScriptTime = 0; _bootParam = 0; _dumpScripts = false; _debugMode = 0; @@ -215,7 +219,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _roomResource = 0; OF_OWNER_ROOM = 0; _verbMouseOver = 0; - _inventoryOffset = 0; _classData = NULL; _actorToPrintStrFor = 0; _sentenceNum = 0; @@ -539,7 +542,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) for (int i = 0; i < ARRAYSIZE(debugChannels); ++i) Common::addDebugChannel(debugChannels[i].flag, debugChannels[i].channel, debugChannels[i].desc); - syst->getEventManager()->registerRandomSource(_rnd, "scumm"); + g_eventRec.registerRandomSource(_rnd, "scumm"); } @@ -645,6 +648,8 @@ ScummEngine_v3old::ScummEngine_v3old(OSystem *syst, const DetectorResult &dr) ScummEngine_v2::ScummEngine_v2(OSystem *syst, const DetectorResult &dr) : ScummEngine_v3old(syst, dr) { + _inventoryOffset = 0; + _activeInventory = 0; _activeObject = 0; _activeVerb = 0; @@ -663,7 +668,17 @@ 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; + + _activeObject2 = 0; + _activeObjectIndex = 0; + _activeObject2Index = 0; + _activeInvExecute = false; + _activeObject2Inv = false; + _activeObjectObtained = false; + _activeObject2Obtained = false; } ScummEngine_v6::ScummEngine_v6(OSystem *syst, const DetectorResult &dr) @@ -1883,7 +1898,7 @@ void ScummEngine::scummLoop(int delta) { } // Trigger autosave if necessary. - if (!_saveLoadFlag && shouldPerformAutoSave(_lastSaveTime)) { + if (!_saveLoadFlag && shouldPerformAutoSave(_lastSaveTime) && canSaveGameStateCurrently()) { _saveLoadSlot = 0; sprintf(_saveLoadName, "Autosave %d", _saveLoadSlot); _saveLoadFlag = 1; diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index 4ed8cf57eb..f0f2521225 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -565,6 +565,9 @@ protected: int32 *_scummVars; byte *_bitVars; + bool _v0ObjectIndex; // V0 Use object index, instead of object number + bool _v0ObjectInInventory; // V0 Use object number from inventory + /* Global resource tables */ int _numVariables, _numBitVariables, _numLocalObjects; int _numGlobalObjects, _numArray, _numVerbs, _numFlObject; @@ -612,6 +615,12 @@ protected: uint16 _mouseAndKeyboardStat; byte _leftBtnPressed, _rightBtnPressed; + /** + * Last time runInputScript was run (measured in terms of OSystem::getMillis()). + * This is currently only used for Indy3 mac to detect "double clicks". + */ + uint32 _lastInputScriptTime; + /** The bootparam, to be passed to the script 1, the bootscript. */ int _bootParam; @@ -858,12 +867,14 @@ protected: int getObjNewDir(int obj); int getObjectIndex(int object) const; int getObjectImageCount(int object); + int whereIsObjectInventory(int object); int whereIsObject(int object) const; int findObject(int x, int y); void findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint object, uint room); public: int getObjectOrActorXY(int object, int &x, int &y); // Used in actor.cpp, hence public protected: + int getDist(int x, int y, int x2, int y2); int getObjActToObjActDist(int a, int b); // Not sure how to handle const byte *getObjOrActorName(int obj); // these three.. void setObjectName(int obj); @@ -884,7 +895,6 @@ protected: protected: /* Should be in Verb class */ uint16 _verbMouseOver; - int _inventoryOffset; int8 _userPut; uint16 _userState; diff --git a/engines/scumm/scumm_v0.h b/engines/scumm/scumm_v0.h index ccca5df0d3..19260b6429 100644 --- a/engines/scumm/scumm_v0.h +++ b/engines/scumm/scumm_v0.h @@ -35,7 +35,20 @@ namespace Scumm { */ class ScummEngine_v0 : public ScummEngine_v2 { protected: - int _currentMode; + byte _currentMode; + bool _verbExecuting; // is a verb executing + bool _verbPickup; // are we picking up an object during a verb execute + + int _activeActor; // Actor Number + int _activeObject2; // 2nd Object Number + + bool _activeInvExecute; // is activeInventory first to be executed + bool _activeObject2Inv; // is activeobject2 in the inventory + bool _activeObjectObtained; // collected _activeobject? + bool _activeObject2Obtained; // collected _activeObject2? + + int _activeObjectIndex; + int _activeObject2Index; public: ScummEngine_v0(OSystem *syst, const DetectorResult &dr); @@ -53,12 +66,25 @@ protected: virtual void processInput(); + virtual void runObject(int obj, int entry); virtual void saveOrLoad(Serializer *s); + // V0 MM Verb commands + int verbPrep(int object); + bool verbMove(int object, int objectIndex, bool invObject); + bool verbMoveToActor(int actor); + bool verbObtain(int object, int objIndex); + bool verbExecutes(int object, bool inventory = false); + bool verbExec(); + + int findObjectIndex(int x, int y); + virtual void checkExecVerbs(); virtual void handleMouseOver(bool updateInventory); void resetVerbs(); void setNewKidVerbs(); + + void drawSentenceWord(int object, bool usePrep, bool objInInventory); void drawSentence(); void switchActor(int slot); @@ -68,7 +94,7 @@ protected: virtual int getActiveObject(); - virtual void resetSentence(); + virtual void resetSentence(bool walking = false); /* Version C64 script opcodes */ void o_stopCurrentScript(); diff --git a/engines/scumm/scumm_v2.h b/engines/scumm/scumm_v2.h index 338b5f6167..ee9591bc45 100644 --- a/engines/scumm/scumm_v2.h +++ b/engines/scumm/scumm_v2.h @@ -45,6 +45,7 @@ protected: int8 _mouseOverBoxV2; char _sentenceBuf[256]; + uint16 _inventoryOffset; int _activeInventory; int _activeObject; @@ -66,6 +67,8 @@ protected: virtual void resetScummVars(); virtual void decodeParseString(); + virtual void saveOrLoad(Serializer *s); + virtual void processKeyboard(Common::KeyState lastKeyHit); virtual void readIndexFile(); @@ -100,7 +103,7 @@ protected: virtual void setBuiltinCursor(int index); - void runObject(int obj, int entry); + virtual void runObject(int obj, int entry); /* Version 2 script opcodes */ void o2_actorFromPos(); diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index 2a681ffd62..d1676772a8 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -23,6 +23,9 @@ * */ +#include "common/config-manager.h" +#include "common/timer.h" +#include "common/util.h" #include "scumm/actor.h" #include "scumm/file.h" @@ -32,10 +35,6 @@ #include "scumm/sound.h" #include "scumm/util.h" -#include "common/config-manager.h" -#include "common/timer.h" -#include "common/util.h" - #include "sound/adpcm.h" #include "sound/audiocd.h" #include "sound/flac.h" @@ -46,8 +45,6 @@ #include "sound/vorbis.h" #include "sound/wave.h" - - namespace Scumm { struct MP3OffsetTable { /* Compressed Sound (.SO3) */ @@ -420,17 +417,16 @@ void Sound::playSound(int soundID) { sound = (char *)malloc(size); int vol = ptr[24] * 4; int loopStart = 0, loopEnd = 0; -#if 0 // Disabling this until after 0.11.0 int loopcount = ptr[27]; if (loopcount > 1) { // TODO: We can only loop once, or infinitely many times, but // have no support for a finite number of repetitions. - // This is + // So far, I have seen only 1 and 255 (for infinite repetitions), + // so maybe this is not really a problem. loopStart = READ_BE_UINT16(ptr + 10) - READ_BE_UINT16(ptr + 8); loopEnd = READ_BE_UINT16(ptr + 14); flags |= Audio::Mixer::FLAG_LOOP; } -#endif memcpy(sound, ptr + READ_BE_UINT16(ptr + 8), size); _mixer->playRaw(Audio::Mixer::kSFXSoundType, NULL, sound, size, rate, diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp index f00f4ff33b..e99bea87de 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -995,6 +995,11 @@ void ScummEngine::drawString(int a, const byte *msg) { } _string[a].xpos = _charset->_str.right; + + if (_game.heversion >= 60) { + _string[a]._default.xpos = _string[a].xpos; + _string[a]._default.ypos = _string[a].ypos; + } } int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize) { diff --git a/engines/scumm/vars.cpp b/engines/scumm/vars.cpp index 22487b43a3..98e088365e 100644 --- a/engines/scumm/vars.cpp +++ b/engines/scumm/vars.cpp @@ -538,9 +538,7 @@ void ScummEngine_v8::setupScummVars() { #endif void ScummEngine_v0::resetScummVars() { - _activeInventory = 0; - _activeObject = 0; - _activeVerb = 13; + resetSentence(); VAR(VAR_EGO) = 3; diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp index 81b28ce563..1ab9d72a58 100644 --- a/engines/scumm/verbs.cpp +++ b/engines/scumm/verbs.cpp @@ -155,6 +155,7 @@ void ScummEngine_v0::switchActor(int slot) { VAR(VAR_EGO) = VAR(97 + slot); actorFollowCamera(VAR(VAR_EGO)); resetVerbs(); + resetSentence(false); setUserState(247); } @@ -376,14 +377,8 @@ void ScummEngine_v2::checkV2Inventory(int x, int y) { if (object > 0) { if (_game.version == 0) { - if (_activeInventory != object) { - _activeInventory = object; - } else if (_activeVerb != 3 && _activeVerb != 13) { - if (_activeObject) - runObject(_activeObject, _activeVerb); - else - runObject(_activeInventory, _activeVerb); - } + _activeInventory = object; + } else { runInputScript(kInventoryClickArea, object, 0); } @@ -425,7 +420,9 @@ void ScummEngine_v2::redrawV2Inventory() { _string[1].right = _mouseOverBoxesV2[i].rect.right - 1; _string[1].color = _mouseOverBoxesV2[i].color; + _v0ObjectInInventory = true; const byte *tmp = getObjOrActorName(obj); + _v0ObjectInInventory = false; assert(tmp); // Prevent inventory entries from overflowing by truncating the text @@ -629,14 +626,14 @@ void ScummEngine_v2::checkExecVerbs() { if (vs->verbid && vs->saveid == 0 && vs->curmode == 1) { if (_mouseAndKeyboardStat == vs->key) { // Trigger verb as if the user clicked it - runInputScript(1, vs->verbid, 1); + runInputScript(kVerbClickArea, vs->verbid, 1); return; } } } // Generic keyboard input - runInputScript(4, _mouseAndKeyboardStat, 1); + runInputScript(kKeyClickArea, _mouseAndKeyboardStat, 1); } else if (_mouseAndKeyboardStat & MBS_MOUSE_MASK) { VirtScreen *zone = findVirtScreen(_mouse.y); const byte code = _mouseAndKeyboardStat & MBS_LEFT_CLICK ? 1 : 2; @@ -649,7 +646,7 @@ void ScummEngine_v2::checkExecVerbs() { if (zone->number == kVerbVirtScreen && _mouse.y <= zone->topline + 8) { // Click into V2 sentence line - runInputScript(5, 0, 0); + runInputScript(kSentenceClickArea, 0, 0); } else if (zone->number == kVerbVirtScreen && _mouse.y > zone->topline + inventoryArea) { // Click into V2 inventory checkV2Inventory(_mouse.x, _mouse.y); @@ -657,7 +654,7 @@ void ScummEngine_v2::checkExecVerbs() { over = findVerbAtPos(_mouse.x, _mouse.y); if (over != 0) { // Verb was clicked - runInputScript(1, _verbs[over].verbid, code); + runInputScript(kVerbClickArea, _verbs[over].verbid, code); } else { // Scene was clicked runInputScript((zone->number == kMainVirtScreen) ? kSceneClickArea : kVerbClickArea, 0, code); @@ -666,6 +663,25 @@ void ScummEngine_v2::checkExecVerbs() { } } +void ScummEngine_v0::runObject(int obj, int entry) { + int prev = _v0ObjectInInventory; + + if (getVerbEntrypoint(obj, entry) != 0) { + _v0ObjectInInventory = prev; + runObjectScript(obj, entry, false, false, NULL); + } else if (entry != 13 && entry != 15) { + if (_activeVerb != 3) { + VAR(9) = entry; + runScript(3, 0, 0, 0); + + // For some reasons, certain objects don't have a "give" script + } else if (VAR(5) > 0 && VAR(5) < 8) { + if (_activeInventory) + setOwnerOf(_activeInventory, VAR(5)); + } + } +} + void ScummEngine_v2::runObject(int obj, int entry) { if (getVerbEntrypoint(obj, entry) != 0) { runObjectScript(obj, entry, false, false, NULL); @@ -679,10 +695,293 @@ void ScummEngine_v2::runObject(int obj, int entry) { _activeVerb = 13; } +bool ScummEngine_v0::verbMoveToActor(int actor) { + Actor *a = derefActor(VAR(VAR_EGO), "checkExecVerbs"); + Actor *a2 =derefActor(actor, "checkExecVerbs"); + + if (!a->_moving) { + int dist = getDist(a->getRealPos().x, a->getRealPos().y, a2->getRealPos().x, a2->getRealPos().y); + if (dist > 5) + a->startWalkActor(a2->getRealPos().x, a2->getRealPos().y, 1); + else + return false; + + return true; + } + + return true; +} + +bool ScummEngine_v0::verbMove(int object, int objectIndex, bool invObject) { + int x, y, dir; + Actor *a = derefActor(VAR(VAR_EGO), "checkExecVerbs"); + + if (_currentMode != 3 && _currentMode != 2) + return false; + + if (a->_moving) + return true; + + _v0ObjectIndex = true; + getObjectXYPos(objectIndex, x, y, dir); + _v0ObjectIndex = false; + // Detect distance from target object + int dist = getDist(a->getRealPos().x, a->getRealPos().y, x, y); + + // FIXME: This should be changed once the walkbox problem is fixed + if (dist > 0x5) { + a->startWalkActor(x, y, dir); + VAR(6) = x; + VAR(7) = y; + return true; + } else { + // Finished walk, are we picking up the item? + if (_verbPickup) { + int oldActive = _activeObject, oldIndex = _activeObjectIndex; + _activeObject = object; + _activeObjectIndex = objectIndex; + + _v0ObjectIndex = true; + // Execute pickup + runObject(objectIndex, 14); + _v0ObjectIndex = false; + + _activeObject = oldActive; + _activeObjectIndex = oldIndex; + + // Finished picking up + _verbPickup = false; + } + } + + return false; +} + +bool ScummEngine_v0::verbObtain(int obj, int objIndex) { + bool didPickup = false; + + int prep, where = whereIsObjectInventory(obj); + + if (objIndex == 0) + return false; + + if (where != WIO_INVENTORY) { + _v0ObjectIndex = true; + prep = verbPrep(objIndex); + + if (prep == 1 || prep == 4) { + if (_activeVerb != 13 && _activeVerb != 14) { + _verbPickup = true; + didPickup = true; + } + } else { + _verbPickup = false; + } + + if (verbMove(obj, objIndex, false)) + return true; + + if (didPickup && (prep == 1 || prep == 4)) + if (_activeVerb != 13 && _activeVerb != 14) + _activeInventory = obj; + } + + return false; +} + +int ScummEngine_v0::verbPrep(int object) { + if (!_v0ObjectInInventory) + _v0ObjectIndex = true; + else + _v0ObjectIndex = false; + byte *ptr = getOBCDFromObject(object); + _v0ObjectIndex = false; + assert(ptr); + return (*(ptr + 11) >> 5); +} + +bool ScummEngine_v0::verbExecutes(int object, bool inventory) { + _v0ObjectInInventory = inventory; + int prep = verbPrep(object); + + if (prep == 2 || prep == 0) { + return true; + } + + return false; +} + +bool ScummEngine_v0::verbExec() { + int prep = 0; + int entry = (_currentMode != 0 && _currentMode != 1) ? _activeVerb : 15; + + if ((!_activeInvExecute && _activeObject && getObjectIndex(_activeObject) == -1)) { + resetSentence(); + return false; + } + + // Lets try walk to the object + if (_activeObject && _activeObjectIndex && !_activeObjectObtained && _currentMode != 0) { + prep = verbPrep(_activeObjectIndex); + + if (verbObtain(_activeObject, _activeObjectIndex)) + return true; + + _activeObjectObtained = true; + } + + if (_activeObject2 && _activeObject2Index && !_activeObject2Obtained && _currentMode != 0) { + prep = verbPrep(_activeObject2Index); + + _v0ObjectInInventory = false; + if (verbObtain(_activeObject2, _activeObject2Index)) + return true; + + if (prep != 1 && prep != 4) { + _activeInventory = _activeObject; + _activeObject = _activeObject2; + _activeObjectIndex = _activeObject2Index; + _activeObject2 = 0; + _activeObject2Index = 0; + } + + _activeObject2Obtained = true; + } + + // Give-To + if (_activeVerb == 3 && _activeInventory && _activeActor) { + // FIXME: Actors need to turn and face each other + // And walk to each other + if (verbMoveToActor(_activeActor)) + return true; + + _v0ObjectInInventory = true; + VAR(5) = _activeActor; + runObject(_activeInventory , 3); + _v0ObjectInInventory = false; + + resetSentence(); + return false; + } + + if (_activeActor) { + _v0ObjectIndex = true; + runObject(_activeActor, entry); + _v0ObjectIndex = false; + _verbExecuting = false; + + resetSentence(); + return false; + } + + // If we've finished walking (now near target), execute the action + if (_activeObject && _activeObjectIndex && verbPrep(_activeObjectIndex) == 2) { + _v0ObjectIndex = true; + runObject(_activeObjectIndex, entry); + _v0ObjectIndex = false; + _verbExecuting = false; + + if ((_currentMode == 3 || _currentMode == 2) && _activeVerb == 13) + return false; + + resetSentence(); + return false; + } + + // We acted on an inventory item + if (_activeInventory && verbExecutes(_activeInventory, true) && _activeVerb != 3) { + _v0ObjectInInventory = true; + runObject(_activeInventory, _activeVerb); + + _verbExecuting = false; + + if (_currentMode == 3 && _activeVerb == 13) { + resetSentence(true); + return false; + } + + resetSentence(); + return false; + } + + if (_activeObject) { + _v0ObjectIndex = true; + runObject(_activeObjectIndex, entry); + _v0ObjectIndex = false; + } else if (_activeInventory) { + if (verbExecutes(_activeInventory, true) == false) { + if (_activeObject2 && verbExecutes(_activeObject2, true)) { + _v0ObjectInInventory = true; + + _activeObject = _activeInventory; + _activeInventory = _activeObject2; + + runObject(_activeObject, _activeVerb); + } else { + _v0ObjectInInventory = true; + runObject(_activeInventory, _activeVerb); + } + } else { + runObject(_activeInventory, _activeVerb); + _v0ObjectInInventory = true; + } + } + + _verbExecuting = false; + + if (_activeVerb == 13) { + resetSentence(true); + return false; + } + + resetSentence(); + + return false; +} + void ScummEngine_v0::checkExecVerbs() { Actor *a; VirtScreen *zone = findVirtScreen(_mouse.y); + // Is a verb currently executing + if (_verbExecuting) { + // Check if mouse click + if (_mouseAndKeyboardStat & MBS_MOUSE_MASK) { + int over = findVerbAtPos(_mouse.x, _mouse.y); + int act = getActorFromPos(_virtualMouse.x, _virtualMouse.y); + int obj = findObject(_virtualMouse.x, _virtualMouse.y); + + if (over && over != _activeVerb) { + _activeVerb = over; + _verbExecuting = false; + return; + } + + if (!obj && !act && !over) { + resetSentence(false); + } else { + a = derefActor(VAR(VAR_EGO), "checkExecVerbs"); + a->stopActorMoving(); + } + } else { + if (_verbExecuting && !verbExec()) + return; + } + } + + // What-Is selected, any object we hover over is selected, on mouse press we set to WalkTo + if (_activeVerb == 15) { + int obj = findObject(_virtualMouse.x, _virtualMouse.y); + int objIdx = findObjectIndex(_virtualMouse.x, _virtualMouse.y); + _activeObject = obj; + _activeObjectIndex = objIdx; + + if ((_mouseAndKeyboardStat & MBS_MOUSE_MASK)) + _activeVerb = 13; // Walk-To + + return; + } + if (_userPut <= 0 || _mouseAndKeyboardStat == 0) return; @@ -693,61 +992,147 @@ void ScummEngine_v0::checkExecVerbs() { if (zone->number == kVerbVirtScreen && _mouse.y <= zone->topline + 8) { // TODO } else if (zone->number == kVerbVirtScreen && _mouse.y > zone->topline + 32) { + int prevInventory = _activeInventory; + // Click into V2 inventory checkV2Inventory(_mouse.x, _mouse.y); + if (!_activeInventory) + return; + + // Did we just change the selected inventory item? + if (prevInventory && prevInventory != _activeInventory && _activeInventory != _activeObject2) { + _activeObject = 0; + _activeInvExecute = true; + _activeObject2Inv = true; + _activeObject2 = _activeInventory; + _activeInventory = prevInventory; + return; + } + + // is the new selected inventory the same as the last selected?, reset to previous if it is + if (_activeInventory == _activeObject2) + _activeInventory = prevInventory; + + // Inventory Selected changed + if (prevInventory != _activeInventory) + if (!_activeObject2 || prevInventory != _activeObject2) + return; + + if (_activeVerb == 11 && !((!(_activeObject || _activeInventory)) || !_activeObject2)) + return; } else { int over = findVerbAtPos(_mouse.x, _mouse.y); + int act = getActorFromPos(_virtualMouse.x, _virtualMouse.y); + int obj = findObject(_virtualMouse.x, _virtualMouse.y); + int objIdx = findObjectIndex(_virtualMouse.x, _virtualMouse.y); + + if ((_activeObject || _activeInventory) && act) { + obj = 0; + objIdx = 0; + } // Handle New Kid verb options - if (_activeVerb == 7) { + if (_activeVerb == 7 || over == 7) { + // Disable New-Kid (in the secret lab) + if (_currentMode == 2 || _currentMode == 0) + return; + + if (_activeVerb != 7) { + _activeVerb = over; + over = 0; + } + if (over) { _activeVerb = 13; switchActor(_verbs[over].verbid - 1); + return; } + + setNewKidVerbs(); + return; } + + // Clicked on nothing, walk here? + if (!over && !act && _activeVerb == 13 && !obj && _currentMode != 0) { + // Clear all selected + resetSentence(); - if (over) { - _activeVerb = _verbs[over].verbid; - // Selected New Kid verb - if (_activeVerb == 7) - setNewKidVerbs(); + // 0xB31 + VAR(6) = _virtualMouse.x / V12_X_MULTIPLIER; + VAR(7) = _virtualMouse.y / V12_Y_MULTIPLIER; + if (zone->number == kMainVirtScreen) { + a = derefActor(VAR(VAR_EGO), "checkExecVerbs"); + a->stopActorMoving(); + a->startWalkActor(_virtualMouse.x / V12_X_MULTIPLIER, _virtualMouse.y / V12_Y_MULTIPLIER, -1); + } return; } - int act = getActorFromPos(_virtualMouse.x, _virtualMouse.y); - int obj = findObject(_virtualMouse.x, _virtualMouse.y); - if (act != 0 && _activeVerb == 3 && _activeInventory != 0) { - // Give inventory item to actor - VAR(5) = act; - runObject(_activeInventory, _activeVerb); - } else if (obj) { - if (_currentMode == 3 && _activeVerb != 13 && obj != _activeObject) { - _activeObject = obj; - return; - } + // No new verb, use previous + if (over == 0) + over = _activeVerb; - _activeObject = obj; - if (_currentMode == 3) { - int x, y, dir; - a = derefActor(VAR(VAR_EGO), "checkExecVerbs"); - getObjectXYPos(obj, x, y, dir); - a->startWalkActor(x, y, dir); + // No verb selected, use walk-to + if (!_activeVerb) + _activeVerb = over = 13; // Walk-To + + // New verb selected + if (_activeVerb != over) { + _activeVerb = over; + if (_activeVerb == 13) { + resetSentence(); } + return; + } - int entry = (_currentMode == 3) ? _activeVerb : 15; - runObject(_activeObject, entry); - } else if (zone->number == kMainVirtScreen) { - a = derefActor(VAR(VAR_EGO), "checkExecVerbs"); - a->startWalkActor(_virtualMouse.x / V12_X_MULTIPLIER, _virtualMouse.y / V12_Y_MULTIPLIER, -1); + // Only allowing targetting actors if its the GIVE/USE verb + if (_activeVerb == 3 || _activeVerb == 11) { + // Different actor selected? + if (act) { + if (_activeActor != act) { + _activeActor = act; + return; + } + } } - _activeInventory = 0; - _activeObject = 0; - _activeVerb = 13; + if (obj && obj != _activeObject) { + if (!_activeObject) + if (_activeInventory) + _activeInvExecute = true; + + // USE + if (_activeVerb == 11 || _activeVerb == 8) { + if (obj != _activeObject || obj != _activeObject2) { + if (!_activeObject || _activeInventory) { + _activeObject = obj; + _activeObjectIndex = objIdx; + return; + } else { + if (_activeObject2 != obj) { + _activeObject2 = obj; + _activeObject2Index = objIdx; + return; + } + } + } + } else { + _activeObject = obj; + _activeObjectIndex = objIdx; + + if (_activeVerb != 13) + return; + + //return; + } + } } - } + + _verbExecuting = true; + + } // mouse k/b action } void ScummEngine::verbMouseOver(int verb) { |