aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Menshakov2011-06-10 10:24:02 +0400
committerAlyssa Milburn2011-06-15 17:33:55 +0200
commit4c54bf9799329da3a030d4df524c8e2b87b7a7fa (patch)
treefb8cb166b60b26887b90dc9f2056995945dc9991
parent8cc8e73d1f80065c6359f98722e1a4de2cb62654 (diff)
downloadscummvm-rg350-4c54bf9799329da3a030d4df524c8e2b87b7a7fa.tar.gz
scummvm-rg350-4c54bf9799329da3a030d4df524c8e2b87b7a7fa.tar.bz2
scummvm-rg350-4c54bf9799329da3a030d4df524c8e2b87b7a7fa.zip
DREAMWEB: implemented multiXXX vga functions
-rw-r--r--engines/dreamweb/dreamweb.cpp37
1 files changed, 34 insertions, 3 deletions
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index adc2cbbaa2..68370ffa17 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -228,15 +228,46 @@ static inline DreamWeb::DreamWebEngine *engine() {
}
void multiget(Context &context) {
- ::error("multiget");
+ unsigned w = (uint8)context.cl, h = (uint8)context.ch;
+ unsigned pitch = (uint16)context.data.word(kScreenwidth);
+ unsigned src = (uint16)context.di + (uint16)context.bx * pitch;
+ unsigned dst = (uint16)context.si;
+ context.es = context.ds;
+ context.ds = context.data.word(kWorkspace);
+ //debug(1, "multiget %ux%u -> segment: %04x->%04x", w, h, (uint16)context.ds, (uint16)context.es);
+ for(unsigned y = 0; y < h; ++y) {
+ uint8 *src_p = context.ds.ptr(src + pitch * y, w);
+ uint8 *dst_p = context.es.ptr(dst + w * y, w);
+ memcpy(src_p, dst_p, w);
+ }
}
void multiput(Context &context) {
- ::error("multiput");
+ unsigned w = (uint8)context.cl, h = (uint8)context.ch;
+ unsigned pitch = (uint16)context.data.word(kScreenwidth);
+ unsigned src = (uint16)context.si;
+ unsigned dst = (uint16)context.di + (uint16)context.bx * pitch;
+ context.es = context.data.word(kWorkspace);
+ //debug(1, "multiput %ux%u -> segment: %04x->%04x", w, h, (uint16)context.ds, (uint16)context.es);
+ for(unsigned y = 0; y < h; ++y) {
+ uint8 *src_p = context.ds.ptr(src + w * y, w);
+ uint8 *dst_p = context.es.ptr(dst + pitch * y, w);
+ memcpy(src_p, dst_p, w);
+ }
}
void multidump(Context &context) {
- ::error("multidump");
+ unsigned w = (uint8)context.cl, h = (uint8)context.ch;
+ context.es = 0xa000;
+ context.ds = context.data.word(kWorkspace);
+ //debug(1, "multidump %ux%u -> segment: %04x->%04x", w, h, (uint16)context.ds, (uint16)context.es);
+ unsigned pitch = (uint16)context.data.word(kScreenwidth);
+ unsigned offset = (uint16)context.di + (uint16)context.bx * pitch;
+ for(unsigned y = 0; y < h; ++y, offset += pitch * y) {
+ uint8 *src_p = context.ds.ptr(offset, w);
+ uint8 *dst_p = context.es.ptr(offset, w);
+ memcpy(src_p, dst_p, w);
+ }
}
void frameoutnm(Context &context) {