From 529cd5bf959490abcc39366e06309a6aa838fe9d Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Sun, 4 Sep 2011 12:44:05 +0200 Subject: DREAMWEB: 'sortoutmap' ported to C++ --- engines/dreamweb/dreamgen.cpp | 24 ------------------------ engines/dreamweb/dreamgen.h | 3 +-- engines/dreamweb/stubs.cpp | 10 ++++++++++ engines/dreamweb/stubs.h | 1 + 4 files changed, 12 insertions(+), 26 deletions(-) (limited to 'engines/dreamweb') 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(); -- cgit v1.2.3