aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBertrand Augereau2011-12-04 14:22:13 +0100
committerBertrand Augereau2011-12-04 14:39:29 +0100
commit3956046e50630e711dc705dbb3d8dedcac870ad5 (patch)
tree369289828eaf5a9dcc8c9c973f9536594e5ef022 /engines
parentd9e31be349b38313cc2be8cf68ec801494bac08b (diff)
downloadscummvm-rg350-3956046e50630e711dc705dbb3d8dedcac870ad5.tar.gz
scummvm-rg350-3956046e50630e711dc705dbb3d8dedcac870ad5.tar.bz2
scummvm-rg350-3956046e50630e711dc705dbb3d8dedcac870ad5.zip
DREAMWEB: 'smokeBloke' ported to C++
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreamgen.cpp41
-rw-r--r--engines/dreamweb/dreamgen.h1
-rw-r--r--engines/dreamweb/people.cpp25
-rw-r--r--engines/dreamweb/stubs.h1
4 files changed, 24 insertions, 44 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 2ae5cc5107..bd861ca4e3 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -107,47 +107,6 @@ gotrecep:
data.byte(kTalkedtorecep) = 1;
}
-void DreamGenContext::smokeBloke() {
- STACK_CHECK;
- _cmp(data.byte(kRockstardead), 0);
- if (!flags.z())
- goto notspokento;
- al = es.byte(bx+7);
- _and(al, 128);
- if (flags.z())
- goto notspokento;
- push(es);
- push(bx);
- al = 5;
- setLocation();
- bx = pop();
- es = pop();
-notspokento:
- checkSpeed();
- if (!flags.z())
- goto gotsmokeb;
- _cmp(es.word(bx+3), 100);
- if (!flags.z())
- goto notsmokeb1;
- randomNumber();
- _cmp(al, 30);
- if (flags.c())
- goto notsmokeb2;
- es.word(bx+3) = 96;
- goto gotsmokeb;
-notsmokeb1:
- _cmp(es.word(bx+3), 117);
- if (!flags.z())
- goto notsmokeb2;
- es.word(bx+3) = 96;
- goto gotsmokeb;
-notsmokeb2:
- _inc(es.word(bx+3));
-gotsmokeb:
- showGameReel();
- addToPeopleList();
-}
-
void DreamGenContext::attendant() {
STACK_CHECK;
showGameReel();
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 8fa0c25b70..f7aa6c6d0a 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -789,7 +789,6 @@ public:
void useLadder();
void realCredits();
void handClap();
- void smokeBloke();
void afterIntroRoom();
void findAllOpen();
void readFromFile();
diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp
index 6479d29022..a05d892c65 100644
--- a/engines/dreamweb/people.cpp
+++ b/engines/dreamweb/people.cpp
@@ -27,7 +27,7 @@ namespace DreamGen {
static void (DreamGenContext::*reelCallbacks[57])() = {
NULL, NULL,
NULL, &DreamGenContext::edenInBath,
- NULL, &DreamGenContext::smokeBloke,
+ NULL, NULL,
&DreamGenContext::manAsleep, &DreamGenContext::drunk,
&DreamGenContext::receptionist, NULL,
NULL, &DreamGenContext::louis,
@@ -59,7 +59,7 @@ static void (DreamGenContext::*reelCallbacks[57])() = {
static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = {
&DreamGenContext::gamer, &DreamGenContext::sparkyDrip,
&DreamGenContext::eden, /*&DreamGenContext::edenInBath*/NULL,
- &DreamGenContext::sparky, /*&DreamGenContext::smokeBloke*/NULL,
+ &DreamGenContext::sparky, &DreamGenContext::smokeBloke,
/*&DreamGenContext::manAsleep*/NULL, /*&DreamGenContext::drunk*/NULL,
/*&DreamGenContext::receptionist*/NULL, &DreamGenContext::maleFan,
&DreamGenContext::femaleFan, /*&DreamGenContext::louis*/NULL,
@@ -327,5 +327,26 @@ void DreamGenContext::madmansTelly(ReelRoutine &routine) {
showGameReel(&routine);
}
+
+void DreamGenContext::smokeBloke(ReelRoutine &routine) {
+ if (data.byte(kRockstardead) == 0) {
+ if (routine.b7 & 128)
+ setLocation(5);
+ }
+ if (checkSpeed(&routine)) {
+ if (routine.reelPointer() == 100) {
+ if (engine->randomNumber() < 30)
+ routine.incReelPointer();
+ else
+ routine.setReelPointer(96);
+ } else if (routine.reelPointer() == 117)
+ routine.setReelPointer(96);
+ else
+ routine.incReelPointer();
+ }
+ showGameReel(&routine);
+ addToPeopleList(&routine);
+}
+
} /*namespace dreamgen */
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 6414a4e914..7339f937bc 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -397,6 +397,7 @@
void maleFan(ReelRoutine &routine);
void rockstar(ReelRoutine &routine);
void madmansTelly(ReelRoutine &routine);
+ void smokeBloke(ReelRoutine &routine);
void singleKey(uint8 key, uint16 x, uint16 y);
void showKeypad();
void showOuterPad();