aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreamgen.cpp47
-rw-r--r--engines/dreamweb/stubs.cpp22
2 files changed, 22 insertions, 47 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index da0d71f7fe..462ae596f8 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -4329,52 +4329,6 @@ noeffects:
cx = pop();
}
-void DreamGenContext::frameoutv() {
- STACK_CHECK;
- push(dx);
- ax = bx;
- bx = dx;
- _mul(bx);
- _add(di, ax);
- dx = pop();
- push(cx);
- ch = 0;
- _sub(dx, cx);
- cx = pop();
-frameloop1:
- push(cx);
- ch = 0;
-frameloop2:
- _lodsb();
- _cmp(al, 0);
- if (!flags.z())
- goto backtosolid;
-backtoother:
- _inc(di);
- if (--cx)
- goto frameloop2;
- cx = pop();
- _add(di, dx);
- _dec(ch);
- if (!flags.z())
- goto frameloop1;
- return;
-frameloop3:
- _lodsb();
- _cmp(al, 0);
- if (flags.z())
- goto backtoother;
-backtosolid:
- _stosb();
- if (--cx)
- goto frameloop3;
- cx = pop();
- _add(di, dx);
- _dec(ch);
- if (!flags.z())
- goto frameloop1;
-}
-
void DreamGenContext::frameoutbh() {
STACK_CHECK;
push(dx);
@@ -22126,7 +22080,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case 0xc214: delthisone(); break;
case 0xc228: doblocks(); break;
case 0xc22c: showframe(); break;
- case 0xc230: frameoutv(); break;
case 0xc238: frameoutbh(); break;
case 0xc23c: frameoutfx(); break;
case 0xc240: transferinv(); break;
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index eebfbeb0d4..1869f1b109 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -503,4 +503,26 @@ void DreamGenContext::showpcx() {
pcxFile.close();
}
+void DreamGenContext::frameoutv() {
+ uint16 pitch = dx;
+ uint16 width = cx & 0xff;
+ uint16 height = cx >> 8;
+ uint16 stride = pitch - width;
+
+ const uint8* src = ds.ptr(si, width * height);
+ uint8* base = es.ptr(di, stride * height);
+ uint8* dst = base + pitch * bx;
+
+ // NB: Original code assumes non-zero width and height, "for" are unneeded, do-while would suffice but would be less readable
+ for (uint16 y = 0; y < height; ++y) {
+ for (uint16 x = 0; x < width; ++x) {
+ uint8 pixel = *src++;
+ if (pixel)
+ *dst = pixel;
+ ++dst;
+ }
+ dst += stride;
+ }
+}
+
} /*namespace dreamgen */