aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb
diff options
context:
space:
mode:
authorFilippos Karapetis2011-12-13 10:21:19 +0200
committerFilippos Karapetis2011-12-13 10:22:12 +0200
commit25e42e1baa04013755593db4b46e368e7ff051eb (patch)
tree2ff969ef65e27836b6c32686d91df5b2d54972a2 /engines/dreamweb
parent1305c5ab315c6468076eac07ac8b78c24d695eac (diff)
downloadscummvm-rg350-25e42e1baa04013755593db4b46e368e7ff051eb.tar.gz
scummvm-rg350-25e42e1baa04013755593db4b46e368e7ff051eb.tar.bz2
scummvm-rg350-25e42e1baa04013755593db4b46e368e7ff051eb.zip
DREAMWEB: 'removefreeobject' is unused. Port 'updatesymboltop', 'updatesymbolbot' to C++
Diffstat (limited to 'engines/dreamweb')
-rw-r--r--engines/dreamweb/dreamgen.cpp98
-rw-r--r--engines/dreamweb/dreamgen.h3
-rw-r--r--engines/dreamweb/stubs.cpp74
-rw-r--r--engines/dreamweb/stubs.h2
4 files changed, 76 insertions, 101 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 681bb79085..63942575bf 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -4060,16 +4060,6 @@ void DreamGenContext::findPuzText() {
si = ax;
}
-void DreamGenContext::removeFreeObject() {
- STACK_CHECK;
- push(es);
- push(bx);
- getFreeAd();
- es.byte(bx+2) = 255;
- bx = pop();
- es = pop();
-}
-
void DreamGenContext::useGun() {
STACK_CHECK;
_cmp(data.byte(kObjecttype), 4);
@@ -4247,94 +4237,6 @@ nottvsoldier:
putBackObStuff();
}
-void DreamGenContext::updateSymbolTop() {
- STACK_CHECK;
- _cmp(data.byte(kSymboltopdir), 0);
- if (flags.z())
- return /* (topfinished) */;
- _cmp(data.byte(kSymboltopdir), -1);
- if (flags.z())
- goto backwards;
- _inc(data.byte(kSymboltopx));
- _cmp(data.byte(kSymboltopx), 49);
- if (!flags.z())
- goto notwrapfor;
- data.byte(kSymboltopx) = 0;
- _dec(data.byte(kSymboltopnum));
- _cmp(data.byte(kSymboltopnum), -1);
- if (!flags.z())
- return /* (topfinished) */;
- data.byte(kSymboltopnum) = 5;
- return;
-notwrapfor:
- _cmp(data.byte(kSymboltopx), 24);
- if (!flags.z())
- return /* (topfinished) */;
- data.byte(kSymboltopdir) = 0;
- return;
-backwards:
- _dec(data.byte(kSymboltopx));
- _cmp(data.byte(kSymboltopx), -1);
- if (!flags.z())
- goto notwrapback;
- data.byte(kSymboltopx) = 48;
- _inc(data.byte(kSymboltopnum));
- _cmp(data.byte(kSymboltopnum), 6);
- if (!flags.z())
- return /* (topfinished) */;
- data.byte(kSymboltopnum) = 0;
- return;
-notwrapback:
- _cmp(data.byte(kSymboltopx), 24);
- if (!flags.z())
- return /* (topfinished) */;
- data.byte(kSymboltopdir) = 0;
-}
-
-void DreamGenContext::updateSymbolBot() {
- STACK_CHECK;
- _cmp(data.byte(kSymbolbotdir), 0);
- if (flags.z())
- return /* (botfinished) */;
- _cmp(data.byte(kSymbolbotdir), -1);
- if (flags.z())
- goto backwardsbot;
- _inc(data.byte(kSymbolbotx));
- _cmp(data.byte(kSymbolbotx), 49);
- if (!flags.z())
- goto notwrapforb;
- data.byte(kSymbolbotx) = 0;
- _dec(data.byte(kSymbolbotnum));
- _cmp(data.byte(kSymbolbotnum), -1);
- if (!flags.z())
- return /* (botfinished) */;
- data.byte(kSymbolbotnum) = 5;
- return;
-notwrapforb:
- _cmp(data.byte(kSymbolbotx), 24);
- if (!flags.z())
- return /* (botfinished) */;
- data.byte(kSymbolbotdir) = 0;
- return;
-backwardsbot:
- _dec(data.byte(kSymbolbotx));
- _cmp(data.byte(kSymbolbotx), -1);
- if (!flags.z())
- goto notwrapbackb;
- data.byte(kSymbolbotx) = 48;
- _inc(data.byte(kSymbolbotnum));
- _cmp(data.byte(kSymbolbotnum), 6);
- if (!flags.z())
- return /* (botfinished) */;
- data.byte(kSymbolbotnum) = 0;
- return;
-notwrapbackb:
- _cmp(data.byte(kSymbolbotx), 24);
- if (!flags.z())
- return /* (botfinished) */;
- data.byte(kSymbolbotdir) = 0;
-}
-
void DreamGenContext::showDiaryKeys() {
STACK_CHECK;
_cmp(data.byte(kPresscount), 0);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 3b9c2cf034..b7fb2495c5 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -547,7 +547,6 @@ public:
void fillOpen();
void findSetObject();
void deleteExObject();
- void removeFreeObject();
void lookAtCard();
void helicopter();
void getEitherAd();
@@ -580,12 +579,10 @@ public:
void getExAd();
void initialMonCols();
void execCommand();
- void updateSymbolBot();
void findPuzText();
void swapWithInv();
void adjustRight();
void transferToEx();
- void updateSymbolTop();
void getPersonText();
void parser();
void emergencyPurge();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 97dad08298..6dc74b7309 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -4511,4 +4511,78 @@ void DreamGenContext::selectSlot() {
delPointer();
}
+void DreamGenContext::updateSymbolTop() {
+ if (!data.byte(kSymboltopdir))
+ return; // topfinished
+
+ if (data.byte(kSymboltopdir) == (byte)-1) {
+ // Backward
+ data.byte(kSymboltopx)--;
+ if (data.byte(kSymboltopx) != (byte)-1) {
+ // Not wrapping
+ if (data.byte(kSymboltopx) != 24)
+ return; // topfinished
+ data.byte(kSymboltopdir) = 0;
+ } else {
+ data.byte(kSymboltopx) = 48;
+ data.byte(kSymboltopnum)++;
+ if (data.byte(kSymboltopnum) != 6)
+ return; // topfinished
+ data.byte(kSymboltopnum) = 0;
+ }
+ } else {
+ // Forward
+ data.byte(kSymboltopx)++;
+ if (data.byte(kSymboltopx) != 49) {
+ // Not wrapping
+ if (data.byte(kSymboltopx) != 24)
+ return; // topfinished
+ data.byte(kSymboltopdir) = 0;
+ } else {
+ data.byte(kSymboltopx) = 0;
+ data.byte(kSymboltopnum)--;
+ if (data.byte(kSymboltopnum) != (byte)-1)
+ return; // topfinished
+ data.byte(kSymboltopnum) = 5;
+ }
+ }
+}
+
+void DreamGenContext::updateSymbolBot() {
+ if (!data.byte(kSymbolbotdir))
+ return; // botfinished
+
+ if (data.byte(kSymbolbotdir) == (byte)-1) {
+ // Backward
+ data.byte(kSymbolbotx)--;
+ if (data.byte(kSymbolbotx) != (byte)-1) {
+ // Not wrapping
+ if (data.byte(kSymbolbotx) != 24)
+ return; // botfinished
+ data.byte(kSymbolbotdir) = 0;
+ } else {
+ data.byte(kSymbolbotx) = 48;
+ data.byte(kSymbolbotnum)++;
+ if (data.byte(kSymbolbotnum) != 6)
+ return; // botfinished
+ data.byte(kSymbolbotnum) = 0;
+ }
+ } else {
+ // Forward
+ data.byte(kSymbolbotx)++;
+ if (data.byte(kSymbolbotx) != 49) {
+ // Not wrapping
+ if (data.byte(kSymbolbotx) != 24)
+ return; // botfinished
+ data.byte(kSymbolbotdir) = 0;
+ } else {
+ data.byte(kSymbolbotx) = 0;
+ data.byte(kSymbolbotnum)--;
+ if (data.byte(kSymbolbotnum) != (byte)-1)
+ return; // botfinished
+ data.byte(kSymbolbotnum) = 5;
+ }
+ }
+}
+
} // End of namespace DreamGen
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index ed45e40b8d..6a8445b991 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -577,5 +577,7 @@
void entryAnims();
void triggerMessage(uint16 index);
void processTrigger();
+ void updateSymbolTop();
+ void updateSymbolBot();
#endif