aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Augereau2011-08-18 18:36:15 +0200
committerBertrand Augereau2011-08-18 18:36:15 +0200
commit1dff2ebe8eda57bfb396c92fcdf83f9980fc02b9 (patch)
tree0669a547e10b7afb1006c718f2bb6e4a882970c3
parentefe76ac494e23f94a7a320fe0f7e31cab8225020 (diff)
downloadscummvm-rg350-1dff2ebe8eda57bfb396c92fcdf83f9980fc02b9.tar.gz
scummvm-rg350-1dff2ebe8eda57bfb396c92fcdf83f9980fc02b9.tar.bz2
scummvm-rg350-1dff2ebe8eda57bfb396c92fcdf83f9980fc02b9.zip
DREAMWEB: 'calcmapad' ported to C++
-rwxr-xr-xdevtools/tasmrecover/tasm-recover1
-rw-r--r--engines/dreamweb/backdrop.cpp8
-rw-r--r--engines/dreamweb/dreamgen.cpp28
-rw-r--r--engines/dreamweb/dreamgen.h3
-rw-r--r--engines/dreamweb/stubs.h1
5 files changed, 11 insertions, 30 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index e14388ac65..1082c12682 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -124,6 +124,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'getxad',
'getyad',
'getmapad',
+ 'calcmapad',
'calcfrframe',
'finalframe',
'commandonly',
diff --git a/engines/dreamweb/backdrop.cpp b/engines/dreamweb/backdrop.cpp
index be957bf51d..e1800bafc0 100644
--- a/engines/dreamweb/backdrop.cpp
+++ b/engines/dreamweb/backdrop.cpp
@@ -228,5 +228,13 @@ void DreamGenContext::getdimension(uint8 *mapXstart, uint8 *mapYstart, uint8 *ma
data.byte(kMapysize) = *mapYsize << 4;
}
+void DreamGenContext::calcmapad() {
+ uint8 mapXstart, mapYstart;
+ uint8 mapXsize, mapYsize;
+ getdimension(&mapXstart, &mapYstart, &mapXsize, &mapYsize);
+ data.word(kMapadx) = data.word(kMapoffsetx) - 8 * (mapXsize + 2 * mapXstart - 11);
+ data.word(kMapady) = data.word(kMapoffsety) - 8 * (mapYsize + 2 * mapYstart - 10);
+}
+
} /*namespace dreamgen */
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 75794bda0b..7c6a16b209 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -6401,33 +6401,6 @@ void DreamGenContext::drawfloor() {
es = pop();
}
-void DreamGenContext::calcmapad() {
- STACK_CHECK;
- getdimension();
- push(cx);
- push(dx);
- al = 11;
- _sub(al, dl);
- _sub(al, cl);
- _sub(al, cl);
- ax.cbw();
- bx = 8;
- _mul(bx);
- _add(ax, data.word(kMapoffsetx));
- data.word(kMapadx) = ax;
- dx = pop();
- cx = pop();
- al = 10;
- _sub(al, dh);
- _sub(al, ch);
- _sub(al, ch);
- ax.cbw();
- bx = 8;
- _mul(bx);
- _add(ax, data.word(kMapoffsety));
- data.word(kMapady) = ax;
-}
-
void DreamGenContext::drawflags() {
STACK_CHECK;
es = data.word(kBuffers);
@@ -18651,7 +18624,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_deleteextext: deleteextext(); break;
case addr_blockget: blockget(); break;
case addr_drawfloor: drawfloor(); break;
- case addr_calcmapad: calcmapad(); break;
case addr_drawflags: drawflags(); break;
case addr_showallfree: showallfree(); break;
case addr_showallex: showallex(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index f466504b7a..0f5534e13b 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -480,7 +480,6 @@ public:
static const uint16 addr_showallex = 0xc450;
static const uint16 addr_showallfree = 0xc44c;
static const uint16 addr_drawflags = 0xc43c;
- static const uint16 addr_calcmapad = 0xc42c;
static const uint16 addr_drawfloor = 0xc428;
static const uint16 addr_blockget = 0xc424;
static const uint16 addr_deleteextext = 0xc420;
@@ -1586,7 +1585,7 @@ public:
void clearpalette();
void cantdrop();
void maptopanel();
- void calcmapad();
+ //void calcmapad();
void getridofall();
void copper();
void folderhints();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index adca64f704..31a10c5698 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -137,6 +137,7 @@
void getdimension();
void getdimension(uint8 *mapXstart, uint8 *mapYstart, uint8 *mapXsize, uint8 *mapYsize);
void getmapad();
+ void calcmapad();
uint8 getmapad(const uint8 *setData);
uint8 getxad(const uint8 *setData, uint8 *result);
uint8 getyad(const uint8 *setData, uint8 *result);