diff options
author | Max Horn | 2003-07-04 12:34:09 +0000 |
---|---|---|
committer | Max Horn | 2003-07-04 12:34:09 +0000 |
commit | fb16fb3e24160ba2472661167eca671bd4f5848b (patch) | |
tree | 53dc89958e153f33c7049002a13e61f89cd406d3 /scumm | |
parent | 1d93949167c43861c6ed3ec605488658a4b873ce (diff) | |
download | scummvm-rg350-fb16fb3e24160ba2472661167eca671bd4f5848b.tar.gz scummvm-rg350-fb16fb3e24160ba2472661167eca671bd4f5848b.tar.bz2 scummvm-rg350-fb16fb3e24160ba2472661167eca671bd4f5848b.zip |
added some very limited support for Mac Loom (text is now properly centered around x:160 instead of x:0); added (commented out) copyprot bypass (but since I am not sure if there was ever a Mac Loom w/o codes, am not sure if this ever should be enabled); added comment regarding the Mac Loom sound format
svn-id: r8737
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/script.cpp | 28 | ||||
-rw-r--r-- | scumm/scummvm.cpp | 19 | ||||
-rw-r--r-- | scumm/sound.cpp | 33 |
3 files changed, 47 insertions, 33 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp index a61f07fcba..b27b3f1b94 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -129,31 +129,6 @@ void Scumm::initializeLocals(int slot, int *vars) { for (i = 0; i < 16; i++) vm.localvar[slot][i] = vars[i]; } - -#if defined(BYPASS_COPY_PROT) && 0 - // Loom will set bit 15 of variable 214 to 1 if the user enters the - // wrong code. But this bit is also used later in the game to determine - // if the user has already learned the fourth note. Therefore any - // interfering directly with this variable may be risky. - // - // Let's try an alternative solution instead. The correct code is - // stored in variables 82-85. Each time the user selects a symbol, - // its ID (0-11) is passed to room-69-203 as local variable 0. Variable - // 98 is 1, 2, 3 or 4 depending on how many symbols the player has - // selected yet. - // - // If the sum of variables 82-85 is 0, the "fail" bit will be set, - // regardless of the player's choice. I don't know why, but it does - // mean that it's safer to change local variable 0 than to change - // variables 82-85. - // - // Update: It has since occured to me that bit 15 could be set to - // indicate that the game is running in "demo" mode. In that case, this - // bypassing mechanism is needlessly complicated after all, and we - // could just make every read of that bit return zero. - if (_gameId == GID_LOOM && _currentRoom == 69 && vm.slot[slot].number == 203) - vm.localvar[slot][0] = _scummVars[81 + _scummVars[98]]; -#endif } int Scumm::getVerbEntrypoint(int obj, int entry) { @@ -521,7 +496,8 @@ int Scumm::readVar(uint var) { // during the game... if (_gameId == GID_INDY3 && var == 94 && bit == 4) { return 0; - } else if (_gameId == GID_LOOM && var == 214 && bit == 15) { +// } else if (_gameId == GID_LOOM && var == 221 && bit == 14) { // For Mac Loom + } else if (_gameId == GID_LOOM && var == 214 && bit == 15) { // For PC Loom return 0; } else if (_gameId == GID_ZAK256 && var == 151 && bit == 8) { return 0; diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index ef5221225a..6736e92ab1 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -959,7 +959,12 @@ void Scumm::initScummVars() { VAR(VAR_V6_EMSSPACE) = 10000; VAR(VAR_59) = 3; - + } + + if (_gameId == GID_LOOM) { + // This is the for the Mac version of Loom. TODO: add code to properly + // distinguish the Mac version from the PC (and other) versions. + VAR(39) = 320; } if (!(_features & GF_NEW_OPCODES)) { @@ -1036,7 +1041,11 @@ int Scumm::scummLoop(int delta) { VAR(VAR_VIRT_MOUSE_Y) = _virtualMouse.y; VAR(VAR_MOUSE_X) = _mouse.x; VAR(VAR_MOUSE_Y) = _mouse.y; - VAR(VAR_DEBUGMODE) = _debugMode; + if (_gameId != GID_LOOM) { + // This is the for the Mac version of Loom. TODO: add code to properly + // distinguish the Mac version from the PC (and other) versions. + VAR(VAR_DEBUGMODE) = _debugMode; + } } if (_features & GF_AUDIOTRACKS) { @@ -2501,7 +2510,11 @@ void Scumm::launch() { if (_version < 7) VAR(VAR_VERSION) = 21; - VAR(VAR_DEBUGMODE) = _debugMode; + if (_gameId != GID_LOOM) { + // This is the for the Mac version of Loom. TODO: add code to properly + // distinguish the Mac version from the PC (and other) versions. + VAR(VAR_DEBUGMODE) = _debugMode; + } } if (_gameId == GID_MONKEY || _gameId == GID_MONKEY_SEGA) diff --git a/scumm/sound.cpp b/scumm/sound.cpp index e8705be378..5a9904f9c6 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -407,14 +407,39 @@ void Sound::playSound(int soundID) { } + if (_scumm->_gameId = GID_LOOM && (READ_LE_UINT16(ptr + 4) == 'so')) { + // Mac version of Loom uses yet another sound format + /* + playSound #9 (room 70) + 000000: 55 00 00 45 73 6f 00 64 01 00 00 00 00 00 00 00 |U..Eso.d........| + 000010: 00 05 00 8e 2a 8f 2d 1c 2a 8f 2a 8f 2d 1c 00 28 |....*.-.*.*.-..(| + 000020: 00 31 00 3a 00 43 00 4c 00 01 00 00 00 01 00 64 |.1.:.C.L.......d| + 000030: 5a 00 01 00 00 00 01 00 64 00 00 01 00 00 00 01 |Z.......d.......| + 000040: 00 64 5a 00 01 00 00 00 01 00 64 5a 00 01 00 00 |.dZ.......dZ....| + 000050: 00 01 00 64 00 00 00 00 00 00 00 07 00 00 00 64 |...d...........d| + 000060: 64 00 00 4e 73 6f 00 64 01 00 00 00 00 00 00 00 |d..Nso.d........| + 000070: 00 05 00 89 3d 57 2d 1c 3d 57 3d 57 2d 1c 00 28 |....=W-.=W=W-..(| + playSound #16 (room 69) + 000000: dc 00 00 a5 73 6f 00 64 01 00 00 00 00 00 00 00 |....so.d........| + 000010: 00 05 00 00 2a 8f 03 e8 03 e8 03 e8 03 e8 00 28 |....*..........(| + 000020: 00 79 00 7f 00 85 00 d6 00 01 00 00 00 19 01 18 |.y..............| + 000030: 2f 00 18 00 01 18 32 00 18 00 01 18 36 00 18 00 |/.....2.....6...| + 000040: 01 18 3b 00 18 00 01 18 3e 00 18 00 01 18 42 00 |..;.....>.....B.| + 000050: 18 00 01 18 47 00 18 00 01 18 4a 00 18 00 01 18 |....G.....J.....| + 000060: 4e 00 10 00 01 18 53 00 10 00 01 18 56 00 10 00 |N.....S.....V...| + 000070: 01 18 5a 00 10 00 02 28 5f 00 01 00 00 00 00 00 |..Z....(_.......| + */ + return; + } + if (_scumm->_features & GF_OLD_BUNDLE && _scumm->_version != 1) { - // FIXME: support amiga sounds - uint16 amigatest; - amigatest = READ_LE_UINT16(ptr + 12); // other versions seem to be 0000 at this point... // hopefully this test is correct // 0xfe7f seems to be sound and 0x764a music - if ((amigatest != 0xfe7f) && (amigatest != 0x764a)) { + bool amigatest = (READ_LE_UINT16(ptr + 12) == 0xfe7f) || (READ_LE_UINT16(ptr + 12) == 0x764a); + if (amigatest) { + // TODO: support amiga sounds + } else { if (_scumm->_playerV2) _scumm->_playerV2->startSound (soundID, ptr); } |