diff options
author | Filippos Karapetis | 2011-12-06 19:54:03 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-06 19:54:03 +0200 |
commit | 7566d2c985e497ca2bca1db700a9fee7eabf9351 (patch) | |
tree | 4a40d2bb3f089197a36543751e76f94489c0f7bf /engines | |
parent | 6f2f8976ccbaeff14667373712adfdba526b5bf2 (diff) | |
download | scummvm-rg350-7566d2c985e497ca2bca1db700a9fee7eabf9351.tar.gz scummvm-rg350-7566d2c985e497ca2bca1db700a9fee7eabf9351.tar.bz2 scummvm-rg350-7566d2c985e497ca2bca1db700a9fee7eabf9351.zip |
DREAMWEB: 'chewy', 'slabdoorb', 'usecart', 'usehole', 'usetrainer', 'usewinch' ported to C++
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 171 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 6 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 6 | ||||
-rw-r--r-- | engines/dreamweb/use.cpp | 140 |
4 files changed, 145 insertions, 178 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 8f3d73e4e6..3e63d186ce 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -5103,21 +5103,6 @@ void DreamGenContext::openTomb() { data.byte(kGetback) = 1; } -void DreamGenContext::useTrainer() { - STACK_CHECK; - getAnyAd(); - _cmp(es.byte(bx+2), 4); - if (!flags.z()) - goto notheldtrainer; - _inc(data.byte(kProgresspoints)); - makeWorn(); - showSecondUse(); - putBackObStuff(); - return; -notheldtrainer: - notHeldError(); -} - void DreamGenContext::notHeldError() { STACK_CHECK; createPanel(); @@ -5184,54 +5169,6 @@ alreadyfull: putBackObStuff(); } -void DreamGenContext::chewy() { - STACK_CHECK; - showFirstUse(); - getAnyAd(); - es.byte(bx+2) = 255; - data.byte(kGetback) = 1; -} - -void DreamGenContext::sLabDoorB() { - STACK_CHECK; - _cmp(data.byte(kDreamnumber), 1); - if (!flags.z()) - goto slabbwrong; - al = 'S'; - ah = 'H'; - cl = 'L'; - ch = 'D'; - isRyanHolding(); - if (!flags.z()) - goto gotcrystal; - al = 44; - cx = 200; - showPuzText(); - putBackObStuff(); - return; -gotcrystal: - showFirstUse(); - _inc(data.byte(kProgresspoints)); - data.byte(kGetback) = 1; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kReeltowatch) = 44; - data.word(kWatchingtime) = 60; - data.word(kEndwatchreel) = 71; - data.byte(kNewlocation) = 47; - return; -slabbwrong: - showFirstUse(); - data.byte(kGetback) = 1; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kReeltowatch) = 44; - data.word(kWatchingtime) = 40; - data.word(kEndwatchreel) = 63; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; -} - void DreamGenContext::useSLab() { STACK_CHECK; _cmp(data.byte(kWithobject), 255); @@ -5282,45 +5219,6 @@ notlastslab: data.byte(kGetback) = 1; } -void DreamGenContext::useCart() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto cartwith; - withWhat(); - return; -cartwith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'R'; - ch = 'O'; - dl = 'C'; - dh = 'K'; - compare(); - if (flags.z()) - goto nextcart; - cx = 300; - al = 14; - showPuzText(); - putBackObStuff(); - return; -nextcart: - al = data.byte(kWithobject); - getExAd(); - es.byte(bx+2) = 0; - al = data.byte(kCommand); - push(ax); - removeSetObject(); - ax = pop(); - _inc(al); - placeSetObject(); - _inc(data.byte(kProgresspoints)); - al = 17; - playChannel1(); - showFirstUse(); - data.byte(kGetback) = 1; -} - void DreamGenContext::useOpenBox() { STACK_CHECK; _cmp(data.byte(kWithobject), 255); @@ -5373,39 +5271,6 @@ openboxwrong: putBackObStuff(); } -void DreamGenContext::useHole() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto holewith; - withWhat(); - return; -holewith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'H'; - ch = 'N'; - dl = 'D'; - dh = 'A'; - compare(); - if (flags.z()) - goto righthand; - cx = 300; - al = 14; - showPuzText(); - putBackObStuff(); - return; -righthand: - showFirstUse(); - al = 86; - removeSetObject(); - al = data.byte(kWithobject); - getExAd(); - es.byte(bx+2) = 255; - data.byte(kCanmovealtar) = 1; - data.byte(kGetback) = 1; -} - void DreamGenContext::useAltar() { STACK_CHECK; al = 'C'; @@ -6836,42 +6701,6 @@ donethisbit: putBackObStuff(); } -void DreamGenContext::useWinch() { - STACK_CHECK; - al = 40; - ah = 1; - checkInside(); - _cmp(cl, (114)); - if (flags.z()) - goto nowinch; - al = cl; - ah = 4; - cl = 'F'; - ch = 'U'; - dl = 'S'; - dh = 'E'; - compare(); - if (!flags.z()) - goto nowinch; - data.word(kWatchingtime) = 217*2; - data.word(kReeltowatch) = 0; - data.word(kEndwatchreel) = 217; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kDestpos) = 1; - data.byte(kNewlocation) = 45; - data.byte(kDreamnumber) = 1; - data.byte(kRoomafterdream) = 44; - data.byte(kGeneraldead) = 1; - data.byte(kNewsitem) = 2; - data.byte(kGetback) = 1; - _inc(data.byte(kProgresspoints)); - return; -nowinch: - showFirstUse(); - putBackObStuff(); -} - void DreamGenContext::quitKey() { STACK_CHECK; _cmp(data.byte(kCommandtype), 222); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 74c425c2f0..93f62691b0 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -575,7 +575,6 @@ public: void getOpenedSize(); void resetKeyboard(); void soundStartup(); - void sLabDoorB(); void adjustUp(); void fadeScreenDownHalf(); void mouseCall(); @@ -681,7 +680,6 @@ public: void deleteExFrame(); void bossMan(); void searchForSame(); - void chewy(); void getBack1(); void fadeFromWhite(); void rollEm(); @@ -708,7 +706,6 @@ public: void candles1(); void showOpBox(); void doFade(); - void useTrainer(); void dumpCurrent(); void showDiaryKeys(); void dontLoadSeg(); @@ -766,7 +763,6 @@ public: void monkAndRyan(); void swapWithInv(); void useControl(); - void useWinch(); void updateSymbolTop(); void checkSoundInt(); void doSaveLoad(); @@ -782,7 +778,6 @@ public: void saveFileRead(); void emergencyPurge(); void alleyBarkSound(); - void useCart(); void quitKey(); void processTrigger(); void volumeAdjust(); @@ -791,7 +786,6 @@ public: void withWhat(); void openOb(); void createFile(); - void useHole(); void fadeToWhite(); void showLoadOps(); }; diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index c90f80d2a0..e275d1d2f0 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -404,6 +404,7 @@ void usePlinth(); void useElvDoor(); void useObject(); + void useWinch(); void openTVDoor(); void wearWatch(); void wearShades(); @@ -536,7 +537,12 @@ void setWalk(); void useLadder(); void useLadderB(); + void useCart(); + void useTrainer(); + void useHole(); + void chewy(); void sLabDoorA(); + void sLabDoorB(); void sLabDoorC(); void sLabDoorE(); void sLabDoorD(); diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index e37e8d4e93..f8a3054e65 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -612,6 +612,46 @@ void DreamGenContext::sLabDoorA() { } } +void DreamGenContext::sLabDoorB() { + if (data.byte(kDreamnumber) != 1) { + // Wrong + showFirstUse(); + data.byte(kGetback) = 1; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kReeltowatch) = 44; + data.word(kWatchingtime) = 40; + data.word(kEndwatchreel) = 63; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + } else { + al = 'S'; + ah = 'H'; + cl = 'L'; + ch = 'D'; + isRyanHolding(); + + if (flags.z()) { + // No crystal + al = 44; + cx = 200; + showPuzText(); + putBackObStuff(); + } else { + // Got crystal + showFirstUse(); + data.byte(kProgresspoints)++; + data.byte(kGetback) = 1; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kReeltowatch) = 44; + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 71; + data.byte(kNewlocation) = 47; + } + } +} + void DreamGenContext::sLabDoorC() { showFirstUse(); data.byte(kGetback) = 1; @@ -863,7 +903,7 @@ void DreamGenContext::useElvDoor() { cx = 300; showPuzText(); _inc(data.byte(kProgresspoints)); - data.word(kWatchingtime) = 46*2; + data.word(kWatchingtime) = 46 * 2; data.word(kReeltowatch) = 31; data.word(kEndwatchreel) = 77; data.byte(kWatchspeed) = 1; @@ -887,4 +927,102 @@ void DreamGenContext::useObject() { useRoutine(); } + +void DreamGenContext::useWinch() { + al = 40; + ah = 1; + checkInside(); + + char id[4] = { 'F', 'U', 'S', 'E' }; // TODO: convert to string with trailing zero + if (cl == 114 || !compare(cl, 4, id)) { + // No winch + showFirstUse(); + putBackObStuff(); + return; + } + + data.word(kWatchingtime) = 217 * 2; + data.word(kReeltowatch) = 0; + data.word(kEndwatchreel) = 217; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kDestpos) = 1; + data.byte(kNewlocation) = 45; + data.byte(kDreamnumber) = 1; + data.byte(kRoomafterdream) = 44; + data.byte(kGeneraldead) = 1; + data.byte(kNewsitem) = 2; + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; +} + +void DreamGenContext::useCart() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'R', 'O', 'C', 'K' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + // Wrong item + cx = 300; + al = 14; + showPuzText(); + putBackObStuff(); + } else { + DynObject *exObject = getExAd(data.byte(kWithobject)); + exObject->mapad[0] = 0; + removeSetObject(data.byte(kCommand)); + placeSetObject(data.byte(kWithobject) + 1); + data.byte(kProgresspoints)++; + playChannel1(17); + showFirstUse(); + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::useTrainer() { + // TODO: Use the C++ version of getAnyAd() + getAnyAd(); + if (es.byte(bx + 2) != 4) { + notHeldError(); + } else { + data.byte(kProgresspoints)++; + makeWorn(); + showSecondUse(); + putBackObStuff(); + } +} + +void DreamGenContext::chewy() { + showFirstUse(); + // TODO: Use the C++ version of getAnyAd() + getAnyAd(); + es.byte(bx + 2) = 255; + data.byte(kGetback) = 1; +} + +void DreamGenContext::useHole() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'H', 'N', 'D', 'A' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + // Wrong item + cx = 300; + al = 14; + showPuzText(); + putBackObStuff(); + } else { + showFirstUse(); + removeSetObject(86); + DynObject *exObject = getExAd(data.byte(kWithobject)); + exObject->mapad[0] = 255; + data.byte(kCanmovealtar) = 1; + data.byte(kGetback) = 1; + } +} + } /*namespace dreamgen */ |