aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2011-12-12 17:49:34 +0200
committerFilippos Karapetis2011-12-12 17:49:34 +0200
commit0ade2240d01760b45e133412af9c8315c79fe812 (patch)
treef3f81e8d583d571a8680af4e4d5aebc4099ea12a /engines
parent5bbca0293871f445d3738f2114069aaf69600340 (diff)
downloadscummvm-rg350-0ade2240d01760b45e133412af9c8315c79fe812.tar.gz
scummvm-rg350-0ade2240d01760b45e133412af9c8315c79fe812.tar.bz2
scummvm-rg350-0ade2240d01760b45e133412af9c8315c79fe812.zip
DREAMWEB: Port 'autoappear' to C++
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreamgen.cpp70
-rw-r--r--engines/dreamweb/dreamgen.h1
-rw-r--r--engines/dreamweb/stubs.cpp45
-rw-r--r--engines/dreamweb/stubs.h1
4 files changed, 46 insertions, 71 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 7276445b7f..9ce8c0307d 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -4580,76 +4580,6 @@ void DreamGenContext::removeFreeObject() {
es = pop();
}
-void DreamGenContext::autoAppear() {
- STACK_CHECK;
- _cmp(data.byte(kLocation), 32);
- if (!flags.z())
- goto notinalley;
- al = 5;
- resetLocation();
- al = 10;
- setLocation();
- data.byte(kDestpos) = 10;
- return;
-notinalley:
- _cmp(data.byte(kReallocation), 24);
- if (!flags.z())
- goto notinedens;
- _cmp(data.byte(kGeneraldead), 1);
- if (!flags.z())
- goto edenspart2;
- _inc(data.byte(kGeneraldead));
- al = 44;
- placeSetObject();
- al = 18;
- placeSetObject();
- al = 93;
- placeSetObject();
- al = 92;
- removeSetObject();
- al = 55;
- removeSetObject();
- al = 75;
- removeSetObject();
- al = 84;
- removeSetObject();
- al = 85;
- removeSetObject();
- return;
-edenspart2:
- _cmp(data.byte(kSartaindead), 1);
- if (!flags.z())
- return /* (notedens2) */;
- al = 44;
- removeSetObject();
- al = 93;
- removeSetObject();
- al = 55;
- placeSetObject();
- _inc(data.byte(kSartaindead));
- return;
-notinedens:
- _cmp(data.byte(kReallocation), 25);
- if (!flags.z())
- goto notonsartroof;
- data.byte(kNewsitem) = 3;
- al = 6;
- resetLocation();
- al = 11;
- setLocation();
- data.byte(kDestpos) = 11;
- return;
-notonsartroof:
- _cmp(data.byte(kReallocation), 2);
- if (!flags.z())
- return /* (notinlouiss) */;
- _cmp(data.byte(kRockstardead), 0);
- if (flags.z())
- return /* (notinlouiss) */;
- al = 23;
- placeSetObject();
-}
-
void DreamGenContext::setupTimedUse() {
STACK_CHECK;
_cmp(data.word(kTimecount), 0);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 3da8d8ecb8..811af2fe90 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -589,7 +589,6 @@ public:
void searchForString();
void selectOpenOb();
void useGun();
- void autoAppear();
void useHandle();
void incRyanPage();
void findExObject();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 71a6834b73..90aca9c632 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -4262,4 +4262,49 @@ void DreamGenContext::useButtonA() {
}
}
+void DreamGenContext::autoAppear() {
+ if (data.byte(kLocation) == 32) {
+ // In alley
+ al = 5;
+ resetLocation();
+ setLocation(10);
+ data.byte(kDestpos) = 10;
+ return;
+ }
+
+ if (data.byte(kReallocation) == 24) {
+ // In Eden's apartment
+ if (data.byte(kGeneraldead) == 1) {
+ data.byte(kGeneraldead)++;
+ placeSetObject(44);
+ placeSetObject(18);
+ placeSetObject(93);
+ removeSetObject(92);
+ removeSetObject(55);
+ removeSetObject(75);
+ removeSetObject(84);
+ removeSetObject(85);
+ } else if (data.byte(kSartaindead) == 1) {
+ // Eden's part 2
+ removeSetObject(44);
+ removeSetObject(93);
+ placeSetObject(55);
+ data.byte(kSartaindead)++;
+ }
+ } else {
+ // Not in Eden's
+ if (data.byte(kReallocation) == 25) {
+ // Sart roof
+ data.byte(kNewsitem) = 3;
+ al = 6;
+ resetLocation();
+ setLocation(11);
+ data.byte(kDestpos) = 11;
+ } else {
+ if (data.byte(kReallocation) == 2 && data.byte(kRockstardead) != 0)
+ placeSetObject(23);
+ }
+ }
+}
+
} // End of namespace DreamGen
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 4efcc3c07e..0447a89cc9 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -565,5 +565,6 @@
void monkSpeaking();
void rollEndCredits2();
void useButtonA();
+ void autoAppear();
#endif