diff options
author | Max Horn | 2003-08-06 12:04:27 +0000 |
---|---|---|
committer | Max Horn | 2003-08-06 12:04:27 +0000 |
commit | 3e0cd37cea291a06b510228b4c26cf40db80140f (patch) | |
tree | e9a722226f90d96b21158b5f0160ef7af10bdcfe | |
parent | 845a3c5f6e7d98ee223be5703aa0312d7b37ee2e (diff) | |
download | scummvm-rg350-3e0cd37cea291a06b510228b4c26cf40db80140f.tar.gz scummvm-rg350-3e0cd37cea291a06b510228b4c26cf40db80140f.tar.bz2 scummvm-rg350-3e0cd37cea291a06b510228b4c26cf40db80140f.zip |
get rid of GF_INDY3 again, and also remove GID_INDY3_256 and GID_INDY3_TOWNS
svn-id: r9554
-rw-r--r-- | scumm/boxes.cpp | 5 | ||||
-rw-r--r-- | scumm/charset.cpp | 4 | ||||
-rw-r--r-- | scumm/help.cpp | 10 | ||||
-rw-r--r-- | scumm/resource_v3.cpp | 5 | ||||
-rw-r--r-- | scumm/script.cpp | 21 | ||||
-rw-r--r-- | scumm/script_v5.cpp | 16 | ||||
-rw-r--r-- | scumm/scumm.h | 8 | ||||
-rw-r--r-- | scumm/scummvm.cpp | 18 |
8 files changed, 37 insertions, 50 deletions
diff --git a/scumm/boxes.cpp b/scumm/boxes.cpp index 0342288832..5ccba9670e 100644 --- a/scumm/boxes.cpp +++ b/scumm/boxes.cpp @@ -289,7 +289,8 @@ Box *Scumm::getBoxBaseAddr(int box) { // checking at all. All the problems so far have been cases where // the value was exactly one more than what we consider the maximum. // So it's very well possible that all of these are script errors. - if (_gameId == GID_MONKEY_EGA || _gameId == GID_INDY3 || _gameId == GID_ZAK) { + if ((_features & GF_OLD_BUNDLE) + && (_gameId == GID_MONKEY_EGA || _gameId == GID_INDY3 || _gameId == GID_ZAK)) { checkRange(ptr[0], 0, box, "Illegal box %d"); } else checkRange(ptr[0] - 1, 0, box, "Illegal box %d"); @@ -657,7 +658,7 @@ int Scumm::getPathToDestBox(byte from, byte to) { // case to fix the scene in Indy3 where Indy meets Hitler in Berlin. // It's one of the places (or maybe even the only one?). See bug #770690 // and also bug #774783. - if ((_features & GF_INDY3) && _roomResource == 46 && from == 1 && to == 0) + if ((_gameId == GID_INDY3) && _roomResource == 46 && from == 1 && to == 0) return 1; // Skip up to the matrix data for box 'from' diff --git a/scumm/charset.cpp b/scumm/charset.cpp index be0d4963f0..040c166929 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -928,8 +928,8 @@ int CharsetRendererV3::getCharWidth(byte chr) { void CharsetRendererV3::setColor(byte color) { _color = color; - _shadowColor = (_vm->_features & GF_FMTOWNS) ? 8 : 0; - if (_vm->_features & GF_FMTOWNS || _vm->_gameId == GID_INDY3_256) { + _shadowColor = (_vm->_features & GF_OLD256) ? 8 : 0; + if (_vm->_features & GF_OLD256) { _dropShadow = ((_color & 0x80) != 0); _color &= 0x7f; } else if (_vm->_features & GF_16COLOR) { diff --git a/scumm/help.cpp b/scumm/help.cpp index 677bfc08d3..d840fc9f32 100644 --- a/scumm/help.cpp +++ b/scumm/help.cpp @@ -30,8 +30,6 @@ int ScummHelp::numPages(byte gameId) { return 4; break; case GID_INDY3: - case GID_INDY3_256: - case GID_INDY3_TOWNS: return 6; break; case GID_LOOM: @@ -141,8 +139,6 @@ void ScummHelp::updateStrings(byte gameId, byte version, int page, ADD_BIND("b", "Switch"); break; case GID_INDY3: - case GID_INDY3_256: - case GID_INDY3_TOWNS: ADD_BIND("q", "Push"); ADD_BIND("a", "Pull"); ADD_BIND("z", "Give"); @@ -265,8 +261,6 @@ void ScummHelp::updateStrings(byte gameId, byte version, int page, break; case GID_INDY3: case GID_ZAK256: - case GID_INDY3_256: - case GID_INDY3_TOWNS: title = "Other game controls:"; ADD_TEXT("Inventory:"); ADD_BIND("y", "Upper left item"); @@ -291,8 +285,6 @@ void ScummHelp::updateStrings(byte gameId, byte version, int page, case 5: switch (gameId) { case GID_INDY3: - case GID_INDY3_256: - case GID_INDY3_TOWNS: title = "Fighting controls (numpad):"; ADD_BIND("7", "Step back"); ADD_BIND("4", "Step back"); @@ -315,8 +307,6 @@ void ScummHelp::updateStrings(byte gameId, byte version, int page, case 6: switch (gameId) { case GID_INDY3: - case GID_INDY3_256: - case GID_INDY3_TOWNS: title = "Biplane controls (numpad):"; ADD_BIND("7", "Fly to upper left"); ADD_BIND("4", "Fly to left"); diff --git a/scumm/resource_v3.cpp b/scumm/resource_v3.cpp index d4c38d2c23..7ef9c958d0 100644 --- a/scumm/resource_v3.cpp +++ b/scumm/resource_v3.cpp @@ -152,8 +152,9 @@ void Scumm_v3::readIndexFile() { break; default: - // FIXME: this is a little hack because Indy3 FM Towns has 32 bytes appended to 00.LFL. - if (_gameId != GID_INDY3_TOWNS) + // FIXME: this is a little hack because Indy3 FM Towns has + // 32 extra bytes of unknown meaning appended to 00.LFL + if (!(_gameId == GID_INDY3 && _features & GF_FMTOWNS)) error("Bad ID %c%c found in directory!", blocktype & 0xFF, blocktype >> 8); return; } diff --git a/scumm/script.cpp b/scumm/script.cpp index 8281f7ce55..7449391a8a 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -494,7 +494,7 @@ int Scumm::readVar(uint var) { #if defined(BYPASS_COPY_PROT) // INDY3, EGA Loom and, apparently, Zak256 check this // during the game... - if (_gameId == GID_INDY3 && var == 94 && bit == 4) { + if (_gameId == GID_INDY3 && (_features & GF_OLD_BUNDLE) && var == 94 && bit == 4) { return 0; // } else if (_gameId == GID_LOOM && var == 221 && bit == 14) { // For Mac Loom } else if (_gameId == GID_LOOM && var == 214 && bit == 15) { // For PC Loom @@ -508,7 +508,7 @@ int Scumm::readVar(uint var) { } else { var &= 0x7FFF; #if defined(BYPASS_COPY_PROT) - if (_gameId == GID_INDY3_TOWNS && var == 1508) { + if (_gameId == GID_INDY3 && (_features & GF_FMTOWNS) && var == 1508) { return 0; } #endif @@ -518,7 +518,7 @@ int Scumm::readVar(uint var) { } if (var & 0x4000) { - if (_gameId == GID_INDY3_256 || _gameId == GID_INDY3_TOWNS) { + if (_features & GF_FEW_LOCALS) { var &= 0xF; } else { var &= 0xFFF; @@ -585,7 +585,7 @@ void Scumm::writeVar(uint var, int value) { } if (var & 0x4000) { - if (_gameId == GID_INDY3_256 || _gameId == GID_INDY3_TOWNS) { + if (_features & GF_FEW_LOCALS) { var &= 0xF; } else { var &= 0xFFF; @@ -759,13 +759,10 @@ void Scumm::runExitScript() { vm.slot[slot].delayFrameCount = 0; - // FIXME: the exit script of room 7 in indy3 only seems to have a size and tag - // not actual data not even a 00 (stop code) - // maybe we should be limiting ourselves to strictly reading the size - // described in the header? - if (_gameId == GID_INDY3_256 || _gameId == GID_INDY3_TOWNS) { - // FIXME: Oddly, Indy3 seems to contain exit scripts with only a size - // and a tag - not even a terminating NULL! + // FIXME: the exit script of room 7 in indy3 only seems to have a size + // and tag not actual data not even a 00 (stop code). Maybe we should + // be limiting ourselves to strictly reading the size from the header? + if (_gameId == GID_INDY3) { byte *roomptr = getResourceAddress(rtRoom, _roomResource); const byte *excd = findResourceData(MKID('EXCD'), roomptr) - _resourceHeaderSize; if (!excd || (getResourceDataSize(excd) < 1)) { @@ -813,7 +810,7 @@ void Scumm::killScriptsAndResources() { ss->status = ssDead; } else if (ss->where == WIO_LOCAL) { // HACK to make Indy3 Demo work - if (ss->cutsceneOverride != 0 && !(_gameId == GID_INDY3 && _roomResource == 3)) { + if (ss->cutsceneOverride != 0 && !(_gameId == GID_INDY3 && (_features & GF_OLD_BUNDLE) && _roomResource == 3)) { warning("Script %d stopped with active cutscene/override in exit", ss->number); ss->cutsceneOverride = 0; } diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index 95b882ace3..07f50f2605 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -597,7 +597,7 @@ void Scumm_v5::o5_chainScript() { // called via chainScript by script 32, and in there Local[5] is defined // to the actor ID of the opposing soldier. So, we copy that value over // to the Local[5] variable of script 33. - if ((_features & GF_INDY3) && vm.slot[cur].number == 32 && script == 33) { + if (_gameId == GID_INDY3 && vm.slot[cur].number == 32 && script == 33) { vars[5] = vm.localvar[cur][5]; } @@ -665,7 +665,7 @@ void Scumm_v5::o5_cursorCommand() { initCharset(getVarOrDirectByte(0x80)); break; case 14: /* unk */ - if (_features & GF_OLD_BUNDLE || _gameId == GID_INDY3_256 || _gameId == GID_INDY3_TOWNS) { + if (_gameId == GID_LOOM || _gameId == GID_INDY3) { /*int a = */ getVarOrDirectByte(0x80); /*int b = */ getVarOrDirectByte(0x40); // This is some kind of "init charset" opcode. However, we don't have to do anything @@ -679,7 +679,7 @@ void Scumm_v5::o5_cursorCommand() { break; } - if (!(_features & GF_OLD_BUNDLE) && _gameId != GID_INDY3_256 && _gameId != GID_INDY3_TOWNS) { + if (!(_gameId == GID_LOOM || _gameId == GID_INDY3)) { VAR(VAR_CURSORSTATE) = _cursor.state; VAR(VAR_USERPUT) = _userPut; } @@ -966,7 +966,7 @@ void Scumm_v5::o5_getActorScale() { return; // INDY3 uses this opcode as a wait_for_actor(); - if (_features & GF_INDY3) { + if (_gameId == GID_INDY3) { const byte *oldaddr = _scriptPointer - 1; a = derefActor(getVarOrDirectByte(0x80), "o5_getActorScale (wait)"); if (a->moving) { @@ -1000,7 +1000,7 @@ void Scumm_v5::o5_getActorX() { int a; getResultPos(); - if (_features & GF_INDY3) + if (_gameId == GID_INDY3) a = getVarOrDirectByte(0x80); else a = getVarOrDirectWord(0x80); @@ -1012,7 +1012,7 @@ void Scumm_v5::o5_getActorY() { int a; getResultPos(); - if (_features & GF_INDY3) { + if (_gameId == GID_INDY3) { a = getVarOrDirectByte(0x80); // WORKAROUND bug #636433 (can't get into Zeppelin) @@ -2349,7 +2349,7 @@ void Scumm_v5::o5_verbOps() { void Scumm_v5::o5_wait() { const byte *oldaddr = _scriptPointer - 1; - if (_features & GF_INDY3) { + if (_gameId == GID_INDY3) { _opcode = 2; } else _opcode = fetchScriptByte(); @@ -2593,7 +2593,7 @@ void Scumm_v5::decodeParseString() { // It's also needed for Loom, or the lines Bobbin // speaks during the intro are put at position 0,0. // In addition, Loom needs to remember the text colour. - if ((_features & GF_INDY3) || _gameId == GID_LOOM) { + if (_gameId == GID_LOOM || _gameId == GID_INDY3) { _string[textSlot].t_xpos = _string[textSlot].xpos; _string[textSlot].t_ypos = _string[textSlot].ypos; _string[textSlot].t_color = _string[textSlot].color; diff --git a/scumm/scumm.h b/scumm/scumm.h index ad40e83caf..bcdb871372 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -84,8 +84,8 @@ enum GameFeatures { GF_HUMONGOUS = 1 << 14, GF_AFTER_HEV7 = 1 << 15, GF_FMTOWNS = 1 << 16, - GF_INDY3 = 1 << 17, - GF_LOOM = 1 << 18, + GF_FEW_LOCALS = 1 << 17, + GF_LOOM = 1 << 18, // FIXME: remove this GF_EXTERNAL_CHARSET = GF_SMALL_HEADER }; @@ -203,7 +203,6 @@ enum ScummGameId { GID_MONKEY_EGA, GID_LOOM256, GID_ZAK256, - GID_INDY3_256, GID_INDY3, GID_LOOM, GID_FT, @@ -214,8 +213,7 @@ enum ScummGameId { GID_ZAK, GID_PUTTDEMO, GID_PUTTPUTT, - GID_MONKEY_SEGA, - GID_INDY3_TOWNS + GID_MONKEY_SEGA }; #define _maxRooms res.num[rtRoom] diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index 125c9b87c0..b7c5bebf13 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -74,11 +74,11 @@ static const VersionSettings scumm_settings[] = { /* Scumm Version 3 */ {"indy3EGA", "Indiana Jones and the Last Crusade", GID_INDY3, 3, VersionSettings::ADLIB_ALWAYS, - GF_SMALL_HEADER | GF_SMALL_NAMES | GF_NO_SCALING | GF_USE_KEY | GF_16COLOR | GF_OLD_BUNDLE | GF_INDY3, "00.LFL"}, - {"indy3Towns", "Indiana Jones and the Last Crusade (FM Towns)", GID_INDY3_TOWNS, 3, VersionSettings::ADLIB_ALWAYS, - GF_SMALL_HEADER | GF_SMALL_NAMES | GF_NO_SCALING | GF_OLD256 | GF_INDY3 | GF_FMTOWNS | GF_AUDIOTRACKS, "00.LFL"}, - {"indy3", "Indiana Jones and the Last Crusade (256)", GID_INDY3_256, 3, VersionSettings::ADLIB_ALWAYS, - GF_SMALL_HEADER | GF_SMALL_NAMES | GF_NO_SCALING | GF_OLD256 | GF_INDY3, "00.LFL"}, + GF_SMALL_HEADER | GF_SMALL_NAMES | GF_NO_SCALING | GF_USE_KEY | GF_16COLOR | GF_OLD_BUNDLE, "00.LFL"}, + {"indy3Towns", "Indiana Jones and the Last Crusade (FM Towns)", GID_INDY3, 3, VersionSettings::ADLIB_ALWAYS, + GF_SMALL_HEADER | GF_SMALL_NAMES | GF_NO_SCALING | GF_OLD256 | GF_FEW_LOCALS | GF_FMTOWNS | GF_AUDIOTRACKS, "00.LFL"}, + {"indy3", "Indiana Jones and the Last Crusade (256)", GID_INDY3, 3, VersionSettings::ADLIB_ALWAYS, + GF_SMALL_HEADER | GF_SMALL_NAMES | GF_NO_SCALING | GF_OLD256 | GF_FEW_LOCALS, "00.LFL"}, {"zak256", "Zak McKracken and the Alien Mindbenders (256)", GID_ZAK256, 3, VersionSettings::ADLIB_ALWAYS, GF_SMALL_HEADER | GF_SMALL_NAMES | GF_NO_SCALING | GF_OLD256 | GF_FMTOWNS | GF_AUDIOTRACKS, "00.LFL"}, {"loom", "Loom", GID_LOOM, 3, VersionSettings::ADLIB_ALWAYS, @@ -812,7 +812,7 @@ void Scumm::launch() { if (_version < 7) VAR(VAR_VERSION) = 21; - if (_gameId != GID_LOOM && _gameId != GID_INDY3) { + if (!(_features & GF_OLD_BUNDLE && (_gameId == GID_LOOM || _gameId == GID_INDY3))) { // This is the for the Mac version of Indy3/Loom. TODO: add code to properly // distinguish the Mac version from the PC (and other) versions. VAR(VAR_DEBUGMODE) = _debugMode; @@ -1064,7 +1064,7 @@ void Scumm::initScummVars() { VAR(VAR_59) = 3; } - if (_gameId == GID_LOOM || _gameId == GID_INDY3) { + if (_features & GF_OLD_BUNDLE && (_gameId == GID_LOOM || _gameId == GID_INDY3)) { // This is the for the Mac version of Indy3/Loom. TODO: add code to properly // distinguish the Mac version from the PC (and other) versions. VAR(39) = 320; @@ -1183,7 +1183,7 @@ int Scumm::scummLoop(int delta) { VAR(VAR_VIRT_MOUSE_Y) = _virtualMouse.y; VAR(VAR_MOUSE_X) = _mouse.x; VAR(VAR_MOUSE_Y) = _mouse.y; - if (_gameId != GID_LOOM && _gameId != GID_INDY3) { + if (_features & GF_OLD_BUNDLE && (_gameId == GID_LOOM || _gameId == GID_INDY3)) { // This is the for the Mac version of Indy3/Loom. TODO: add code to properly // distinguish the Mac version from the PC (and other) versions. VAR(VAR_DEBUGMODE) = _debugMode; @@ -1721,7 +1721,7 @@ void Scumm::startScene(int room, Actor *a, int objectNr) { if (_gameId == GID_ZAK256 && _roomResource == 15 && ss->number == 202) { // HACK to make Zak256 work (see bug #770093) warning("Script %d stopped with active cutscene/override in exit", ss->number); - } else if (_gameId == GID_INDY3 && _roomResource == 3) { + } else if (_gameId == GID_INDY3 && (_features & GF_OLD_BUNDLE) && _roomResource == 3) { // HACK to make Indy3 Demo work warning("Script %d stopped with active cutscene/override in exit", ss->number); } else { |