aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter van Niftrik2017-02-20 17:21:51 +0100
committerWalter van Niftrik2017-02-20 17:22:28 +0100
commit2cc4c7329cf949f69734083524595295bc8c8266 (patch)
treec765417dd14bdaf7ffcb8d66409075cb2ed5a899
parent2963af577505325dc578bad096d64499e0823a34 (diff)
downloadscummvm-rg350-2cc4c7329cf949f69734083524595295bc8c8266.tar.gz
scummvm-rg350-2cc4c7329cf949f69734083524595295bc8c8266.tar.bz2
scummvm-rg350-2cc4c7329cf949f69734083524595295bc8c8266.zip
ADL: Implement hires6 game loop hacks
-rw-r--r--engines/adl/hires6.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/engines/adl/hires6.cpp b/engines/adl/hires6.cpp
index 03c9b1c923..347a4f2e69 100644
--- a/engines/adl/hires6.cpp
+++ b/engines/adl/hires6.cpp
@@ -44,6 +44,7 @@ public:
private:
// AdlEngine
+ void gameLoop();
void setupOpcodeTables();
void runIntro();
void init();
@@ -67,6 +68,29 @@ private:
byte _currVerb, _currNoun;
};
+void HiRes6Engine::gameLoop() {
+ AdlEngine_v5::gameLoop();
+
+ // Variable 25 starts at 5 and counts down every 160 moves.
+ // When it reaches 0, the game ends. This variable determines
+ // what you see when you "LOOK SUNS".
+ // Variable 39 is used to advance the suns based on game events,
+ // so even a fast player will see the suns getting closer together
+ // as he progresses.
+ if (getVar(39) != 0) {
+ if (getVar(39) < getVar(25))
+ setVar(25, getVar(39));
+ setVar(39, 0);
+ }
+
+ if (getVar(25) != 0) {
+ if (getVar(25) > 5)
+ error("Variable 25 has unexpected value %d", getVar(25));
+ if ((6 - getVar(25)) * 160 == _state.moves)
+ setVar(25, getVar(25) - 1);
+ }
+}
+
typedef Common::Functor1Mem<ScriptEnv &, int, HiRes6Engine> OpcodeH6;
#define SetOpcodeTable(x) table = &x;
#define Opcode(x) table->push_back(new OpcodeH6(this, &HiRes6Engine::x))