aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBertrand Augereau2011-07-19 12:37:32 +0200
committerBertrand Augereau2011-07-23 18:23:39 +0200
commitd0f917d8571c3945b33dbd7a84bf3e0b33ce9715 (patch)
treea433969d7f40b6867cba3de7b1c73504a5d501be /engines
parent96221b574243fcf6eedf856e1ee3f117ee196a8e (diff)
downloadscummvm-rg350-d0f917d8571c3945b33dbd7a84bf3e0b33ce9715.tar.gz
scummvm-rg350-d0f917d8571c3945b33dbd7a84bf3e0b33ce9715.tar.bz2
scummvm-rg350-d0f917d8571c3945b33dbd7a84bf3e0b33ce9715.zip
DREAMWEB: 'printslow' ported to C++
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreamgen.cpp102
-rw-r--r--engines/dreamweb/dreamgen.h3
-rw-r--r--engines/dreamweb/stubs.cpp88
-rw-r--r--engines/dreamweb/stubs.h1
4 files changed, 90 insertions, 104 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 5a3bd3b4e3..755344f230 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -4937,107 +4937,6 @@ realcreditsearly:
data.byte(kLasthardkey) = 0;
}
-void DreamGenContext::printslow() {
- STACK_CHECK;
- data.byte(kPointerframe) = 1;
- data.byte(kPointermode) = 3;
- ds = data.word(kCharset1);
-printloopslow6:
- push(bx);
- push(di);
- push(dx);
- getnumber();
- ch = 0;
-printloopslow5:
- push(cx);
- push(si);
- push(es);
- ax = es.word(si);
- push(bx);
- push(cx);
- push(es);
- push(si);
- push(ds);
- modifychar();
- printboth();
- ds = pop();
- si = pop();
- es = pop();
- cx = pop();
- bx = pop();
- ax = es.word(si+1);
- _inc(si);
- _cmp(al, 0);
- if (flags.z())
- goto finishslow;
- _cmp(al, ':');
- if (flags.z())
- goto finishslow;
- _cmp(cl, 1);
- if (flags.z())
- goto afterslow;
- push(di);
- push(ds);
- push(bx);
- push(cx);
- push(es);
- push(si);
- modifychar();
- data.word(kCharshift) = 91;
- printboth();
- data.word(kCharshift) = 0;
- si = pop();
- es = pop();
- cx = pop();
- bx = pop();
- ds = pop();
- di = pop();
- waitframes();
- _cmp(ax, 0);
- if (flags.z())
- goto keepgoing;
- _cmp(ax, data.word(kOldbutton));
- if (!flags.z())
- goto finishslow2;
-keepgoing:
- waitframes();
- _cmp(ax, 0);
- if (flags.z())
- goto afterslow;
- _cmp(ax, data.word(kOldbutton));
- if (!flags.z())
- goto finishslow2;
-afterslow:
- es = pop();
- si = pop();
- cx = pop();
- _inc(si);
- if (--cx)
- goto printloopslow5;
- dx = pop();
- di = pop();
- bx = pop();
- _add(bx, 10);
- goto printloopslow6;
-finishslow:
- es = pop();
- si = pop();
- cx = pop();
- dx = pop();
- di = pop();
- bx = pop();
- al = 0;
- return;
-finishslow2:
- es = pop();
- si = pop();
- cx = pop();
- dx = pop();
- di = pop();
- bx = pop();
- al = 1;
-}
-
void DreamGenContext::waitframes() {
STACK_CHECK;
push(di);
@@ -21368,7 +21267,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_mode640x480: mode640x480(); break;
case addr_set16colpalette: set16colpalette(); break;
case addr_realcredits: realcredits(); break;
- case addr_printslow: printslow(); break;
case addr_waitframes: waitframes(); break;
case addr_printboth: printboth(); break;
case addr_monprint: monprint(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index f5513e4297..b52afaeab7 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -587,7 +587,6 @@ public:
static const uint16 addr_monprint = 0xc314;
static const uint16 addr_printboth = 0xc30c;
static const uint16 addr_waitframes = 0xc308;
- static const uint16 addr_printslow = 0xc304;
static const uint16 addr_realcredits = 0xc2f8;
static const uint16 addr_set16colpalette = 0xc2f4;
static const uint16 addr_mode640x480 = 0xc2f0;
@@ -1485,7 +1484,7 @@ public:
void turnonpower();
void manasleep2();
void moretalk();
- void printslow();
+ //void printslow();
void loadroom();
void starttalk();
void delchar();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index c1b5fe11e9..9780f1eddf 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -294,6 +294,94 @@ void DreamGenContext::printchar(uint16 dst, uint16 src, uint16* x, uint16 y, uin
(*x) += cl;
}
+void DreamGenContext::printslow() {
+ data.byte(kPointerframe) = 1;
+ data.byte(kPointermode) = 3;
+ ds = data.word(kCharset1);
+ do {
+ push(bx);
+ push(di);
+ push(dx);
+ uint16 offset = di;
+ cx = getnumber(dl, (bool)(dl & 1), &offset);
+ di = offset;
+ do {
+ push(cx);
+ push(si);
+ push(es);
+ ax = es.word(si);
+ push(bx);
+ push(cx);
+ push(es);
+ push(si);
+ push(ds);
+ al = engine->modifyChar(al);
+ printboth();
+ ds = pop();
+ si = pop();
+ es = pop();
+ cx = pop();
+ bx = pop();
+ ax = es.word(si+1);
+ _inc(si);
+ if ((al == 0) || (al == ':')) {
+ es = pop();
+ si = pop();
+ cx = pop();
+ dx = pop();
+ di = pop();
+ bx = pop();
+ al = 0;
+ return;
+ }
+ _cmp(cl, 1);
+ if (flags.z())
+ goto afterslow;
+ push(di);
+ push(ds);
+ push(bx);
+ push(cx);
+ push(es);
+ push(si);
+ al = engine->modifyChar(al);
+ data.word(kCharshift) = 91;
+ printboth();
+ data.word(kCharshift) = 0;
+ si = pop();
+ es = pop();
+ cx = pop();
+ bx = pop();
+ ds = pop();
+ di = pop();
+ for (int i=0; i<2; ++i) {
+ waitframes();
+ if (ax == 0)
+ continue;
+ if (ax != data.word(kOldbutton)) {
+ es = pop();
+ si = pop();
+ cx = pop();
+ dx = pop();
+ di = pop();
+ bx = pop();
+ al = 1;
+ return;
+ }
+ }
+ afterslow:
+ es = pop();
+ si = pop();
+ cx = pop();
+ _inc(si);
+ --cx;
+ } while (cx);
+ dx = pop();
+ di = pop();
+ bx = pop();
+ _add(bx, 10);
+ } while (true);
+}
+
void DreamGenContext::printdirect() {
data.word(kLastxpos) = di;
ds = data.word(kCurrentset);
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index ca213b39e4..e580598a37 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -41,6 +41,7 @@
void printchar();
void printchar(uint16 dst, uint16 src, uint16* x, uint16 y, uint8 c);
void printdirect();
+ void printslow();
void getnumber();
uint8 getnumber(uint16 maxWidth, bool centered, uint16* offset);
void kernchars();