diff options
author | Filippos Karapetis | 2011-12-18 14:14:25 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-18 15:44:16 +0200 |
commit | a5879196df33eb7946b2c7afa6491c9a7d5e7213 (patch) | |
tree | eed18f77f78bc412dfdeedd54eaa9beb3cc233ea | |
parent | 8c8666e811d1b68fec400f4100a02146e0e1235b (diff) | |
download | scummvm-rg350-a5879196df33eb7946b2c7afa6491c9a7d5e7213.tar.gz scummvm-rg350-a5879196df33eb7946b2c7afa6491c9a7d5e7213.tar.bz2 scummvm-rg350-a5879196df33eb7946b2c7afa6491c9a7d5e7213.zip |
DREAMWEB: Port 'showdiarykeys' to C++
-rwxr-xr-x | devtools/tasmrecover/tasm-recover | 1 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 46 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 20 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 |
5 files changed, 22 insertions, 47 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 42aac4a763..efdeb07680 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -752,6 +752,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'showcurrentfile', 'showdecisions', 'showdiary', + 'showdiarykeys', 'showdiarypage', 'showdiscops', 'showexit', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 04276c001e..43c2e50d1e 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2463,52 +2463,6 @@ lookcolon: goto lookcolon; } -void DreamGenContext::showDiaryKeys() { - STACK_CHECK; - _cmp(data.byte(kPresscount), 0); - if (flags.z()) - return /* (nokeyatall) */; - _dec(data.byte(kPresscount)); - _cmp(data.byte(kPresscount), 0); - if (flags.z()) - return /* (nokeyatall) */; - _cmp(data.byte(kPressed), 'N'); - if (!flags.z()) - goto nokeyn; - al = 3; - _cmp(data.byte(kPresscount), 1); - if (flags.z()) - goto gotkeyn; - al = 4; -gotkeyn: - ah = 0; - di = (68+24)+94; - bx = (48+12)+97; - ds = data.word(kTempgraphics); - showFrame(); - _cmp(data.byte(kPresscount), 1); - if (!flags.z()) - return /* (notshown) */; - showDiaryPage(); - return; -nokeyn: - al = 5; - _cmp(data.byte(kPresscount), 1); - if (flags.z()) - goto gotkeyp; - al = 6; -gotkeyp: - ah = 0; - di = (68+24)+151; - bx = (48+12)+71; - ds = data.word(kTempgraphics); - showFrame(); - _cmp(data.byte(kPresscount), 1); - if (!flags.z()) - return /* (notshowp) */; - showDiaryPage(); -} - void DreamGenContext::findPathOfPoint() { STACK_CHECK; push(ax); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index cbf4d558c8..9ecd688824 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -507,7 +507,6 @@ public: void deleteExObject(); void getEitherAd(); void dropObject(); - void showDiaryKeys(); void useOpened(); void signOn(); void locationPic(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 021b2bad84..51587f1bde 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -4569,5 +4569,25 @@ void DreamBase::clearChanges() { memcpy(data.ptr(kRoomscango, 16), initialRoomsCanGo, 16); } +void DreamGenContext::showDiaryKeys() { + if (!data.byte(kPresscount)) + return; // nokeyatall + + data.byte(kPresscount)--; + + if (!data.byte(kPresscount)) + return; // nokeyatall + + if (data.byte(kPressed) == 'N') { + byte frame = (data.byte(kPresscount) == 1) ? 3 : 4; + showFrame(tempGraphics(), kDiaryx + 94, kDiaryy + 97, frame, 0); + } else { + byte frame = (data.byte(kPresscount) == 1) ? 5 : 6; + showFrame(tempGraphics(), kDiaryx + 151, kDiaryy + 71, frame, 0); + } + + if (data.byte(kPresscount) == 1) + showDiaryPage(); +} } // End of namespace DreamGen diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index b835a26ea1..1578aefc71 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -368,5 +368,6 @@ void findInvPos(); uint16 findInvPosCPP(); void setPickup(); + void showDiaryKeys(); #endif |