aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb/monitor.cpp
diff options
context:
space:
mode:
authorD G Turner2011-12-26 21:23:38 +0000
committerD G Turner2011-12-26 21:23:38 +0000
commit6a7e798f465afb0f188b85664dee5ae2cda93a4a (patch)
treea2c62e44cf607eb567c4e9703d6797a6c2a5890c /engines/dreamweb/monitor.cpp
parentb3b904ddabcda8c39c5b40eec1e2c6c0e14e4ef3 (diff)
downloadscummvm-rg350-6a7e798f465afb0f188b85664dee5ae2cda93a4a.tar.gz
scummvm-rg350-6a7e798f465afb0f188b85664dee5ae2cda93a4a.tar.bz2
scummvm-rg350-6a7e798f465afb0f188b85664dee5ae2cda93a4a.zip
DREAMWEB: Ported 'dirfile' to C++
Needs some checking of es:di usage and work to remove _operand1 to dreambase.h
Diffstat (limited to 'engines/dreamweb/monitor.cpp')
-rw-r--r--engines/dreamweb/monitor.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp
index f1b870d9c0..7e88838a7d 100644
--- a/engines/dreamweb/monitor.cpp
+++ b/engines/dreamweb/monitor.cpp
@@ -453,6 +453,61 @@ void DreamGenContext::getKeyAndLogo() {
}
}
+void DreamGenContext::dirFile() {
+ bool foundFile = false;
+
+ es.byte(di) = 34;
+
+ ds = data.word(kTextfile1);
+ si = kTextstart;
+ searchForString();
+ if (al == 0) {
+ foundFile = true;
+ } else {
+ ds = data.word(kTextfile2);
+ si = kTextstart;
+ searchForString();
+ if (al == 0) {
+ foundFile = true;
+ } else {
+ ds = data.word(kTextfile3);
+ si = kTextstart;
+ searchForString();
+ if (al == 0)
+ foundFile = true;
+ }
+ }
+
+ if (!foundFile) {
+ monMessage(7);
+ return;
+ }
+
+ // "foundfile"
+ getKeyAndLogo();
+ if (al != 0)
+ return;
+
+ // "keyok2"
+ memcpy(data.ptr(kCurrentfile+1, 0), data.ptr(offset_operand1+1, 0), 12);
+ monitorLogo();
+ scrollMonitor();
+ monMessage(10);
+
+ while (true) {
+ al = es.byte(bx);
+ bx++;
+ if (al == 34 || al == '*') {
+ // "endofdir2"
+ scrollMonitor();
+ return;
+ }
+
+ if (al == '=')
+ monPrint();
+ }
+}
+
void DreamGenContext::dirCom() {
randomAccess(30);