aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2005-09-14 10:35:04 +0000
committerTravis Howell2005-09-14 10:35:04 +0000
commit4645dcb6dd3c3460d7f83d66b6e5cf104b08f843 (patch)
treeb2779dde42604b8728ab988093e1b7145a6f6bb0
parent80fd81f275b50bc9ba39d48352052278ce60a53c (diff)
downloadscummvm-rg350-4645dcb6dd3c3460d7f83d66b6e5cf104b08f843.tar.gz
scummvm-rg350-4645dcb6dd3c3460d7f83d66b6e5cf104b08f843.tar.bz2
scummvm-rg350-4645dcb6dd3c3460d7f83d66b6e5cf104b08f843.zip
Fix skipping cutscenes in C64 maniac.
svn-id: r18820
-rw-r--r--scumm/input.cpp5
-rw-r--r--scumm/intern.h2
-rw-r--r--scumm/script.cpp2
-rw-r--r--scumm/script_c64.cpp15
-rw-r--r--scumm/vars.cpp36
5 files changed, 55 insertions, 5 deletions
diff --git a/scumm/input.cpp b/scumm/input.cpp
index 5e1b56aacb..47dbb8d279 100644
--- a/scumm/input.cpp
+++ b/scumm/input.cpp
@@ -417,8 +417,9 @@ void ScummEngine::processKbd(bool smushMode) {
else
saveloadkey = VAR(VAR_MAINMENU_KEY);
- if (_lastKeyHit == VAR(VAR_CUTSCENEEXIT_KEY) ||
- ((VAR(VAR_CUTSCENEEXIT_KEY) == 4 || VAR(VAR_CUTSCENEEXIT_KEY) == 64) && _lastKeyHit == 27)) {
+ 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)) {
#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/intern.h b/scumm/intern.h
index 36e40c7562..a7165852b0 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -405,6 +405,8 @@ protected:
virtual void executeOpcode(byte i);
virtual const char *getOpcodeDesc(byte i);
+ virtual void setupScummVars();
+
virtual int getVarOrDirectWord(byte mask);
virtual uint fetchScriptWord();
diff --git a/scumm/script.cpp b/scumm/script.cpp
index 67a902ca5e..68fdc9aa36 100644
--- a/scumm/script.cpp
+++ b/scumm/script.cpp
@@ -1170,7 +1170,7 @@ void ScummEngine::abortCutscene() {
if (ss->cutsceneOverride > 0)
ss->cutsceneOverride--;
- VAR(VAR_OVERRIDE) = 1;
+ VAR(6) = 1;
vm.cutScenePtr[idx] = 0;
// HACK to fix issues with SMUSH and the way it does keyboard handling.
diff --git a/scumm/script_c64.cpp b/scumm/script_c64.cpp
index ed448be35c..2ce6a89672 100644
--- a/scumm/script_c64.cpp
+++ b/scumm/script_c64.cpp
@@ -651,9 +651,20 @@ void ScummEngine_c64::o_unknownCD() {
}
void ScummEngine_c64::o_beginOverride() {
+ const int idx = vm.cutSceneStackPointer;
+ assert(0 <= idx && idx < 5);
+
+ vm.cutScenePtr[idx] = _scriptPointer - _scriptOrgPointer;
+ vm.cutSceneScript[idx] = _currentScript;
+
+ // Skip the jump instruction following the override instruction
+ // (the jump is responsible for "skipping" cutscenes, and the reason
+ // why we record the current script position in vm.cutScenePtr).
fetchScriptByte();
- fetchScriptByte();
- fetchScriptByte();
+ ScummEngine::fetchScriptWord();
+
+ // This is based on disassembly
+ VAR(VAR_OVERRIDE) = 0;
}
void ScummEngine_c64::o_isEqual() {
diff --git a/scumm/vars.cpp b/scumm/vars.cpp
index 756eb6f340..35e34da584 100644
--- a/scumm/vars.cpp
+++ b/scumm/vars.cpp
@@ -104,6 +104,42 @@ void ScummEngine::setupScummVars() {
}
}
+void ScummEngine_c64::setupScummVars() {
+ VAR_EGO = 0;
+ VAR_CAMERA_POS_X = 2;
+ VAR_HAVE_MSG = 3;
+ VAR_ROOM = 4;
+ VAR_OVERRIDE = 6;
+ VAR_CHARCOUNT = 7;
+ VAR_ACTIVE_VERB = 8;
+ VAR_ACTIVE_OBJECT1 = 9;
+ VAR_ACTIVE_OBJECT2 = 10;
+ VAR_NUM_ACTOR = 11;
+ VAR_CURRENT_LIGHTS = 12;
+ VAR_CURRENTDRIVE = 13;
+ VAR_MUSIC_TIMER = 17;
+ VAR_VERB_ALLOWED = 18;
+ VAR_ACTOR_RANGE_MIN = 19;
+ VAR_ACTOR_RANGE_MAX = 20;
+ VAR_CURSORSTATE = 21;
+ VAR_CAMERA_MIN_X = 23;
+ VAR_CAMERA_MAX_X = 24;
+ VAR_TIMER_NEXT = 25;
+ VAR_SENTENCE_VERB = 26;
+ VAR_SENTENCE_OBJECT1 = 27;
+ VAR_SENTENCE_OBJECT2 = 28;
+ VAR_SENTENCE_PREPOSITION = 29;
+ VAR_VIRT_MOUSE_X = 30;
+ VAR_VIRT_MOUSE_Y = 31;
+ VAR_CLICK_AREA = 32;
+ VAR_ROOM_RESOURCE = 36;
+ VAR_LAST_SOUND = 37;
+ VAR_BACKUP_VERB = 38;
+ VAR_KEYPRESS = 39;
+ VAR_CUTSCENEEXIT_KEY = 40;
+ VAR_TALK_ACTOR = 41;
+}
+
void ScummEngine_v2::setupScummVars() {
VAR_EGO = 0;
VAR_CAMERA_POS_X = 2;