diff options
author | Bertrand Augereau | 2011-08-18 18:36:15 +0200 |
---|---|---|
committer | Bertrand Augereau | 2011-08-18 18:36:15 +0200 |
commit | 1dff2ebe8eda57bfb396c92fcdf83f9980fc02b9 (patch) | |
tree | 0669a547e10b7afb1006c718f2bb6e4a882970c3 /engines | |
parent | efe76ac494e23f94a7a320fe0f7e31cab8225020 (diff) | |
download | scummvm-rg350-1dff2ebe8eda57bfb396c92fcdf83f9980fc02b9.tar.gz scummvm-rg350-1dff2ebe8eda57bfb396c92fcdf83f9980fc02b9.tar.bz2 scummvm-rg350-1dff2ebe8eda57bfb396c92fcdf83f9980fc02b9.zip |
DREAMWEB: 'calcmapad' ported to C++
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/backdrop.cpp | 8 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 28 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 3 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 |
4 files changed, 10 insertions, 30 deletions
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); |