diff options
-rwxr-xr-x | devtools/tasmrecover/tasm-recover | 2 | ||||
-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 |
5 files changed, 21 insertions, 46 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 2ed1edfdd2..29b9ae5106 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -453,6 +453,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'getdimension', 'getexpos', 'getflagunderp', + 'getkeyandlogo', 'getlocation', 'getmapad', 'getnamepos', @@ -520,6 +521,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'keeper', 'kernchars', 'keyboardread', + 'keynum', 'lastdest', 'lastfolder', 'liftnoise', 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 |