diff options
author | Bertrand Augereau | 2011-12-02 18:05:10 +0100 |
---|---|---|
committer | Bertrand Augereau | 2011-12-02 18:11:54 +0100 |
commit | 8f7473f5336d46267e870dc4c55d163d0a13c201 (patch) | |
tree | 6d1afa228436e678c5729869be72afebddeef893 /engines/dreamweb | |
parent | fb9b5d11efa3eac1aa43a8247fe5c4da4400dfb1 (diff) | |
download | scummvm-rg350-8f7473f5336d46267e870dc4c55d163d0a13c201.tar.gz scummvm-rg350-8f7473f5336d46267e870dc4c55d163d0a13c201.tar.bz2 scummvm-rg350-8f7473f5336d46267e870dc4c55d163d0a13c201.zip |
DREAMWEB: 'isItRight' ported to C++
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 17 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/keypad.cpp | 15 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 |
4 files changed, 8 insertions, 26 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index e3ea81e7ab..56d0b3dfe3 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -7358,23 +7358,6 @@ void DreamGenContext::openSarters() { data.byte(kGetback) = 1; } -void DreamGenContext::isItRight() { - STACK_CHECK; - bx = data; - es = bx; - bx = 8573; - _cmp(es.byte(bx+0), al); - if (!flags.z()) - return /* (notright) */; - _cmp(es.byte(bx+1), ah); - if (!flags.z()) - return /* (notright) */; - _cmp(es.byte(bx+2), cl); - if (!flags.z()) - return /* (notright) */; - _cmp(es.byte(bx+3), ch); -} - void DreamGenContext::drawItAll() { STACK_CHECK; createPanel(); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 3f9b8d8de2..e729f1ef99 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -919,7 +919,6 @@ public: void setSoundOff(); void setPickup(); void dropObject(); - void isItRight(); void openOb(); void drawItAll(); void useStereo(); diff --git a/engines/dreamweb/keypad.cpp b/engines/dreamweb/keypad.cpp index b70dee4758..e133f1f4a7 100644 --- a/engines/dreamweb/keypad.cpp +++ b/engines/dreamweb/keypad.cpp @@ -75,6 +75,12 @@ void DreamGenContext::enterCode() { enterCode(al, ah, cl, ch); } +bool DreamGenContext::isItRight(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3) { + + return digit0 == data.byte(kPresslist+0) && digit1 == data.byte(kPresslist+1) + && digit2 == data.byte(kPresslist+2) && digit3 == data.byte(kPresslist+3); +} + void DreamGenContext::enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3) { RectWithCallback keypadList[] = { { kKeypadx+9,kKeypadx+30,kKeypady+9,kKeypady+22,&DreamGenContext::buttonOne }, @@ -93,10 +99,6 @@ void DreamGenContext::enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8 { 0xFFFF,0,0,0,0 } }; - data.byte(kKeypadax+0) = digit0; - data.byte(kKeypadax+1) = digit1; - data.byte(kKeypadcx+0) = digit2; - data.byte(kKeypadcx+1) = digit3; getRidOfReels(); loadKeypad(); createPanel(); @@ -135,10 +137,7 @@ void DreamGenContext::enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8 if (data.byte(kPresscount) == 40) { addToPressList(); if (data.byte(kPressed) == 11) { - ax = data.word(kKeypadax); - cx = data.word(kKeypadcx); - isItRight(); - if (flags.z()) + if (isItRight(digit0, digit1, digit2, digit3)) data.byte(kLockstatus) = 0; playChannel1(11); data.byte(kLightcount) = 120; diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index dda57a47c4..346d2d1bb4 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -396,6 +396,7 @@ void buttonNought(); void buttonEnter(); void buttonPress(uint8 buttonId); + bool isItRight(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3); void enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3); void enterCode(); |