[Scummvm-cvs-logs] scummvm master -> 47c4b2b7dee13ade60c7810e0d4f216a5ee69e3a
bluegr
md5 at scummvm.org
Mon Dec 12 22:31:33 CET 2011
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
47c4b2b7de DREAMWEB: Port 'usecontrol' to C++
Commit: 47c4b2b7dee13ade60c7810e0d4f216a5ee69e3a
https://github.com/scummvm/scummvm/commit/47c4b2b7dee13ade60c7810e0d4f216a5ee69e3a
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-12T13:30:51-08:00
Commit Message:
DREAMWEB: Port 'usecontrol' to C++
Changed paths:
devtools/tasmrecover/tasm-recover
engines/dreamweb/dreamgen.cpp
engines/dreamweb/dreamgen.h
engines/dreamweb/stubs.h
engines/dreamweb/use.cpp
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index ef04a2c..95925a8 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -782,6 +782,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'usechurchgate',
'usechurchhole',
'useclearbox',
+ 'usecontrol',
'usecooker',
'usecoveredbox',
'usediary',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index d98b238..3cc0c4e 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -3955,102 +3955,6 @@ numberpoke3:
cs.byte(bx) = al;
}
-void DreamGenContext::useControl() {
- STACK_CHECK;
- _cmp(data.byte(kWithobject), 255);
- if (!flags.z())
- goto gotcontrolwith;
- withWhat();
- return;
-gotcontrolwith:
- al = data.byte(kWithobject);
- ah = data.byte(kWithtype);
- cl = 'K';
- ch = 'E';
- dl = 'Y';
- dh = 'A';
- compare();
- if (flags.z())
- goto rightkey;
- _cmp(data.byte(kReallocation), 21);
- if (!flags.z())
- goto balls;
- al = data.byte(kWithobject);
- ah = data.byte(kWithtype);
- cl = 'K';
- ch = 'N';
- dl = 'F';
- dh = 'E';
- compare();
- if (flags.z())
- goto jimmycontrols;
- al = data.byte(kWithobject);
- ah = data.byte(kWithtype);
- cl = 'A';
- ch = 'X';
- dl = 'E';
- dh = 'D';
- compare();
- if (flags.z())
- goto axeoncontrols;
-balls:
- showFirstUse();
- putBackObStuff();
- return;
-rightkey:
- al = 16;
- playChannel1();
- _cmp(data.byte(kLocation), 21);
- if (flags.z())
- goto goingdown;
- cx = 300;
- al = 0;
- showPuzText();
- data.byte(kNewlocation) = 21;
- data.byte(kCounttoclose) = 8;
- data.byte(kCounttoopen) = 0;
- data.word(kWatchingtime) = 80;
- data.byte(kGetback) = 1;
- return;
-goingdown:
- cx = 300;
- al = 3;
- showPuzText();
- data.byte(kNewlocation) = 30;
- data.byte(kCounttoclose) = 8;
- data.byte(kCounttoopen) = 0;
- data.word(kWatchingtime) = 80;
- data.byte(kGetback) = 1;
- return;
-jimmycontrols:
- al = 50;
- placeSetObject();
- al = 51;
- placeSetObject();
- al = 26;
- placeSetObject();
- al = 30;
- placeSetObject();
- al = 16;
- removeSetObject();
- al = 17;
- removeSetObject();
- al = 14;
- playChannel1();
- cx = 300;
- al = 10;
- showPuzText();
- _inc(data.byte(kProgresspoints));
- data.byte(kGetback) = 1;
- return;
-axeoncontrols:
- cx = 300;
- al = 16;
- showPuzText();
- _inc(data.byte(kProgresspoints));
- putBackObStuff();
-}
-
void DreamGenContext::useHandle() {
STACK_CHECK;
al = 'C';
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 746f306..b87d9c6 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -593,7 +593,6 @@ public:
void updateSymbolBot();
void findPuzText();
void swapWithInv();
- void useControl();
void adjustRight();
void transferToEx();
void updateSymbolTop();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 7142bec..a6e29f2 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -349,6 +349,7 @@
void usePoolReader();
void useCooker();
void useWire();
+ void useControl();
bool defaultUseHandler(const char *id);
void openTVDoor();
void wearWatch();
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index 0990e5b..eb32811 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -1224,4 +1224,61 @@ void DreamGenContext::useDiary() {
workToScreenM();
}
+void DreamGenContext::useControl() {
+ if (data.byte(kWithobject) == 255) {
+ withWhat();
+ return;
+ }
+
+ char key[4] = { 'K', 'E', 'Y', 'A' }; // TODO: convert to string with trailing zero
+ if (compare(data.byte(kWithobject), data.byte(kWithtype), key)) { // Right key
+ playChannel1(16);
+ if (data.byte(kLocation) == 21) { // Going down
+ showPuzText(3, 300);
+ data.byte(kNewlocation) = 30;
+ } else {
+ showPuzText(0, 300);
+ data.byte(kNewlocation) = 21;
+ }
+
+ data.byte(kCounttoclose) = 8;
+ data.byte(kCounttoopen) = 0;
+ data.word(kWatchingtime) = 80;
+ data.byte(kGetback) = 1;
+ return;
+ }
+
+ if (data.byte(kReallocation) == 21) {
+ char knife[4] = { 'K', 'N', 'F', 'E' }; // TODO: convert to string with trailing zero
+ char axe[4] = { 'A', 'X', 'E', 'D' }; // TODO: convert to string with trailing zero
+
+ if (compare(data.byte(kWithobject), data.byte(kWithtype), knife)) {
+ // Jimmy controls
+ placeSetObject(50);
+ placeSetObject(51);
+ placeSetObject(26);
+ placeSetObject(30);
+ removeSetObject(16);
+ removeSetObject(17);
+ playChannel1(14);
+ showPuzText(10, 300);
+ data.byte(kProgresspoints)++;
+ data.byte(kGetback) = 1;
+ } else if (compare(data.byte(kWithobject), data.byte(kWithtype), axe)) {
+ // Axe on controls
+ showPuzText(16, 300);
+ data.byte(kProgresspoints)++;
+ putBackObStuff();
+ } else {
+ // Balls
+ showFirstUse();
+ putBackObStuff();
+ }
+ } else {
+ // Balls
+ showFirstUse();
+ putBackObStuff();
+ }
+}
+
} // End of namespace DreamGen
More information about the Scummvm-git-logs
mailing list