diff options
author | Filippos Karapetis | 2011-12-06 17:46:50 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-06 17:46:50 +0200 |
commit | f2829a6a6c033c981514d233119648731ee78310 (patch) | |
tree | 256bd7f7d7378faa8d4a7e92ed94e162ec07f125 /engines/dreamweb | |
parent | ddddce37288c0b72a1194049ce2b882de17cfd3d (diff) | |
download | scummvm-rg350-f2829a6a6c033c981514d233119648731ee78310.tar.gz scummvm-rg350-f2829a6a6c033c981514d233119648731ee78310.tar.bz2 scummvm-rg350-f2829a6a6c033c981514d233119648731ee78310.zip |
DREAMWEB: 'useelvdoor', 'useobject', 'useplinth' ported to C++
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 92 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 3 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 3 | ||||
-rw-r--r-- | engines/dreamweb/use.cpp | 73 |
4 files changed, 76 insertions, 95 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 8b7375302e..8f3d73e4e6 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -5026,30 +5026,6 @@ void DreamGenContext::triggerMessage() { data.byte(kLasttrigger) = 0; } -void DreamGenContext::useObject() { - STACK_CHECK; - data.byte(kWithobject) = 255; - _cmp(data.byte(kCommandtype), 229); - if (flags.z()) - goto alreadyuse; - data.byte(kCommandtype) = 229; - bl = data.byte(kCommand); - bh = data.byte(kObjecttype); - al = 51; - commandWithOb(); -alreadyuse: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (nouse) */; - _and(ax, 1); - if (!flags.z()) - goto douse; - return; -douse: - useRoutine(); -} - void DreamGenContext::runTap() { STACK_CHECK; _cmp(data.byte(kWithobject), 255); @@ -5208,39 +5184,6 @@ alreadyfull: putBackObStuff(); } -void DreamGenContext::usePlinth() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto plinthwith; - withWhat(); - return; -plinthwith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'D'; - ch = 'K'; - dl = 'E'; - dh = 'Y'; - compare(); - if (flags.z()) - goto isrightkey; - showFirstUse(); - putBackObStuff(); - return; -isrightkey: - _inc(data.byte(kProgresspoints)); - showSecondUse(); - data.word(kWatchingtime) = 220; - data.word(kReeltowatch) = 0; - data.word(kEndwatchreel) = 104; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; - al = data.byte(kRoomafterdream); - data.byte(kNewlocation) = al; -} - void DreamGenContext::chewy() { STACK_CHECK; showFirstUse(); @@ -6322,41 +6265,6 @@ axeondoor: data.byte(kGetback) = 1; } -void DreamGenContext::useElvDoor() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto gotdoorwith; - withWhat(); - return; -gotdoorwith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'A'; - ch = 'X'; - dl = 'E'; - dh = 'D'; - compare(); - if (flags.z()) - goto axeondoor; - al = 14; - cx = 300; - showPuzText(); - putBackObStuff(); - return; -axeondoor: - al = 15; - cx = 300; - showPuzText(); - _inc(data.byte(kProgresspoints)); - data.word(kWatchingtime) = 46*2; - data.word(kReeltowatch) = 31; - data.word(kEndwatchreel) = 77; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; -} - void DreamGenContext::withWhat() { STACK_CHECK; createPanel(); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 376815b598..74c425c2f0 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -641,7 +641,6 @@ public: void interviewer(); void getKeyAndLogo(); void selectOb(); - void usePlinth(); void useCooker(); void receptionist(); void selectSlot(); @@ -689,7 +688,6 @@ public: void poolGuard(); void lookAtPlace(); void useAxe(); - void useElvDoor(); void findAllOpen(); void quitSymbol(); void readFromFile(); @@ -794,7 +792,6 @@ public: void openOb(); void createFile(); void useHole(); - void useObject(); void fadeToWhite(); void showLoadOps(); }; diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 9b79e1ec86..c90f80d2a0 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -401,6 +401,9 @@ void useFullCart(); void useClearBox(); void usePlate(); + void usePlinth(); + void useElvDoor(); + void useObject(); void openTVDoor(); void wearWatch(); void wearShades(); diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 18730eea7e..e5a616e61d 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -820,4 +820,77 @@ void DreamGenContext::usePlate() { } } +void DreamGenContext::usePlinth() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'D', 'K', 'E', 'Y' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + // Wrong key + showFirstUse(); + putBackObStuff(); + } else { + data.byte(kProgresspoints)++; + showSecondUse(); + data.word(kWatchingtime) = 220; + data.word(kReeltowatch) = 0; + data.word(kEndwatchreel) = 104; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + data.byte(kNewlocation) = data.byte(kRoomafterdream); + } +} + +void DreamGenContext::useElvDoor() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'A', 'X', 'E', 'D' }; // 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 { + // Axe on door + al = 15; + cx = 300; + showPuzText(); + _inc(data.byte(kProgresspoints)); + data.word(kWatchingtime) = 46*2; + data.word(kReeltowatch) = 31; + data.word(kEndwatchreel) = 77; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::useObject() { + data.byte(kWithobject) = 255; + + if (data.byte(kCommandtype) != 229) { + data.byte(kCommandtype) = 229; + commandWithOb(data.byte(kCommand), data.byte(kObjecttype), 51); + } + +alreadyuse: + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) + return /* (nouse) */; + _and(ax, 1); + if (!flags.z()) + goto douse; + return; +douse: + useRoutine(); +} + } /*namespace dreamgen */ |