aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb/monitor.cpp
diff options
context:
space:
mode:
authorD G Turner2011-12-26 20:45:39 +0000
committerD G Turner2011-12-26 20:45:39 +0000
commitbd70cd9dff5666d7bcca69960ef4271c519d04f3 (patch)
tree001791a12a42e4b9c8bef3e53580b316c7388d07 /engines/dreamweb/monitor.cpp
parentf5da710da4583624d81721f33bf0506edff0417d (diff)
downloadscummvm-rg350-bd70cd9dff5666d7bcca69960ef4271c519d04f3.tar.gz
scummvm-rg350-bd70cd9dff5666d7bcca69960ef4271c519d04f3.tar.bz2
scummvm-rg350-bd70cd9dff5666d7bcca69960ef4271c519d04f3.zip
DREAMWEB: Ported 'read' to C++
Diffstat (limited to 'engines/dreamweb/monitor.cpp')
-rw-r--r--engines/dreamweb/monitor.cpp76
1 files changed, 76 insertions, 0 deletions
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();