diff options
author | Torbjörn Andersson | 2003-06-16 11:37:08 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2003-06-16 11:37:08 +0000 |
commit | f339140776e801366289bcc9f2564ef5c3611054 (patch) | |
tree | dc0ed4ac75c875b87934438ee8a21a1beb38619c | |
parent | b95ad2784988b6bfa8f89fb865cb052dc806576e (diff) | |
download | scummvm-rg350-f339140776e801366289bcc9f2564ef5c3611054.tar.gz scummvm-rg350-f339140776e801366289bcc9f2564ef5c3611054.tar.bz2 scummvm-rg350-f339140776e801366289bcc9f2564ef5c3611054.zip |
After some consideration, I've reverted to the old Loom bypassing scheme
since I now believe that the variable is used to indicate that the game is
running in "demo" mode. This way, old savegames will still work.
The new bypassing scheme is still in the file, but commented out. If this
works, we can remove it completely later.
svn-id: r8515
-rw-r--r-- | scumm/script.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp index cefaaca768..8275b8c941 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -130,11 +130,11 @@ void Scumm::initializeLocals(int slot, int *vars) { vm.localvar[slot][i] = vars[i]; } -#if defined(BYPASS_COPY_PROT) +#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 is risky. + // 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, @@ -146,6 +146,11 @@ void Scumm::initializeLocals(int slot, int *vars) { // 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 @@ -509,9 +514,12 @@ int Scumm::readVar(uint var) { var = (var >> 4) & 0xFF; #if defined(BYPASS_COPY_PROT) - // INDY3 checks this during the game... + // INDY3, EGA Loom and, apparently, Zak256 check this + // during the game... if (_gameId == GID_INDY3 && var == 94 && bit == 4) { return 0; + } else if (_gameId == GID_LOOM && var == 214 && bit == 15) { + return 0; } else if (_gameId == GID_ZAK256 && var == 151 && bit == 8) { return 0; } |