aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdevtools/tasmrecover/tasm-recover1
-rw-r--r--engines/dreamweb/dreamgen.cpp91
-rw-r--r--engines/dreamweb/dreamgen.h1
-rw-r--r--engines/dreamweb/monitor.cpp76
-rw-r--r--engines/dreamweb/stubs.h1
5 files changed, 78 insertions, 92 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index d63c17ecd7..0126425625 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -763,6 +763,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'randomnum1',
'randomnum2',
'randomnumber',
+ 'read',
'readabyte',
'readcitypic',
'readdesticon',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 220304c405..b44efe9d0e 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -26,97 +26,6 @@
namespace DreamGen {
-void DreamGenContext::read() {
- STACK_CHECK;
- cx = 40;
- randomAccess();
- parser();
- _cmp(es.byte(di+1), 0);
- if (!flags.z())
- goto okcom;
- netError();
- return;
-okcom:
- es = cs;
- di = 408;
- ax = data.word(kTextfile1);
- data.word(kMonsource) = ax;
- ds = ax;
- si = (66*2);
- searchForString();
- _cmp(al, 0);
- if (flags.z())
- goto foundfile2;
- ax = data.word(kTextfile2);
- data.word(kMonsource) = ax;
- ds = ax;
- si = (66*2);
- searchForString();
- _cmp(al, 0);
- if (flags.z())
- goto foundfile2;
- ax = data.word(kTextfile3);
- data.word(kMonsource) = ax;
- ds = ax;
- si = (66*2);
- searchForString();
- _cmp(al, 0);
- if (flags.z())
- goto foundfile2;
- al = 7;
- monMessage();
- return;
-foundfile2:
- getKeyAndLogo();
- _cmp(al, 0);
- if (flags.z())
- goto keyok1;
- return;
-keyok1:
- es = cs;
- di = offset_operand1;
- ds = data.word(kMonsource);
- searchForString();
- _cmp(al, 0);
- if (flags.z())
- goto findtopictext;
- al = data.byte(kOldlogonum);
- data.byte(kLogonum) = al;
- al = 11;
- monMessage();
- return;
-findtopictext:
- _inc(bx);
- push(es);
- push(bx);
- monitorLogo();
- scrollMonitor();
- bx = pop();
- es = pop();
-moretopic:
- monPrint();
- al = es.byte(bx);
- _cmp(al, 34);
- if (flags.z())
- goto endoftopic;
- _cmp(al, '=');
- if (flags.z())
- goto endoftopic;
- _cmp(al, '*');
- if (flags.z())
- goto endoftopic;
- push(es);
- push(bx);
- processTrigger();
- cx = 24;
- randomAccess();
- bx = pop();
- es = pop();
- goto moretopic;
-endoftopic:
- scrollMonitor();
-}
-
void DreamGenContext::dirFile() {
STACK_CHECK;
al = 34;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 6ee65ada68..6ec194618a 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -418,7 +418,6 @@ public:
void dirFile();
void dreamweb();
- void read();
void searchForString();
void parser();
};
diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp
index a877f17b8a..953d1cb6a1 100644
--- a/engines/dreamweb/monitor.cpp
+++ b/engines/dreamweb/monitor.cpp
@@ -475,6 +475,82 @@ void DreamGenContext::dirCom() {
scrollMonitor();
}
+void DreamGenContext::read() {
+ bool foundFile = false;
+
+ randomAccess(40);
+ parser();
+ if (es.byte(di+1) == 0) {
+ netError();
+ return;
+ }
+
+ es = cs;
+ di = kCurrentfile;
+
+ data.word(kMonsource) = data.word(kTextfile1);
+ ds = data.word(kMonsource);
+ si = kTextstart;
+ searchForString();
+ if (al == 0) {
+ foundFile = true;
+ } else {
+ data.word(kMonsource) = data.word(kTextfile2);
+ ds = data.word(kMonsource);
+ si = kTextstart;
+ searchForString();
+ if (al == 0) {
+ foundFile = true;
+ } else {
+ data.word(kMonsource) = data.word(kTextfile3);
+ ds = data.word(kMonsource);
+ si = kTextstart;
+ searchForString();
+ if (al == 0)
+ foundFile = true;
+ }
+ }
+
+ if (!foundFile) {
+ monMessage(7);
+ return;
+ }
+
+ // "foundfile2"
+ getKeyAndLogo();
+ if (al != 0)
+ return;
+
+ // "keyok1"
+ es = cs;
+ di = offset_operand1;
+ ds = data.word(kMonsource);
+ searchForString();
+ if (al != 0) {
+ data.byte(kLogonum) = data.byte(kOldlogonum);
+ monMessage(11);
+ return;
+ }
+
+ // "findtopictext"
+ bx++;
+
+ monitorLogo();
+ scrollMonitor();
+
+ while (true) {
+ monPrint();
+ if (es.byte(bx) == 34 || es.byte(bx) == '=' || es.byte(bx) == '*') {
+ // "endoftopic"
+ scrollMonitor();
+ return;
+ }
+
+ processTrigger();
+ randomAccess(24);
+ }
+}
+
void DreamGenContext::signOn() {
parser();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index feedef9aae..bda2be634e 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -117,6 +117,7 @@
void getKeyAndLogo();
void signOn();
void searchForFiles(uint16 segment);
+ void read();
void dirCom();
#endif