diff options
author | Filippos Karapetis | 2011-12-12 17:59:36 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-12 17:59:36 +0200 |
commit | 903ce79138c52a8ecde29a99964ed2dc3ec373ad (patch) | |
tree | ed94cfaa9e154b6afb84c5defa6b86c1bdd0eb7d | |
parent | 0ade2240d01760b45e133412af9c8315c79fe812 (diff) | |
download | scummvm-rg350-903ce79138c52a8ecde29a99964ed2dc3ec373ad.tar.gz scummvm-rg350-903ce79138c52a8ecde29a99964ed2dc3ec373ad.tar.bz2 scummvm-rg350-903ce79138c52a8ecde29a99964ed2dc3ec373ad.zip |
DREAMWEB: Port 'usewire' to C++
-rwxr-xr-x | devtools/tasmrecover/tasm-recover | 1 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 49 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 3 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/use.cpp | 27 |
5 files changed, 30 insertions, 51 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index d7490a6420..7f7b245993 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -806,6 +806,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'usewall', 'usewinch', 'usewindow', + 'usewire', 'viewfolder', 'vsync', 'volumeadjust', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 9ce8c0307d..6aad4f00d7 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -4135,55 +4135,6 @@ axeoncontrols: putBackObStuff(); } -void DreamGenContext::useWire() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto gotwirewith; - withWhat(); - return; -gotwirewith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'K'; - ch = 'N'; - dl = 'F'; - dh = 'E'; - compare(); - if (flags.z()) - goto wireknife; - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'A'; - ch = 'X'; - dl = 'E'; - dh = 'D'; - compare(); - if (flags.z()) - goto wireaxe; - cx = 300; - al = 14; - showPuzText(); - putBackObStuff(); - return; -wireaxe: - cx = 300; - al = 16; - showPuzText(); - putBackObStuff(); - return; -wireknife: - al = 51; - removeSetObject(); - al = 52; - placeSetObject(); - cx = 300; - al = 11; - showPuzText(); - _inc(data.byte(kProgresspoints)); - data.byte(kGetback) = 1; -} - void DreamGenContext::useHandle() { STACK_CHECK; al = 'C'; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 811af2fe90..7d0115834e 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -486,13 +486,11 @@ public: void __start(); #include "stubs.h" // Allow hand-reversed functions to have a signature different than void f() - void useWire(); void identifyOb(); void runEndSeq(); void useOpenBox(); void clearBuffers(); void getObTextStart(); - void dumpDiaryKeys(); void entryTexts(); void putUnderCentre(); void checkObjectSize(); @@ -519,6 +517,7 @@ public: void usePipe(); void reminders(); void runTap(); + void dumpDiaryKeys(); void checkForExit(); void lookInInterface(); void inToInv(); diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 0447a89cc9..52cb3a34e7 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -348,6 +348,7 @@ void useCardReader3(); void usePoolReader(); void useCooker(); + void useWire(); bool defaultUseHandler(const char *id); void openTVDoor(); void wearWatch(); diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 76ecdc732d..9778fe1f05 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1110,6 +1110,33 @@ void DreamGenContext::useLighter() { } } +void DreamGenContext::useWire() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char knife[4] = { 'K', 'N', 'F', 'E' }; // TODO: convert to string with trailing zero + if (compare(data.byte(kWithobject), data.byte(kWithtype), knife)) { + removeSetObject(51); + placeSetObject(52); + showPuzText(11, 300); + data.byte(kProgresspoints)++; + data.byte(kGetback) = 1; + return; + } + + char axe[4] = { 'A', 'X', 'E', 'D' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), axe)) { + showPuzText(16, 300); + putBackObStuff(); + return; + } + + showPuzText(14, 300); + putBackObStuff(); +} + void DreamGenContext::openTomb() { data.byte(kProgresspoints)++; showFirstUse(); |