diff options
author | Filippos Karapetis | 2011-12-12 23:39:29 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-12 23:39:29 +0200 |
commit | 27f5661dfc5d49571499501e68db96fe30d272de (patch) | |
tree | 0d8236174c460eb989c854f634f71597368010c6 /engines/dreamweb | |
parent | 47c4b2b7dee13ade60c7810e0d4f216a5ee69e3a (diff) | |
download | scummvm-rg350-27f5661dfc5d49571499501e68db96fe30d272de.tar.gz scummvm-rg350-27f5661dfc5d49571499501e68db96fe30d272de.tar.bz2 scummvm-rg350-27f5661dfc5d49571499501e68db96fe30d272de.zip |
DREAMWEB: Port 'useslab' to C++
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 50 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/use.cpp | 33 |
4 files changed, 34 insertions, 51 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 3cc0c4e862..a2d8c2c70f 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -3637,56 +3637,6 @@ alreadyfull: putBackObStuff(); } -void DreamGenContext::useSLab() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto slabwith; - withWhat(); - return; -slabwith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'J'; - ch = 'E'; - dl = 'W'; - dh = 'L'; - compare(); - if (flags.z()) - goto nextslab; - cx = 300; - al = 14; - showPuzText(); - putBackObStuff(); - return; -nextslab: - al = data.byte(kWithobject); - getExAd(); - es.byte(bx+2) = 0; - al = data.byte(kCommand); - push(ax); - removeSetObject(); - ax = pop(); - _inc(al); - push(ax); - placeSetObject(); - ax = pop(); - _cmp(al, 54); - if (!flags.z()) - goto notlastslab; - al = 0; - turnPathOn(); - data.word(kWatchingtime) = 22; - data.word(kReeltowatch) = 35; - data.word(kEndwatchreel) = 48; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; -notlastslab: - _inc(data.byte(kProgresspoints)); - showFirstUse(); - data.byte(kGetback) = 1; -} - void DreamGenContext::useOpenBox() { STACK_CHECK; _cmp(data.byte(kWithobject), 255); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index b87d9c64de..6e8400b58e 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -508,7 +508,6 @@ public: void dirCom(); void endGameSeq(); void findFirstPath(); - void useSLab(); void useAltar(); void startTalk(); void getAnyAd(); diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index a6e29f2192..ff7c1106a6 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -331,6 +331,7 @@ void useWindow(); void useHatch(); void useLighter(); + void useSLab(); void wheelSound(); void callHotelLift(); void useShield(); diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index eb3281150d..f6d6b2f494 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1281,4 +1281,37 @@ void DreamGenContext::useControl() { } } +void DreamGenContext::useSLab() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'J', 'E', 'W', 'L' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + showPuzText(14, 300); + putBackObStuff(); + return; + } + + DynObject *exObject = getExAd(data.byte(kWithobject)); + exObject->mapad[0] = 0; + + removeSetObject(data.byte(kCommand)); + placeSetObject(data.byte(kCommand) + 1); + if (data.byte(kCommand) + 1 == 54) { + // Last slab + turnPathOn(0); + data.word(kWatchingtime) = 22; + data.word(kReeltowatch) = 35; + data.word(kEndwatchreel) = 48; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + } + + data.byte(kProgresspoints)++; + showFirstUse(); + data.byte(kGetback) = 1; +} + } // End of namespace DreamGen |