aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb
diff options
context:
space:
mode:
authorBertrand Augereau2011-09-04 12:44:05 +0200
committerBertrand Augereau2011-09-04 12:55:04 +0200
commit529cd5bf959490abcc39366e06309a6aa838fe9d (patch)
tree0644b639fb873132536f926b1c292975e2da2071 /engines/dreamweb
parent8261b56313655c5b6ff2df92e4ddd1299d3aba88 (diff)
downloadscummvm-rg350-529cd5bf959490abcc39366e06309a6aa838fe9d.tar.gz
scummvm-rg350-529cd5bf959490abcc39366e06309a6aa838fe9d.tar.bz2
scummvm-rg350-529cd5bf959490abcc39366e06309a6aa838fe9d.zip
DREAMWEB: 'sortoutmap' ported to C++
Diffstat (limited to 'engines/dreamweb')
-rw-r--r--engines/dreamweb/dreamgen.cpp24
-rw-r--r--engines/dreamweb/dreamgen.h3
-rw-r--r--engines/dreamweb/stubs.cpp10
-rw-r--r--engines/dreamweb/stubs.h1
4 files changed, 12 insertions, 26 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 8f4b4cea21..5f9712eb3d 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -15374,29 +15374,6 @@ void DreamGenContext::restoreall() {
setallchanges();
}
-void DreamGenContext::sortoutmap() {
- STACK_CHECK;
- push(es);
- push(di);
- ds = data.word(kWorkspace);
- si = 0;
- es = data.word(kMapdata);
- di = 0;
- cx = (60);
-blimey:
- push(cx);
- push(si);
- cx = (66);
- _movsb(cx, true);
- si = pop();
- cx = pop();
- _add(si, 132);
- if (--cx)
- goto blimey;
- di = pop();
- es = pop();
-}
-
void DreamGenContext::disablepath() {
STACK_CHECK;
push(cx);
@@ -17237,7 +17214,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_getridofall: getridofall(); break;
case addr_restorereels: restorereels(); break;
case addr_restoreall: restoreall(); break;
- case addr_sortoutmap: sortoutmap(); break;
case addr_disablepath: disablepath(); break;
case addr_findroominloc: findroominloc(); break;
case addr_dontloadseg: dontloadseg(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index f3a763fbd8..3da4e7166c 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -60,7 +60,6 @@ public:
static const uint16 addr_dontloadseg = 0xcb64;
static const uint16 addr_findroominloc = 0xcb58;
static const uint16 addr_disablepath = 0xcb50;
- static const uint16 addr_sortoutmap = 0xcb48;
static const uint16 addr_restoreall = 0xcb44;
static const uint16 addr_restorereels = 0xcb40;
static const uint16 addr_getridofall = 0xcb3c;
@@ -1769,7 +1768,7 @@ public:
//void madmode();
void intro3text();
void allocatemem();
- void sortoutmap();
+ //void sortoutmap();
//void showrain();
void useopened();
void inventory();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 7f8a511cde..93688bf643 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1882,5 +1882,15 @@ void DreamGenContext::zoomonoff() {
worktoscreenm();
}
+void DreamGenContext::sortoutmap() {
+ const uint8 *src = (const uint8 *)segRef(data.word(kWorkspace)).ptr(0, 0);
+ uint8 *dst = (uint8 *)segRef(data.word(kMapdata)).ptr(0, 0);
+ for (uint16 y = 0; y < kMaplength; ++y) {
+ memcpy(dst, src, kMapwidth);
+ dst += kMapwidth;
+ src += 132;
+ }
+}
+
} /*namespace dreamgen */
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index ac7e1a5b91..3e928fe676 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -246,4 +246,5 @@
uint8 getblockofpixel(uint8 x, uint8 y);
void bresenhams();
void examineobtext();
+ void sortoutmap();