aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-01-01 17:57:14 +0000
committerMax Horn2003-01-01 17:57:14 +0000
commit53a8fc24fe6b248234a2e2b5036526097f5a7834 (patch)
tree7eb5dc5a0efaea96302357f3359fab6dbbff4442
parent0ab1edf809972ac94a03d74d72d730a0d72e1184 (diff)
downloadscummvm-rg350-53a8fc24fe6b248234a2e2b5036526097f5a7834.tar.gz
scummvm-rg350-53a8fc24fe6b248234a2e2b5036526097f5a7834.tar.bz2
scummvm-rg350-53a8fc24fe6b248234a2e2b5036526097f5a7834.zip
fixed cutscene override in V8; cleanup
svn-id: r6316
-rw-r--r--scumm/intern.h12
-rw-r--r--scumm/script.cpp20
-rw-r--r--scumm/script_v6.cpp16
-rw-r--r--scumm/script_v8.cpp32
-rw-r--r--scumm/vars.cpp2
5 files changed, 27 insertions, 55 deletions
diff --git a/scumm/intern.h b/scumm/intern.h
index 4a5d3318fa..feb9e578fb 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -335,10 +335,10 @@ protected:
void o6_delaySeconds();
void o6_delayMinutes();
void o6_stopSentence();
- void o6_print_0();
- void o6_print_1();
- void o6_print_2();
- void o6_print_3();
+ void o6_printLine();
+ void o6_printCursor();
+ void o6_printDebug();
+ void o6_printSystem();
void o6_printActor();
void o6_printEgo();
void o6_talkActor();
@@ -413,10 +413,6 @@ protected:
void o8_dim();
void o8_dim2();
void o8_arrayOps();
- void o8_printLine();
- void o8_printCursor();
- void o8_printDebug();
- void o8_printSystem();
void o8_blastText();
void o8_cursorCommand();
diff --git a/scumm/script.cpp b/scumm/script.cpp
index 82311a5207..f64e4658c7 100644
--- a/scumm/script.cpp
+++ b/scumm/script.cpp
@@ -918,7 +918,6 @@ int Scumm::getVerbEntrypoint(int obj, int entry)
void Scumm::endCutscene()
{
ScriptSlot *ss = &vm.slot[_currentScript];
- uint32 *csptr;
int args[16];
memset(args, 0, sizeof(args));
@@ -929,12 +928,11 @@ void Scumm::endCutscene()
args[0] = vm.cutSceneData[vm.cutSceneStackPointer];
_vars[VAR_OVERRIDE] = 0;
- csptr = &vm.cutScenePtr[vm.cutSceneStackPointer];
- if (*csptr && (ss->cutsceneOverride > 0)) // Only terminate if active
+ if (vm.cutScenePtr[vm.cutSceneStackPointer] && (ss->cutsceneOverride > 0)) // Only terminate if active
ss->cutsceneOverride--;
vm.cutSceneScript[vm.cutSceneStackPointer] = 0;
- *csptr = 0;
+ vm.cutScenePtr[vm.cutSceneStackPointer] = 0;
vm.cutSceneStackPointer--;
if (_vars[VAR_CUTSCENE_END_SCRIPT])
@@ -998,14 +996,16 @@ bool Scumm::isRoomScriptRunning(int script)
void Scumm::beginOverride()
{
int idx;
- uint32 *ptr;
idx = vm.cutSceneStackPointer;
- ptr = &vm.cutScenePtr[idx];
+ assert(idx < 5);
- *ptr = _scriptPointer - _scriptOrgPointer;
+ 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();
fetchScriptWord();
_vars[VAR_OVERRIDE] = 0;
@@ -1014,12 +1014,11 @@ void Scumm::beginOverride()
void Scumm::endOverride()
{
int idx;
- uint32 *ptr;
idx = vm.cutSceneStackPointer;
- ptr = &vm.cutScenePtr[idx];
+ assert(idx < 5);
- *ptr = 0;
+ vm.cutScenePtr[idx] = 0;
vm.cutSceneScript[idx] = 0;
_vars[VAR_OVERRIDE] = 0;
}
@@ -1152,6 +1151,7 @@ void Scumm::exitCutscene()
if (ss->cutsceneOverride > 0)
ss->cutsceneOverride--;
+printf("exitCutscene()\n");
_vars[VAR_OVERRIDE] = 1;
vm.cutScenePtr[vm.cutSceneStackPointer] = 0;
}
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index f3a040886d..8320058411 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -268,10 +268,10 @@ void Scumm_v6::setupOpcodes()
OPCODE(o6_delayMinutes),
OPCODE(o6_stopSentence),
/* B4 */
- OPCODE(o6_print_0),
- OPCODE(o6_print_1),
- OPCODE(o6_print_2),
- OPCODE(o6_print_3),
+ OPCODE(o6_printLine),
+ OPCODE(o6_printCursor),
+ OPCODE(o6_printDebug),
+ OPCODE(o6_printSystem),
/* B8 */
OPCODE(o6_printActor),
OPCODE(o6_printEgo),
@@ -2259,23 +2259,23 @@ void Scumm_v6::o6_stopSentence()
clearClickedStatus();
}
-void Scumm_v6::o6_print_0()
+void Scumm_v6::o6_printLine()
{
_actorToPrintStrFor = 0xFF;
decodeParseString(0, 0);
}
-void Scumm_v6::o6_print_1()
+void Scumm_v6::o6_printCursor()
{
decodeParseString(1, 0);
}
-void Scumm_v6::o6_print_2()
+void Scumm_v6::o6_printDebug()
{
decodeParseString(2, 0);
}
-void Scumm_v6::o6_print_3()
+void Scumm_v6::o6_printSystem()
{
decodeParseString(3, 0);
}
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp
index 72a965e288..4bed7f6016 100644
--- a/scumm/script_v8.cpp
+++ b/scumm/script_v8.cpp
@@ -223,11 +223,11 @@ void Scumm_v8::setupOpcodes()
OPCODE(o6_printEgo),
OPCODE(o6_talkActor),
OPCODE(o6_talkEgo),
- OPCODE(o8_printLine),
+ OPCODE(o6_printLine),
/* 94 */
- OPCODE(o8_printCursor),
- OPCODE(o8_printDebug),
- OPCODE(o8_printSystem),
+ OPCODE(o6_printCursor),
+ OPCODE(o6_printDebug),
+ OPCODE(o6_printSystem),
OPCODE(o8_blastText),
/* 98 */
OPCODE(o6_invalid),
@@ -726,30 +726,6 @@ void Scumm_v8::o8_arrayOps()
}
}
-void Scumm_v8::o8_printLine()
-{
- // FIXME
- decodeParseString(0, 0);
-}
-
-void Scumm_v8::o8_printCursor()
-{
- // FIXME
- decodeParseString(1, 0);
-}
-
-void Scumm_v8::o8_printDebug()
-{
- // FIXME
- decodeParseString(2, 0);
-}
-
-void Scumm_v8::o8_printSystem()
-{
- // FIXME
- decodeParseString(3, 0);
-}
-
void Scumm_v8::o8_blastText()
{
// FIXME
diff --git a/scumm/vars.cpp b/scumm/vars.cpp
index 134e5125f0..81edc79d57 100644
--- a/scumm/vars.cpp
+++ b/scumm/vars.cpp
@@ -235,7 +235,7 @@ void Scumm_v8::setupScummVars()
VAR_TIMEDATE_MINUTE = 28;
VAR_TIMEDATE_SECOND = 29;
- //VAR_OVERRIDE = 30; // Oops. 30 has something to do with overrides, but this isn't it..
+ VAR_OVERRIDE = 30;
VAR_ROOM = 31;
//VAR_VOICE_MODE = 39; // 0 is voice, 1 is voice+text, 2 is text only