aboutsummaryrefslogtreecommitdiff
path: root/sword1
diff options
context:
space:
mode:
authorRobert Göffringmann2003-12-21 21:58:36 +0000
committerRobert Göffringmann2003-12-21 21:58:36 +0000
commit7def9b7efb88e5b87546b57ba3f0e55ede6ba72b (patch)
tree8ac8d2a2b452d7cb3fd82555be9dec77028e78af /sword1
parentd2bfdd81163dcafc67f9c9eab0eda24a10d318bc (diff)
downloadscummvm-rg350-7def9b7efb88e5b87546b57ba3f0e55ede6ba72b.tar.gz
scummvm-rg350-7def9b7efb88e5b87546b57ba3f0e55ede6ba72b.tar.bz2
scummvm-rg350-7def9b7efb88e5b87546b57ba3f0e55ede6ba72b.zip
added workaround for scriptbug (fixes ending sequence).
Sword1 is completable now with some graphical glitches left to fix. svn-id: r11841
Diffstat (limited to 'sword1')
-rw-r--r--sword1/logic.cpp16
-rw-r--r--sword1/sworddefs.h1
2 files changed, 12 insertions, 5 deletions
diff --git a/sword1/logic.cpp b/sword1/logic.cpp
index e86a97d6e9..6dca18d031 100644
--- a/sword1/logic.cpp
+++ b/sword1/logic.cpp
@@ -192,8 +192,15 @@ void SwordLogic::processLogic(BsObject *compact, uint32 id) {
break;
case LOGIC_bookmark:
memcpy(&(compact->o_tree.o_script_level), &(compact->o_bookmark.o_script_level), sizeof(ScriptTree));
- compact->o_logic = LOGIC_script;
- logicRet = 1;
+ if (id == GMASTER_79) {
+ // workaround for ending script.
+ // GMASTER_79 is not prepared for mega_interact receiving INS_quit
+ fnSuicide(compact, id, 0, 0, 0, 0, 0, 0);
+ logicRet = 0;
+ } else {
+ compact->o_logic = LOGIC_script;
+ logicRet = 1;
+ }
break;
case LOGIC_speech:
logicRet = speechDriver(compact);
@@ -600,7 +607,7 @@ int SwordLogic::interpretScript(BsObject *compact, int id, Header *scriptModule,
}
break;
case IT_SKIPONTRUE: // skip if expression true
- debug(9, "IT_SKIPONFALSE: %d (%s)", scriptCode[pc], (stack[stackIdx-1] ? "IS TRUE (SKIPPED)" : "IS FALSE (NOT SKIPPED)"));
+ debug(9, "IT_SKIPONTRUE: %d (%s)", scriptCode[pc], (stack[stackIdx-1] ? "IS TRUE (SKIPPED)" : "IS FALSE (NOT SKIPPED)"));
stackIdx--;
if (stack[stackIdx])
pc += scriptCode[pc];
@@ -856,8 +863,7 @@ int SwordLogic::fnFadeDown(BsObject *cpt, int32 id, int32 speed, int32 d, int32
}
int SwordLogic::fnFadeUp(BsObject *cpt, int32 id, int32 speed, int32 d, int32 e, int32 f, int32 z, int32 x) {
- warning("fnFadeUp speed = %d", speed);
- //_screen->fadeUpPalette();
+ _scriptVars[NEW_PALETTE] = 1;
return SCRIPT_CONT;
}
diff --git a/sword1/sworddefs.h b/sword1/sworddefs.h
index c2b558bb07..79d77cc18a 100644
--- a/sword1/sworddefs.h
+++ b/sword1/sworddefs.h
@@ -1533,6 +1533,7 @@ enum ScriptVariableNames {
POCKET_52
};
+#define GMASTER_79 5177345
#define SCR_std_off (0*0x10000 + 6)
#define SCR_exit0 (0*0x10000 + 7)
#define SCR_exit1 (0*0x10000 + 8)