Skip to content

Commit

Permalink
DREAMWEB: 'drinker' ported to C++
Browse files Browse the repository at this point in the history
  • Loading branch information
tramboi committed Dec 1, 2011
1 parent ed30ee8 commit 270eb87
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 26 deletions.
1 change: 1 addition & 0 deletions devtools/tasmrecover/tasm-recover
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'sparkydrip',
'othersmoker',
'barwoman',
'gamer',
], skip_output = [
# These functions are processed but not output
'dreamweb',
Expand Down
22 changes: 0 additions & 22 deletions engines/dreamweb/dreamgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -908,28 +908,6 @@ void DreamGenContext::bossman() {
data.byte(kTalkedtoboss) = 1;
}

void DreamGenContext::gamer() {
STACK_CHECK;
checkspeed();
if (!flags.z())
goto gamerfin;
gameragain:
randomnum1();
_and(al, 7);
_cmp(al, 5);
if (!flags.c())
goto gameragain;
_add(al, 20);
_cmp(al, es.byte(bx+3));
if (flags.z())
goto gameragain;
ah = 0;
es.word(bx+3) = ax;
gamerfin:
showgamereel();
addtopeoplelist();
}

void DreamGenContext::carparkdrip() {
STACK_CHECK;
checkspeed();
Expand Down
2 changes: 0 additions & 2 deletions engines/dreamweb/dreamgen.h
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ class DreamGenContext : public Context {
static const uint16 addr_candles1 = 0xc08c;
static const uint16 addr_keeper = 0xc088;
static const uint16 addr_carparkdrip = 0xc084;
static const uint16 addr_gamer = 0xc07c;
static const uint16 addr_bossman = 0xc078;
static const uint16 addr_heavy = 0xc074;
static const uint16 addr_security = 0xc070;
Expand Down Expand Up @@ -1363,7 +1362,6 @@ class DreamGenContext : public Context {
void afterintroroom();
void buttonnine();
void findallopen();
void gamer();
void readfromfile();
void initialinv();
void quitsymbol();
Expand Down
17 changes: 15 additions & 2 deletions engines/dreamweb/sprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ void DreamGenContext::showrain() {
}

static void (DreamGenContext::*reelCallbacks[57])() = {
&DreamGenContext::gamer, NULL,
NULL, NULL,
&DreamGenContext::eden, &DreamGenContext::edeninbath,
&DreamGenContext::sparky, &DreamGenContext::smokebloke,
&DreamGenContext::manasleep, &DreamGenContext::drunk,
Expand Down Expand Up @@ -600,7 +600,7 @@ static void (DreamGenContext::*reelCallbacks[57])() = {
};

static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = {
/*&DreamGenContext::gamer*/NULL, &DreamGenContext::sparkydrip,
&DreamGenContext::gamer, &DreamGenContext::sparkydrip,
/*&DreamGenContext::eden*/NULL, /*&DreamGenContext::edeninbath*/NULL,
/*&DreamGenContext::sparky*/NULL, /*&DreamGenContext::smokebloke*/NULL,
/*&DreamGenContext::manasleep*/NULL, /*&DreamGenContext::drunk*/NULL,
Expand Down Expand Up @@ -1087,5 +1087,18 @@ void DreamGenContext::othersmoker(ReelRoutine &routine) {
addtopeoplelist(&routine);
}

void DreamGenContext::gamer(ReelRoutine &routine) {
if (checkspeed(&routine)) {
uint8 v;
do {
v = 20 + engine->randomNumber() % 5;
} while (v == routine.reelPointer());
routine.setReelPointer(v);
}

showgamereel(&routine);
addtopeoplelist(&routine);
}

} /*namespace dreamgen */

1 change: 1 addition & 0 deletions engines/dreamweb/stubs.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,4 +379,5 @@
void checkspeed();
void sparkydrip(ReelRoutine &routine);
void othersmoker(ReelRoutine &routine);
void gamer(ReelRoutine &routine);

0 comments on commit 270eb87

Please sign in to comment.