diff options
author | Filippos Karapetis | 2011-12-13 22:39:34 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-13 22:39:34 +0200 |
commit | f9419db947a8d1cb42ee389b377c7ec6030ad9dd (patch) | |
tree | 3a9de00abf2f29f7f26c16dc56063f95ef4bbc3e | |
parent | c780b58e88f2ae19c3610744bb2c3740e98b3056 (diff) | |
download | scummvm-rg350-f9419db947a8d1cb42ee389b377c7ec6030ad9dd.tar.gz scummvm-rg350-f9419db947a8d1cb42ee389b377c7ec6030ad9dd.tar.bz2 scummvm-rg350-f9419db947a8d1cb42ee389b377c7ec6030ad9dd.zip |
DREAMWEB: Port 'bartender' and 'receptionist' to C++
-rwxr-xr-x | devtools/tasmrecover/tasm-recover | 2 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 81 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 2 | ||||
-rw-r--r-- | engines/dreamweb/people.cpp | 66 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 2 |
5 files changed, 66 insertions, 87 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index c1f2872a8b..42f6e279db 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -229,6 +229,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'autolook', 'autosetwalk', 'backobject', + 'bartender', 'barwoman', 'biblequote', 'blank', @@ -637,6 +638,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'readoneblock', 'readsetdata', 'realcredits', + 'receptionist', 'reconstruct', 'redes', 'redrawmainscrn', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 63942575bf..83b86f9d51 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -26,87 +26,6 @@ namespace DreamGen { -void DreamGenContext::receptionist() { - STACK_CHECK; - checkSpeed(); - if (!flags.z()) - goto gotrecep; - _cmp(data.byte(kCardpassflag), 1); - if (!flags.z()) - goto notsetcard; - _inc(data.byte(kCardpassflag)); - es.byte(bx+7) = 1; - es.word(bx+3) = 64; -notsetcard: - _cmp(es.word(bx+3), 58); - if (!flags.z()) - goto notdes1; - randomNumber(); - _cmp(al, 30); - if (flags.c()) - goto notdes2; - es.word(bx+3) = 55; - goto gotrecep; -notdes1: - _cmp(es.word(bx+3), 60); - if (!flags.z()) - goto notdes2; - randomNumber(); - _cmp(al, 240); - if (flags.c()) - goto gotrecep; - es.word(bx+3) = 53; - goto gotrecep; -notdes2: - _cmp(es.word(bx+3), 88); - if (!flags.z()) - goto notendcard; - es.word(bx+3) = 53; - goto gotrecep; -notendcard: - _inc(es.word(bx+3)); -gotrecep: - showGameReel(); - addToPeopleList(); - al = es.byte(bx+7); - _and(al, 128); - if (flags.z()) - return /* (nottalkedrecep) */; - data.byte(kTalkedtorecep) = 1; -} - -void DreamGenContext::bartender() { - STACK_CHECK; - checkSpeed(); - if (!flags.z()) - goto gotsmoket; - _cmp(es.word(bx+3), 86); - if (!flags.z()) - goto notsmoket1; - randomNumber(); - _cmp(al, 18); - if (flags.c()) - goto notsmoket2; - es.word(bx+3) = 81; - goto gotsmoket; -notsmoket1: - _cmp(es.word(bx+3), 103); - if (!flags.z()) - goto notsmoket2; - es.word(bx+3) = 81; - goto gotsmoket; -notsmoket2: - _inc(es.word(bx+3)); -gotsmoket: - showGameReel(); - _cmp(data.byte(kGunpassflag), 1); - if (!flags.z()) - goto notgotgun; - es.byte(bx+7) = 9; -notgotgun: - addToPeopleList(); -} - void DreamGenContext::helicopter() { STACK_CHECK; ax = es.word(bx+3); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index b7fb2495c5..a8e8a610fd 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -499,7 +499,6 @@ public: void adjustUp(); void fadeScreenDownHalf(); void fadeDownMon(); - void bartender(); void outOfOpen(); void dirCom(); void endGameSeq(); @@ -523,7 +522,6 @@ public: void findInvPos(); void getKeyAndLogo(); void selectOb(); - void receptionist(); void fadeUpMon(); void showDiaryPage(); void reExFromInv(); diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp index 84f6543a19..caaea26d0d 100644 --- a/engines/dreamweb/people.cpp +++ b/engines/dreamweb/people.cpp @@ -29,13 +29,13 @@ static void (DreamGenContext::*reelCallbacks[57])() = { NULL, NULL, NULL, NULL, NULL, NULL, - &DreamGenContext::receptionist, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &DreamGenContext::heavy, NULL, NULL, NULL, - &DreamGenContext::bartender, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -61,13 +61,13 @@ static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = { &DreamGenContext::eden, &DreamGenContext::edenInBath, &DreamGenContext::sparky, &DreamGenContext::smokeBloke, &DreamGenContext::manAsleep, &DreamGenContext::drunk, - /*&DreamGenContext::receptionist*/NULL, &DreamGenContext::genericPerson /*maleFan*/, + &DreamGenContext::receptionist, &DreamGenContext::genericPerson /*maleFan*/, &DreamGenContext::genericPerson /*femaleFan*/, &DreamGenContext::louis, &DreamGenContext::louisChair, &DreamGenContext::soldier1, &DreamGenContext::bossMan, &DreamGenContext::interviewer, /*&DreamGenContext::heavy*/NULL, &DreamGenContext::manAsleep /*manAsleep2*/, &DreamGenContext::genericPerson /*manSatStill*/, &DreamGenContext::drinker, - /*&DreamGenContext::bartender*/NULL, &DreamGenContext::genericPerson /*otherSmoker*/, + &DreamGenContext::bartender, &DreamGenContext::genericPerson /*otherSmoker*/, &DreamGenContext::genericPerson /*tattooMan*/, &DreamGenContext::attendant, &DreamGenContext::keeper, &DreamGenContext::candles1, &DreamGenContext::smallCandle, &DreamGenContext::security, @@ -777,4 +777,62 @@ void DreamGenContext::soldier1(ReelRoutine &routine) { addToPeopleList(&routine); } +void DreamGenContext::receptionist(ReelRoutine &routine) { + if (checkSpeed(routine)) { + if (data.byte(kCardpassflag) == 1) { + // Set card + data.byte(kCardpassflag)++; + routine.b7 = 1; + routine.b3 = 64; + } + + if (routine.b3 != 58) { + // notdes1 + if (routine.b3 != 60) { + // notdes2 + if (routine.b3 != 88) + routine.b3++; // not end card + else + routine.b3 = 53; + } else if (engine->randomNumber() >= 240) { + routine.b3 = 53; + } + } else if (engine->randomNumber() >= 30) { + routine.b3 = 55; + } else { + // notdes2 + if (routine.b3 != 88) + routine.b3++; // not end card + else + routine.b3 = 53; + } + } + + showGameReel(&routine); + addToPeopleList(&routine); + if (routine.b7 & 128) + data.byte(kTalkedtorecep) = 1; +} + +void DreamGenContext::bartender(ReelRoutine &routine) { + if (checkSpeed(routine)) { + if (routine.b3 == 86) { + if (engine->randomNumber() >= 18) + routine.b3 = 81; + else + routine.b3++; // notsmoket2 + } else if (routine.b3 == 103) { + routine.b3 = 81; // notsmoket1 + } else { + routine.b3++; // notsmoket2 + } + } + + showGameReel(&routine); + if (data.byte(kGunpassflag) == 1) + routine.b7 = 9; // got gun + + addToPeopleList(&routine); +} + } // End of namespace DreamGen diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 6a8445b991..5256111cc1 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -417,6 +417,8 @@ void introMonks1(ReelRoutine &routine); void introMonks2(ReelRoutine &routine); void soldier1(ReelRoutine &routine); + void receptionist(ReelRoutine &routine); + void bartender(ReelRoutine &routine); void singleKey(uint8 key, uint16 x, uint16 y); void loadSaveBox(); void loadKeypad(); |