Skip to content

Commit

Permalink
DREAMWEB: 'attendant', 'keeper' ported to C++
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegr committed Dec 7, 2011
1 parent 3962bcb commit a72832d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 39 deletions.
2 changes: 2 additions & 0 deletions devtools/tasmrecover/tasm-recover
Expand Up @@ -155,6 +155,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'allpointer',
'animpointer',
'atmospheres',
'attendant',
'autolook',
'autosetwalk',
'backobject',
Expand Down Expand Up @@ -358,6 +359,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'isitright',
'isitworn',
'issetobonmap',
'keeper',
'kernchars',
'lastdest',
'lastfolder',
Expand Down
33 changes: 0 additions & 33 deletions engines/dreamweb/dreamgen.cpp
Expand Up @@ -93,17 +93,6 @@ void DreamGenContext::receptionist() {
data.byte(kTalkedtorecep) = 1;
}

void DreamGenContext::attendant() {
STACK_CHECK;
showGameReel();
addToPeopleList();
al = es.byte(bx+7);
_and(al, 128);
if (flags.z())
return /* (nottalked) */;
data.byte(kTalkedtoattendant) = 1;
}

void DreamGenContext::louisChair() {
STACK_CHECK;
_cmp(data.byte(kRockstardead), 0);
Expand Down Expand Up @@ -680,28 +669,6 @@ void DreamGenContext::bossMan() {
data.byte(kTalkedtoboss) = 1;
}

void DreamGenContext::keeper() {
STACK_CHECK;
_cmp(data.byte(kKeeperflag), 0);
if (!flags.z())
goto notwaiting;
_cmp(data.word(kReeltowatch), 190);
if (flags.c())
return /* (waiting) */;
_inc(data.byte(kKeeperflag));
ah = es.byte(bx+7);
_and(ah, 127);
_cmp(ah, data.byte(kDreamnumber));
if (flags.z())
return /* (notdiff) */;
al = data.byte(kDreamnumber);
es.byte(bx+7) = al;
return;
notwaiting:
addToPeopleList();
showGameReel();
}

void DreamGenContext::candles1() {
STACK_CHECK;
checkSpeed();
Expand Down
2 changes: 0 additions & 2 deletions engines/dreamweb/dreamgen.h
Expand Up @@ -620,7 +620,6 @@ class DreamGenContext : public Context {
void runIntroSeq();
void advisor();
void allPalette();
void attendant();
void cantDrop();
void copper();
void drinker();
Expand Down Expand Up @@ -735,7 +734,6 @@ class DreamGenContext : public Context {
void monkSpeaking();
void clearRest();
void madmanRun();
void keeper();
void afterNewRoom();
void getExAd();
void closeFile();
Expand Down
31 changes: 27 additions & 4 deletions engines/dreamweb/people.cpp
Expand Up @@ -36,8 +36,8 @@ static void (DreamGenContext::*reelCallbacks[57])() = {
&DreamGenContext::heavy, NULL,
NULL, &DreamGenContext::drinker,
&DreamGenContext::bartender, NULL,
NULL, &DreamGenContext::attendant,
&DreamGenContext::keeper, &DreamGenContext::candles1,
NULL, NULL,
NULL, &DreamGenContext::candles1,
&DreamGenContext::smallCandle, NULL,
&DreamGenContext::copper, &DreamGenContext::poolGuard,
NULL, &DreamGenContext::businessMan,
Expand Down Expand Up @@ -68,8 +68,8 @@ static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = {
/*&DreamGenContext::heavy*/NULL, &DreamGenContext::manAsleep /*manAsleep2*/,
&DreamGenContext::genericPerson /*manSatStill*/, /*&DreamGenContext::drinker*/NULL,
/*&DreamGenContext::bartender*/NULL, &DreamGenContext::genericPerson /*otherSmoker*/,
&DreamGenContext::genericPerson /*tattooMan*/, /*&DreamGenContext::attendant*/NULL,
/*&DreamGenContext::keeper*/NULL, /*&DreamGenContext::candles1*/NULL,
&DreamGenContext::genericPerson /*tattooMan*/, &DreamGenContext::attendant,
&DreamGenContext::keeper, /*&DreamGenContext::candles1*/NULL,
/*&DreamGenContext::smallcandle*/NULL, &DreamGenContext::security,
/*&DreamGenContext::copper*/NULL, /*&DreamGenContext::poolGuard*/NULL,
&DreamGenContext::rockstar, /*&DreamGenContext::businessMan*/NULL,
Expand Down Expand Up @@ -344,6 +344,29 @@ void DreamGenContext::manAsleep(ReelRoutine &routine) {
addToPeopleList(&routine);
}

void DreamGenContext::attendant(ReelRoutine &routine) {
showGameReel(&routine);
addToPeopleList(&routine);
if (routine.b7 & 128)
data.byte(kTalkedtoattendant) = 1;
}

void DreamGenContext::keeper(ReelRoutine &routine) {
if (data.byte(kKeeperflag) != 0) {
// Not waiting
addToPeopleList(&routine);
showGameReel(&routine);
return;
}

if (data.word(kReeltowatch) < 190)
return; // waiting

data.byte(kKeeperflag)++;

if (routine.b7 & 127 != data.byte(kDreamnumber))
routine.b7 = data.byte(kDreamnumber);
}

void DreamGenContext::drunk(ReelRoutine &routine) {
if (data.byte(kGeneraldead))
Expand Down
2 changes: 2 additions & 0 deletions engines/dreamweb/stubs.h
Expand Up @@ -456,6 +456,8 @@
void carParkDrip(ReelRoutine &routine);
void foghornSound(ReelRoutine &routine);
void train(ReelRoutine &routine);
void attendant(ReelRoutine &routine);
void keeper(ReelRoutine &routine);
void singleKey(uint8 key, uint16 x, uint16 y);
void loadSaveBox();
void loadKeypad();
Expand Down

0 comments on commit a72832d

Please sign in to comment.