aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb
diff options
context:
space:
mode:
authorBertrand Augereau2011-11-18 07:04:45 +0100
committerBertrand Augereau2011-11-18 07:21:40 +0100
commit32b47501a264f3dadd99ef58f435dccd9946150c (patch)
tree40b3c27cbb63c632320671b2a25bab7ca3c62ee4 /engines/dreamweb
parent456b7eb14bc88edac6dd6b2ccc31df711728ec45 (diff)
downloadscummvm-rg350-32b47501a264f3dadd99ef58f435dccd9946150c.tar.gz
scummvm-rg350-32b47501a264f3dadd99ef58f435dccd9946150c.tar.bz2
scummvm-rg350-32b47501a264f3dadd99ef58f435dccd9946150c.zip
DREAMWEB: 'usemon' ported to C++
Diffstat (limited to 'engines/dreamweb')
-rw-r--r--engines/dreamweb/dreamgen.cpp92
-rw-r--r--engines/dreamweb/dreamgen.h5
-rw-r--r--engines/dreamweb/stubs.cpp79
-rw-r--r--engines/dreamweb/stubs.h2
4 files changed, 83 insertions, 95 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 95ec50f6f5..fcda22b77b 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -6020,97 +6020,6 @@ void DreamGenContext::readcitypic() {
loadintotemp();
}
-void DreamGenContext::usemon() {
- STACK_CHECK;
- data.byte(kLasttrigger) = 0;
- es = cs;
- di = 2970+1;
- cx = 12;
- al = 32;
- _stosb(cx, true);
- es = cs;
- di = offset_operand1+1;
- cx = 12;
- al = 32;
- _stosb(cx, true);
- es = cs;
- di = offset_keys;
- es.byte(di) = 1;
- _add(di, 26);
- cx = 3;
-keyloop:
- es.byte(di) = 0;
- _add(di, 26);
- if (--cx)
- goto keyloop;
- createpanel();
- showpanel();
- showicon();
- drawfloor();
- getridofall();
- dx = 1974;
- loadintotemp();
- loadpersonal();
- loadnews();
- loadcart();
- dx = 1870;
- loadtempcharset();
- printoutermon();
- initialmoncols();
- printlogo();
- worktoscreen();
- turnonpower();
- fadeupyellows();
- fadeupmonfirst();
- data.word(kMonadx) = 76;
- data.word(kMonady) = 141;
- al = 1;
- monmessage();
- cx = 120;
- hangoncurs();
- al = 2;
- monmessage();
- cx = 60;
- randomaccess();
- al = 3;
- monmessage();
- cx = 100;
- hangoncurs();
- printlogo();
- scrollmonitor();
- data.word(kBufferin) = 0;
- data.word(kBufferout) = 0;
-moreinput:
- di = data.word(kMonadx);
- bx = data.word(kMonady);
- push(di);
- push(bx);
- input();
- bx = pop();
- di = pop();
- data.word(kMonadx) = di;
- data.word(kMonady) = bx;
- execcommand();
- _cmp(al, 0);
- if (flags.z())
- goto moreinput;
- getridoftemp();
- getridoftempcharset();
- es = data.word(kTextfile1);
- deallocatemem();
- es = data.word(kTextfile2);
- deallocatemem();
- es = data.word(kTextfile3);
- deallocatemem();
- data.byte(kGetback) = 1;
- al = 26;
- playchannel1();
- data.byte(kManisoffscreen) = 0;
- restoreall();
- redrawmainscrn();
- worktoscreenm();
-}
-
void DreamGenContext::printoutermon() {
STACK_CHECK;
di = 40;
@@ -15546,7 +15455,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_resetlocation: resetlocation(); break;
case addr_readdesticon: readdesticon(); break;
case addr_readcitypic: readcitypic(); break;
- case addr_usemon: usemon(); break;
case addr_printoutermon: printoutermon(); break;
case addr_loadpersonal: loadpersonal(); break;
case addr_loadnews: loadnews(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index dd6ffb75cb..563c7dafea 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -374,7 +374,6 @@ public:
static const uint16 addr_loadnews = 0xc4f4;
static const uint16 addr_loadpersonal = 0xc4f0;
static const uint16 addr_printoutermon = 0xc4ec;
- static const uint16 addr_usemon = 0xc4e8;
static const uint16 addr_readcitypic = 0xc4e4;
static const uint16 addr_readdesticon = 0xc4e0;
static const uint16 addr_resetlocation = 0xc4dc;
@@ -1247,7 +1246,6 @@ public:
void mainscreen();
void watchreel();
void showfolder();
- void dosreturn();
//void turnanypathoff();
void openfilefromc();
void gettime();
@@ -1542,6 +1540,7 @@ public:
void transfertoex();
void playchannel1();
void playchannel0();
+ //void usemon();
void steady();
//void pixelcheckset();
void reexfrominv();
@@ -1614,7 +1613,7 @@ public:
void deleteexframe();
//void readsetdata();
void folderexit();
- void usemon();
+ void dosreturn();
void wheelsound();
void actualsave();
void autolook();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 33f8efdad5..44a85526e7 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -2167,5 +2167,84 @@ void DreamGenContext::printlogo() {
showcurrentfile();
}
+struct MonitorKeyEntry {
+ uint8 b0;
+ uint8 b1;
+ char b2[24];
+};
+
+void DreamGenContext::usemon() {
+ data.byte(kLasttrigger) = 0;
+ memset(cs.ptr(kCurrentfile+1, 0), ' ', 12);
+ memset(cs.ptr(offset_operand1+1, 0), ' ', 12);
+
+ MonitorKeyEntry *monitorKeyEntries = (MonitorKeyEntry *)cs.ptr(offset_keys, 0);
+ monitorKeyEntries[0].b0 = 1;
+ monitorKeyEntries[1].b0 = 0;
+ monitorKeyEntries[2].b0 = 0;
+ monitorKeyEntries[3].b0 = 0;
+
+ createpanel();
+ showpanel();
+ showicon();
+ drawfloor();
+ getridofall();
+ loadintotemp("DREAMWEB.G03");
+ loadpersonal();
+ loadnews();
+ loadcart();
+ loadtempcharset("DREAMWEB.C01");
+ printoutermon();
+ initialmoncols();
+ printlogo();
+ worktoscreen();
+ turnonpower();
+ fadeupyellows();
+ fadeupmonfirst();
+ data.word(kMonadx) = 76;
+ data.word(kMonady) = 141;
+ al = 1;
+ monmessage();
+ hangoncurs(120);
+ al = 2;
+ monmessage();
+ cx = 60;
+ randomaccess();
+ al = 3;
+ monmessage();
+ hangoncurs(100);
+ printlogo();
+ scrollmonitor();
+ data.word(kBufferin) = 0;
+ data.word(kBufferout) = 0;
+ do {
+ di = data.word(kMonadx);
+ bx = data.word(kMonady);
+ push(di);
+ push(bx);
+ input();
+ bx = pop();
+ di = pop();
+ data.word(kMonadx) = di;
+ data.word(kMonady) = bx;
+ execcommand();
+ } while (al == 0);
+ getridoftemp();
+ getridoftempcharset();
+ es = data.word(kTextfile1);
+ deallocatemem();
+ es = data.word(kTextfile2);
+ deallocatemem();
+ es = data.word(kTextfile3);
+ deallocatemem();
+ data.byte(kGetback) = 1;
+ al = 26;
+ playchannel1();
+ data.byte(kManisoffscreen) = 0;
+ restoreall();
+ redrawmainscrn();
+ worktoscreenm();
+}
+
} /*namespace dreamgen */
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 5ada5b7f91..840d5aea98 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -295,4 +295,6 @@
void fadeupyellows();
void fadeupmonfirst();
void printlogo();
+ void usemon();
+