aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2005-11-20 09:10:18 +0000
committerTravis Howell2005-11-20 09:10:18 +0000
commite091f3bd4213291567ebde1a84d1224a9e8e6014 (patch)
treee76e9f2c41e4424b9011bd0ab0b1fa1699b03d4c
parent832c9a1b490abd8d1ec374d5c8519ad57085287e (diff)
downloadscummvm-rg350-e091f3bd4213291567ebde1a84d1224a9e8e6014.tar.gz
scummvm-rg350-e091f3bd4213291567ebde1a84d1224a9e8e6014.tar.bz2
scummvm-rg350-e091f3bd4213291567ebde1a84d1224a9e8e6014.zip
Fix skipping cutscene in Commodore 64 version of zak.
svn-id: r19674
-rw-r--r--scumm/input.cpp13
-rw-r--r--scumm/script_v2.cpp6
2 files changed, 12 insertions, 7 deletions
diff --git a/scumm/input.cpp b/scumm/input.cpp
index 94a5437646..7c6735f959 100644
--- a/scumm/input.cpp
+++ b/scumm/input.cpp
@@ -258,20 +258,20 @@ void ScummEngine::processKbd(bool smushMode) {
}
}
- if (_leftBtnPressed & msClicked && _rightBtnPressed & msClicked && _version > 3) {
+ if (_leftBtnPressed & msClicked && _rightBtnPressed & msClicked && _version >= 4) {
// Pressing both mouse buttons is treated as if you pressed
// the cutscene exit key (i.e. ESC in most games). That mimicks
// the behaviour of the original engine where pressing both
// mouse buttons also skips the current cutscene.
_mouseAndKeyboardStat = 0;
_lastKeyHit = (uint)VAR(VAR_CUTSCENEEXIT_KEY);
- } else if (_rightBtnPressed & msClicked && (_version < 4 && _gameId != GID_LOOM)) {
+ } else if (_rightBtnPressed & msClicked && (_version <- 3 && _gameId != GID_LOOM)) {
// Pressing right mouse button is treated as if you pressed
// the cutscene exit key (i.e. ESC in most games). That mimicks
// the behaviour of the original engine where pressing right
// mouse button also skips the current cutscene.
_mouseAndKeyboardStat = 0;
- _lastKeyHit = (uint)VAR(VAR_CUTSCENEEXIT_KEY);
+ _lastKeyHit = (VAR_CUTSCENEEXIT_KEY != 0xFF) ? (uint)VAR(VAR_CUTSCENEEXIT_KEY) : 27;
} else if (_leftBtnPressed & msClicked) {
_mouseAndKeyboardStat = MBS_LEFT_CLICK;
} else if (_rightBtnPressed & msClicked) {
@@ -305,11 +305,11 @@ void ScummEngine::processKbd(bool smushMode) {
if (_lastKeyHit == KEY_ALL_SKIP) {
// Skip cutscene
if (smushMode) {
- _lastKeyHit = (uint)VAR(VAR_CUTSCENEEXIT_KEY);
+ _lastKeyHit = (VAR_CUTSCENEEXIT_KEY != 0xFF) ? (uint)VAR(VAR_CUTSCENEEXIT_KEY) : 27;
}
else
if (vm.cutScenePtr[vm.cutSceneStackPointer])
- _lastKeyHit = (uint)VAR(VAR_CUTSCENEEXIT_KEY);
+ _lastKeyHit = (VAR_CUTSCENEEXIT_KEY != 0xFF) ? (uint)VAR(VAR_CUTSCENEEXIT_KEY) : 27;
else
// Skip talk
if (VAR_TALKSTOP_KEY != 0xFF && _talkDelay > 0)
@@ -380,8 +380,7 @@ void ScummEngine::processKbd(bool smushMode) {
saveloadkey = VAR(VAR_MAINMENU_KEY);
if ((_platform == Common::kPlatformC64 && _gameId == GID_MANIAC && _lastKeyHit == 27) ||
- ((VAR(VAR_CUTSCENEEXIT_KEY) == 4 || VAR(VAR_CUTSCENEEXIT_KEY) == 64) && _lastKeyHit == 27) ||
- _lastKeyHit == VAR(VAR_CUTSCENEEXIT_KEY)) {
+ (VAR_CUTSCENEEXIT_KEY != 0xFF && _lastKeyHit == VAR(VAR_CUTSCENEEXIT_KEY))) {
#ifndef DISABLE_SCUMM_7_8
// Skip cutscene (or active SMUSH video). For the V2 games, which
// normally use F4 for this, we add in a hack that makes escape work,
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index a298a21603..88fa27dace 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -445,6 +445,12 @@ void ScummEngine_v2::writeVar(uint var, int value) {
checkRange(_numVariables - 1, 0, var, "Variable %d out of range(r)");
debugC(DEBUG_VARS, "writeVar(%d) = %d", var, value);
+ if (VAR_CUTSCENEEXIT_KEY != 0xFF && var == VAR_CUTSCENEEXIT_KEY) {
+ // Remap the cutscene exit key in earlier games
+ if (value == 4 || value == 13 || value == 64)
+ value = 27;
+ }
+
_scummVars[var] = value;
// HACK: Ender's hack around a bug in Maniac. If you take the last dime from