diff options
author | Bertrand Augereau | 2011-08-03 16:44:29 +0200 |
---|---|---|
committer | Bertrand Augereau | 2011-08-03 16:44:29 +0200 |
commit | 135efa50a1f96632dae985b593888eb706006d75 (patch) | |
tree | 17e8b38a675ad04adad83d8bbeb925f54bae92ef /engines/dreamweb/vgagrafx.cpp | |
parent | 2b03076149535d29c83b5ab5f165456a6238e57c (diff) | |
download | scummvm-rg350-135efa50a1f96632dae985b593888eb706006d75.tar.gz scummvm-rg350-135efa50a1f96632dae985b593888eb706006d75.tar.bz2 scummvm-rg350-135efa50a1f96632dae985b593888eb706006d75.zip |
DREAMWEB: Less register interaction in 'multiput' and 'multiget'
Diffstat (limited to 'engines/dreamweb/vgagrafx.cpp')
-rw-r--r-- | engines/dreamweb/vgagrafx.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp index 5acd2ec01f..a4f8d83117 100644 --- a/engines/dreamweb/vgagrafx.cpp +++ b/engines/dreamweb/vgagrafx.cpp @@ -39,13 +39,14 @@ void DreamGenContext::allocatework() { } void DreamGenContext::multiget() { - multiget(di, bx, cl, ch); + multiget(ds.ptr(si, 0), di, bx, cl, ch); + si += cl * ch; + di += bx * kScreenwidth + kScreenwidth * ch; + cx = 0; } -void DreamGenContext::multiget(uint16 x, uint16 y, uint8 w, uint8 h) { +void DreamGenContext::multiget(uint8 *dst, uint16 x, uint16 y, uint8 w, uint8 h) { unsigned src = x + y * kScreenwidth; - unsigned dst = (uint16)si; - es = ds; ds = data.word(kWorkspace); if (y + h > 200) h = 200 - y; @@ -53,21 +54,20 @@ void DreamGenContext::multiget(uint16 x, uint16 y, uint8 w, uint8 h) { w = 320 - x; //debug(1, "multiget %u,%u %ux%u -> segment: %04x->%04x", x, y, w, h, (uint16)ds, (uint16)es); for(unsigned l = 0; l < h; ++l) { - uint8 *src_p = ds.ptr(src + kScreenwidth * l, w); - uint8 *dst_p = es.ptr(dst + w * l, w); + const uint8 *src_p = ds.ptr(src + kScreenwidth * l, w); + uint8 *dst_p = dst + w * l; memcpy(dst_p, src_p, w); } - si += w * h; - di = src + kScreenwidth * h; - cx = 0; } void DreamGenContext::multiput() { - multiput(di, bx, cl, ch); + multiput(ds.ptr(si, 0), di, bx, cl, ch); + si += cl * ch; + di += bx * kScreenwidth + kScreenwidth * ch; + cx = 0; } -void DreamGenContext::multiput(uint16 x, uint16 y, uint8 w, uint8 h) { - unsigned src = (uint16)si; +void DreamGenContext::multiput(const uint8 *src, uint16 x, uint16 y, uint8 w, uint8 h) { unsigned dst = x + y * kScreenwidth; es = data.word(kWorkspace); if (y + h > 200) @@ -76,13 +76,10 @@ void DreamGenContext::multiput(uint16 x, uint16 y, uint8 w, uint8 h) { w = 320 - x; //debug(1, "multiput %ux%u -> segment: %04x->%04x", w, h, (uint16)ds, (uint16)es); for(unsigned l = 0; l < h; ++l) { - uint8 *src_p = ds.ptr(src + w * l, w); + const uint8 *src_p = src + w * l; uint8 *dst_p = es.ptr(dst + kScreenwidth * l, w); memcpy(dst_p, src_p, w); } - si += w * h; - di = dst + kScreenwidth * h; - cx = 0; } void DreamGenContext::multidump(uint16 x, uint16 y, uint8 width, uint8 height) { |