diff options
author | Filippos Karapetis | 2011-12-08 22:05:32 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-08 22:05:32 +0200 |
commit | 8b61fb168d03e045c0fec85e8ce4fbb93dd535b8 (patch) | |
tree | eccf4f3dede0c69346367d67d0b6987d9eb7908d /engines | |
parent | e287ac0e39324d2149633d080780bf2b57ccf3d2 (diff) | |
download | scummvm-rg350-8b61fb168d03e045c0fec85e8ce4fbb93dd535b8.tar.gz scummvm-rg350-8b61fb168d03e045c0fec85e8ce4fbb93dd535b8.tar.bz2 scummvm-rg350-8b61fb168d03e045c0fec85e8ce4fbb93dd535b8.zip |
DREAMWEB: Port 'madmanrun' to C++
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 31 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 19 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 |
4 files changed, 20 insertions, 32 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 65d8d4a33d..b29e04b2dc 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -6600,37 +6600,6 @@ void DreamGenContext::clearChanges() { _stosw(cx, true); } -void DreamGenContext::madmanRun() { - STACK_CHECK; - _cmp(data.byte(kLocation), 14); - if (!flags.z()) - { identifyOb(); return; }; - _cmp(data.byte(kMapx), 22); - if (!flags.z()) - { identifyOb(); return; }; - _cmp(data.byte(kPointermode), 2); - if (!flags.z()) - { identifyOb(); return; }; - _cmp(data.byte(kMadmanflag), 0); - if (!flags.z()) - { identifyOb(); return; }; - _cmp(data.byte(kCommandtype), 211); - if (flags.z()) - goto alreadyrun; - data.byte(kCommandtype) = 211; - al = 52; - commandOnly(); -alreadyrun: - _cmp(data.word(kMousebutton), 1); - if (!flags.z()) - return /* (norun) */; - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (norun) */; - data.byte(kLastweapon) = 8; -} - void DreamGenContext::identifyOb() { STACK_CHECK; _cmp(data.word(kWatchingtime), 0); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 5e0523d2a3..0f4dcdb01e 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -679,7 +679,6 @@ public: void clearChanges(); void searchForFiles(); void monkSpeaking(); - void madmanRun(); void getExAd(); void initialMonCols(); void useButtonA(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 674ea212fa..35b0ae3ac4 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -3899,4 +3899,23 @@ void DreamGenContext::afterNewRoom() { atmospheres(); } +void DreamGenContext::madmanRun() { + if (data.byte(kLocation) != 14 || + data.byte(kMapx) != 22 || + data.byte(kPointermode) != 2 || + data.byte(kMadmanflag) != 0) { + identifyOb(); + return; + } + + if (data.byte(kCommandtype) != 211) { + data.byte(kCommandtype) = 211; + commandOnly(52); + } + + if (data.word(kMousebutton) == 1 && + data.word(kMousebutton) != data.word(kOldbutton)) + data.byte(kLastweapon) = 8; +} + } // End of namespace DreamGen diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 582109f400..f4bb1ec13b 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -549,5 +549,6 @@ DreamBase::removeFreeObject(index); } void afterNewRoom(); + void madmanRun(); #endif |