diff options
-rwxr-xr-x | devtools/tasmrecover/tasm-recover | 1 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 62 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/use.cpp | 30 |
5 files changed, 32 insertions, 63 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 6d99cb2022..2b0e08632f 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -869,6 +869,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'useroutine', 'useshield', 'useslab', + 'usestereo', 'usetempcharset', 'usetext', 'usetimedtext', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 0a891cb1cf..939e8c0127 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2736,68 +2736,6 @@ lookcolon: goto lookcolon; } -void DreamGenContext::useStereo() { - STACK_CHECK; - _cmp(data.byte(kLocation), 0); - if (flags.z()) - goto stereook; - cx = 400; - al = 4; - showPuzText(); - putBackObStuff(); - return; -stereook: - _cmp(data.byte(kMapx), 11); - if (!flags.z()) - goto stereonotok; - _cmp(data.byte(kMapy), 0); - if (flags.z()) - goto stereook2; -stereonotok: - cx = 400; - al = 5; - showPuzText(); - putBackObStuff(); - return; -stereook2: - al = 'C'; - ah = 'D'; - cl = 'P'; - ch = 'L'; - findSetObject(); - ah = 1; - checkInside(); - _cmp(cl, (114)); - if (!flags.z()) - goto cdinside; - al = 6; - cx = 400; - showPuzText(); - putBackObStuff(); - getAnyAd(); - al = 255; - es.byte(bx+10) = al; - return; -cdinside: - getAnyAd(); - al = es.byte(bx+10); - _xor(al, 1); - es.byte(bx+10) = al; - _cmp(al, 255); - if (flags.z()) - goto stereoon; - al = 7; - cx = 400; - showPuzText(); - putBackObStuff(); - return; -stereoon: - al = 8; - cx = 400; - showPuzText(); - putBackObStuff(); -} - void DreamGenContext::selectOb() { STACK_CHECK; findInvPos(); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 86768e6cca..28711bb1ba 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -518,7 +518,6 @@ public: void getEitherAd(); void setPickup(); void dropObject(); - void useStereo(); void showDiaryKeys(); void useOpened(); void signOn(); diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 27a5cee9c5..b2417e767b 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -395,6 +395,7 @@ void identifyOb(); void showSlots(); void useCashCard(); + void useStereo(); void checkInside(); uint16 checkInside(uint16 command, uint16 type); diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index b4e7efdb4f..4be3c7a6b3 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1634,4 +1634,34 @@ void DreamGenContext::useCashCard() { putBackObStuff(); } +void DreamGenContext::useStereo() { + if (data.byte(kLocation) != 0) { + showPuzText(4, 400); + putBackObStuff(); + } else if (data.byte(kMapx) != 11) { + showPuzText(5, 400); + putBackObStuff(); + } else if (checkInside(findSetObject("CDPL"), 1) == kNumexobjects) { + // No CD inside + showPuzText(6, 400); + putBackObStuff(); + // TODO: Use the C++ version of getAnyAd() + getAnyAd(); + es.byte(bx + 10) = 255; + } else { + // CD inside + getAnyAd(); + es.byte(bx + 10) ^= 1; + if (es.byte(bx + 10) != 255) { + // Stereo off + showPuzText(7, 400); + } else { + // Stereo on + showPuzText(8, 400); + } + + putBackObStuff(); + } +} + } // End of namespace DreamGen |