diff options
author | Filippos Karapetis | 2011-12-18 16:43:05 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-18 16:43:05 +0200 |
commit | 62dc71a73a894426cb2f5c61e26ab53b0c9f06ad (patch) | |
tree | 49d239aac3bf33ca74cf0c95e3a934207c089ad2 /engines | |
parent | 362f21d30d2b8f531c30ec19829326e369ac01cd (diff) | |
download | scummvm-rg350-62dc71a73a894426cb2f5c61e26ab53b0c9f06ad.tar.gz scummvm-rg350-62dc71a73a894426cb2f5c61e26ab53b0c9f06ad.tar.bz2 scummvm-rg350-62dc71a73a894426cb2f5c61e26ab53b0c9f06ad.zip |
DREAMWEB: Port 'getkeyandlogo' to C++
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 45 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/monitor.cpp | 18 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 |
4 files changed, 19 insertions, 46 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index f7632514e1..6034e0ea69 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2298,51 +2298,6 @@ endofdir2: scrollMonitor(); } -void DreamGenContext::getKeyAndLogo() { - STACK_CHECK; - _inc(bx); - al = es.byte(bx); - _sub(al, 48); - data.byte(kNewlogonum) = al; - _add(bx, 2); - al = es.byte(bx); - _sub(al, 48); - data.byte(kKeynum) = al; - _inc(bx); - push(es); - push(bx); - al = data.byte(kKeynum); - ah = 0; - cx = 26; - _mul(cx); - es = cs; - bx = offset_keys; - _add(bx, ax); - al = es.byte(bx); - _cmp(al, 1); - if (flags.z()) - goto keyok; - push(bx); - push(es); - al = 12; - monMessage(); - es = pop(); - bx = pop(); - _add(bx, 14); - monPrint(); - scrollMonitor(); - bx = pop(); - es = pop(); - al = 1; - return; -keyok: - bx = pop(); - es = pop(); - al = data.byte(kNewlogonum); - data.byte(kLogonum) = al; - al = 0; -} - void DreamGenContext::searchForString() { STACK_CHECK; dl = es.byte(di); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 12af1ab3c7..7f1601e5f6 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -487,7 +487,6 @@ public: void removeObFromInv(); void dirFile(); void pickupConts(); - void getKeyAndLogo(); void fadeUpMon(); void reExFromInv(); void outOfInv(); diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp index 8ff199cf49..dd94633105 100644 --- a/engines/dreamweb/monitor.cpp +++ b/engines/dreamweb/monitor.cpp @@ -445,4 +445,22 @@ void DreamGenContext::showKeys() { scrollMonitor(); } +void DreamGenContext::getKeyAndLogo() { + byte newLogo = es.byte(bx + 1) - 48; + MonitorKeyEntry *monitorKeyEntries = (MonitorKeyEntry *)data.ptr(offset_keys, 0); + byte keyNum = es.byte(bx + 1 + 2) - 48; + bx += 1 + 2 + 1; + + if (monitorKeyEntries[keyNum].keyHeld == 1) { + // Key OK + data.byte(kLogonum) = newLogo; + al = 0; + } else { + monMessage(12); // "Access denied, key required -" + monPrint(monitorKeyEntries[keyNum].userpass + 12); // username + scrollMonitor(); + al = 1; + } +} + } // End of namespace DreamGen diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 0d2d8dfe76..3e61367e2d 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -370,5 +370,6 @@ void setPickup(); void showDiaryKeys(); void showKeys(); + void getKeyAndLogo(); #endif |