aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2011-12-15 02:09:17 +0200
committerFilippos Karapetis2011-12-15 02:09:17 +0200
commit45794d1b829c1015f1d79205f2a4b28a811a036a (patch)
treeaf6c5bd52fe2371e1eda452b4e3324f5077edc3c
parentdd8304dd75e051460b96414ab3abac865a5af6e2 (diff)
downloadscummvm-rg350-45794d1b829c1015f1d79205f2a4b28a811a036a.tar.gz
scummvm-rg350-45794d1b829c1015f1d79205f2a4b28a811a036a.tar.bz2
scummvm-rg350-45794d1b829c1015f1d79205f2a4b28a811a036a.zip
DREAMWEB: Port 'describeob', 'additionaltext' to C++
-rwxr-xr-xdevtools/tasmrecover/tasm-recover2
-rw-r--r--engines/dreamweb/dreamgen.cpp80
-rw-r--r--engines/dreamweb/dreamgen.h2
-rw-r--r--engines/dreamweb/stubs.cpp28
-rw-r--r--engines/dreamweb/stubs.h1
5 files changed, 30 insertions, 83 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 4cf0b42a95..824cb92e21 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -209,6 +209,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'actualload',
'actualsave',
'addalong',
+ 'additionaltext',
'addlength',
'addtopeoplelist',
'addtopresslist',
@@ -318,6 +319,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'delsprite',
'deltextline',
'delthisone',
+ 'describeob',
'destselect',
'diarykeyp',
'diarykeyn',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index a33f5a27fc..b882f9f1ea 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -1046,86 +1046,6 @@ void DreamGenContext::openOb() {
cs.word(bx) = ax;
}
-void DreamGenContext::describeOb() {
- STACK_CHECK;
- getObTextStart();
- di = 33;
- bx = 92;
- _cmp(data.byte(kForeignrelease), 0);
- if (flags.z())
- goto notsetd;
- _cmp(data.byte(kObjecttype), 1);
- if (!flags.z())
- goto notsetd;
- bx = 82;
-notsetd:
- dl = 241;
- ah = 16;
- data.word(kCharshift) = 91+91;
- printDirect();
- data.word(kCharshift) = 0;
- di = 36;
- bx = 104;
- _cmp(data.byte(kForeignrelease), 0);
- if (flags.z())
- goto notsetd2;
- _cmp(data.byte(kObjecttype), 1);
- if (!flags.z())
- goto notsetd2;
- bx = 94;
-notsetd2:
- dl = 241;
- ah = 0;
- printDirect();
- push(bx);
- obsThatDoThings();
- bx = pop();
- additionalText();
-}
-
-void DreamGenContext::additionalText() {
- STACK_CHECK;
- _add(bx, 10);
- push(bx);
- al = data.byte(kCommand);
- ah = data.byte(kObjecttype);
- cl = 'C';
- ch = 'U';
- dl = 'P';
- dh = 'E';
- compare();
- if (flags.z())
- goto emptycup;
- al = data.byte(kCommand);
- ah = data.byte(kObjecttype);
- cl = 'C';
- ch = 'U';
- dl = 'P';
- dh = 'F';
- compare();
- if (flags.z())
- goto fullcup;
- bx = pop();
- return;
-emptycup:
- al = 40;
- findPuzText();
- bx = pop();
- di = 36;
- dl = 241;
- ah = 0;
- printDirect();
- return;
-fullcup:
- al = 39;
- findPuzText();
- bx = pop();
- di = 36;
- dl = 241;
- ah = 0;
- printDirect();
-}
-
void DreamGenContext::getObTextStart() {
STACK_CHECK;
es = data.word(kFreedesc);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index c1829ec4c2..d1a9471f4f 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -528,7 +528,6 @@ public:
void showKeys();
void printmessage2();
void findOpenPos();
- void describeOb();
void deleteExFrame();
void searchForSame();
void rollEm();
@@ -553,7 +552,6 @@ public:
void findPathOfPoint();
void getDestInfo();
void read();
- void additionalText();
void mugger();
void searchForString();
void selectOpenOb();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 01169a81df..e721d482db 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -3396,6 +3396,33 @@ void DreamGenContext::obsThatDoThings() {
}
}
+void DreamGenContext::describeOb() {
+ const uint8 *obText = getObTextStartCPP();
+ uint16 y = 92;
+ if (data.byte(kForeignrelease) && data.byte(kObjecttype) == 1)
+ y = 82;
+ data.word(kCharshift) = 91 + 91;
+ printDirect(obText, 33, y, 241, 241 & 1);
+ data.word(kCharshift) = 0;
+ if (data.byte(kForeignrelease) && data.byte(kObjecttype) == 1)
+ y = 94;
+ printDirect(obText, 36, y, 241, 241 & 1);
+ obsThatDoThings();
+
+ // Additional text
+ if (compare(data.byte(kCommand), data.byte(kObjecttype), "CUPE")) {
+ // Empty cup
+ uint16 offset = kTextstart + getSegment(data.word(kPuzzletext)).word(40 * 2);
+ const uint8 *string = getSegment(data.word(kPuzzletext)).ptr(offset, 0);
+ printDirect(string, 36, y + 10, 241, 241 & 1);
+ } else if (compare(data.byte(kCommand), data.byte(kObjecttype), "CUPF")) {
+ // Full cup
+ uint16 offset = kTextstart + getSegment(data.word(kPuzzletext)).word(39 * 2);
+ const uint8 *string = getSegment(data.word(kPuzzletext)).ptr(offset, 0);
+ printDirect(string, 36, y + 10, 241, 241 & 1);
+ }
+}
+
void DreamGenContext::delEverything() {
if (data.byte(kMapysize) + data.word(kMapoffsety) < 182) {
mapToPanel();
@@ -4272,7 +4299,6 @@ void DreamGenContext::showPuzText() {
}
void DreamGenContext::showPuzText(uint16 command, uint16 count) {
- findPuzText(); // FIXME: Unnecessary? (Input: al, Output: es:si)
createPanel();
showPanel();
showMan();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 16d7e67d5c..3413c5eef0 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -588,5 +588,6 @@
uint16 findSetObject(const char *id);
void findExObject();
uint16 findExObject(const char *id);
+ void describeOb();
#endif