diff options
author | Bertrand Augereau | 2011-07-30 15:19:22 +0200 |
---|---|---|
committer | Bertrand Augereau | 2011-07-30 15:19:22 +0200 |
commit | 95fa7451d63ad674308f1134e954387c967fb9c8 (patch) | |
tree | e5bc013f0420bb93b7e0dda5e7af1c3c34082c04 | |
parent | 1f0eccb296b0177775dd3cba2fc58961b743e819 (diff) | |
download | scummvm-rg350-95fa7451d63ad674308f1134e954387c967fb9c8.tar.gz scummvm-rg350-95fa7451d63ad674308f1134e954387c967fb9c8.tar.bz2 scummvm-rg350-95fa7451d63ad674308f1134e954387c967fb9c8.zip |
DREAMWEB: 'findsource' ported to C++
-rwxr-xr-x | devtools/tasmrecover/tasm-recover | 1 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 22 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 3 | ||||
-rw-r--r-- | engines/dreamweb/sprite.cpp | 14 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 |
5 files changed, 17 insertions, 24 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 2ec64933dd..86e9b4cd91 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -66,6 +66,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'showframe', 'initman', 'aboutturn', + 'findsource', 'walking', 'spriteupdate', 'dodoor', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 5b0ed0975b..2157d4e9de 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2237,27 +2237,6 @@ void DreamGenContext::checkone() { dx = pop(); } -void DreamGenContext::findsource() { - STACK_CHECK; - ax = data.word(kCurrentframe); - _cmp(ax, 160); - if (!flags.c()) - goto over1000; - ds = data.word(kReel1); - data.word(kTakeoff) = 0; - return; -over1000: - _cmp(ax, 320); - if (!flags.c()) - goto over1001; - ds = data.word(kReel2); - data.word(kTakeoff) = 160; - return; -over1001: - ds = data.word(kReel3); - data.word(kTakeoff) = 320; -} - void DreamGenContext::checkforexit() { STACK_CHECK; cl = data.byte(kRyanx); @@ -20519,7 +20498,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_checkspeed: checkspeed(); break; case addr_delsprite: delsprite(); break; case addr_checkone: checkone(); break; - case addr_findsource: findsource(); break; case addr_mainman: mainman(); break; case addr_checkforexit: checkforexit(); break; case addr_adjustdown: adjustdown(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 400e5a6898..ec4199856b 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -673,7 +673,6 @@ public: static const uint16 addr_adjustdown = 0xc14c; static const uint16 addr_checkforexit = 0xc148; static const uint16 addr_mainman = 0xc138; - static const uint16 addr_findsource = 0xc130; static const uint16 addr_checkone = 0xc12c; static const uint16 addr_delsprite = 0xc11c; static const uint16 addr_checkspeed = 0xc110; @@ -1382,7 +1381,7 @@ public: void fadeupmonfirst(); void drawfloor(); void loadkeypad(); - void findsource(); + //void findsource(); void clearendpal(); void findtext1(); void isryanholding(); diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp index 9b8b060475..72c8c1299e 100644 --- a/engines/dreamweb/sprite.cpp +++ b/engines/dreamweb/sprite.cpp @@ -538,5 +538,19 @@ void DreamGenContext::facerightway() { data.byte(kLeavedirection) = dir; } +void DreamGenContext::findsource() { + uint16 currentFrame = data.word(kCurrentframe); + if (currentFrame < 160) { + ds = data.word(kReel1); + data.word(kTakeoff) = 0; + } else if (currentFrame < 320) { + ds = data.word(kReel2); + data.word(kTakeoff) = 160; + } else { + ds = data.word(kReel3); + data.word(kTakeoff) = 320; + } +} + } /*namespace dreamgen */ diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index cb0a87c22e..0c2f4389e0 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -86,6 +86,7 @@ void lockeddoorway(Sprite *sprite, ObjData *objData); void liftsprite(); void liftsprite(Sprite *sprite, ObjData *objData); + void findsource(); void turnpathonCPP(uint8 param); void turnpathoffCPP(uint8 param); void getroomspaths(); |