diff options
author | Filippos Karapetis | 2011-12-18 20:17:55 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-18 20:17:55 +0200 |
commit | 25b99c448d63da48b639834d41146d2f30a11e49 (patch) | |
tree | e9a053cd4d1a5765183ad7b2ab9548d8afb91ce9 /engines/dreamweb/dreamgen.cpp | |
parent | 833507695e9a096489cb6e3a7ca5ad854a769fc7 (diff) | |
download | scummvm-rg350-25b99c448d63da48b639834d41146d2f30a11e49.tar.gz scummvm-rg350-25b99c448d63da48b639834d41146d2f30a11e49.tar.bz2 scummvm-rg350-25b99c448d63da48b639834d41146d2f30a11e49.zip |
DREAMWEB: Rewrite signOn into C++, and remove the users and passwords from the data blob
Note that the string processing logic in signOn is a bit different from
the original, but the end result is the same (with cleaner code)
Diffstat (limited to 'engines/dreamweb/dreamgen.cpp')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 183 |
1 files changed, 34 insertions, 149 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 644187c558..5be71266cd 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -1773,14 +1773,14 @@ void DreamGenContext::getDestInfo() { push(ax); dx = data; es = dx; - si = 661; + si = 555; _add(si, ax); cl = es.byte(si); ax = pop(); push(cx); dx = data; es = dx; - si = 677; + si = 571; _add(si, ax); ax = pop(); } @@ -1832,7 +1832,7 @@ clearedlocations: bx = ax; dx = data; es = dx; - _add(bx, 661); + _add(bx, 555); es.byte(bx) = 0; } @@ -1852,7 +1852,7 @@ dirroot: si = offset_rootdir; _inc(si); es = cs; - di = 586; + di = 480; _inc(di); cx = 12; _movsb(cx, true); @@ -1885,107 +1885,6 @@ directloop1: goto directloop1; } -void DreamGenContext::signOn() { - STACK_CHECK; - parser(); - _inc(di); - ds = cs; - si = offset_keys; - cx = 4; -signonloop: - push(cx); - push(si); - push(di); - _add(si, 14); - cx = 11; -signonloop2: - _lodsb(); - _cmp(al, 32); - if (flags.z()) - goto foundsign; - makeCaps(); - ah = es.byte(di); - _inc(di); - _cmp(al, ah); - if (!flags.z()) - goto nomatch; - if (--cx) - goto signonloop2; -nomatch: - di = pop(); - si = pop(); - cx = pop(); - _add(si, 26); - if (--cx) - goto signonloop; - al = 13; - monMessage(); - return; -foundsign: - di = pop(); - si = pop(); - cx = pop(); - bx = si; - es = ds; - _cmp(es.byte(bx), 0); - if (flags.z()) - goto notyetassigned; - al = 17; - monMessage(); - return; -notyetassigned: - push(es); - push(bx); - scrollMonitor(); - al = 15; - monMessage(); - di = data.word(kMonadx); - bx = data.word(kMonady); - push(di); - push(bx); - input(); - bx = pop(); - di = pop(); - data.word(kMonadx) = di; - data.word(kMonady) = bx; - bx = pop(); - es = pop(); - push(es); - push(bx); - _add(bx, 2); - ds = cs; - si = 695; -checkpass: - _lodsw(); - ah = es.byte(bx); - _inc(bx); - _cmp(ah, 32); - if (flags.z()) - goto passpassed; - _cmp(al, ah); - if (flags.z()) - goto checkpass; - bx = pop(); - es = pop(); - scrollMonitor(); - al = 16; - monMessage(); - return; -passpassed: - al = 14; - monMessage(); - bx = pop(); - es = pop(); - push(es); - push(bx); - _add(bx, 14); - monPrint(); - scrollMonitor(); - bx = pop(); - es = pop(); - es.byte(bx) = 1; -} - void DreamGenContext::read() { STACK_CHECK; cx = 40; @@ -1998,7 +1897,7 @@ void DreamGenContext::read() { return; okcom: es = cs; - di = 586; + di = 480; ax = data.word(kTextfile1); data.word(kMonsource) = ax; ds = ax; @@ -2128,7 +2027,7 @@ keyok2: ds = cs; si = offset_operand1+1; es = cs; - di = 586+1; + di = 480+1; cx = 12; _movsb(cx, true); monitorLogo(); @@ -2210,7 +2109,7 @@ void DreamGenContext::parser() { al = '='; _stosb(); ds = cs; - si = 695; + si = 589; notspace1: _lodsw(); _cmp(al, 32); @@ -2393,55 +2292,41 @@ void DreamGenContext::__start() { //0x01a0: .... .... .... .... 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, //0x01b0: .... ...D REAM WEB. - 0x56, 0x39, 0x39, 0x00, 0x01, 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, - //0x01c0: V99. ..PU BLIC - 0x20, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, - //0x01d0: PU BLIC ... - 0x42, 0x4c, 0x41, 0x43, 0x4b, 0x44, 0x52, 0x41, 0x47, 0x4f, 0x4e, 0x20, 0x52, 0x59, 0x41, 0x4e, - //0x01e0: BLAC KDRA GON RYAN - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x48, 0x45, 0x4e, 0x44, 0x52, 0x49, - //0x01f0: . ..HE NDRI - 0x58, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x4f, 0x55, 0x49, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, - //0x0200: X LO UIS - 0x20, 0x00, 0x00, 0x00, 0x53, 0x45, 0x50, 0x54, 0x49, 0x4d, 0x55, 0x53, 0x20, 0x20, 0x20, 0x20, - //0x0210: ... SEPT IMUS - 0x42, 0x45, 0x43, 0x4b, 0x45, 0x54, 0x54, 0x20, 0x20, 0x20, 0x20, 0x00, 0xff, 0xff, 0x20, 0x20, - //0x0220: BECK ETT . .. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x52, 0x4f, 0x4f, - //0x0230: . "ROO - 0x54, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, - //0x0240: T ." - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x10, 0x12, 0x12, - //0x0250: . .... $... - 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, - //0x0260: .... .... .... .... - 0x02, 0x02, 0x02, 0x02, 0x02, 0x44, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0270: .... .D:. .... .... + 0x56, 0x39, 0x39, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + //0x01c0: V99. + 0x20, 0x00, 0x22, 0x52, 0x4f, 0x4f, 0x54, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, + //0x01d0: ."R OOT . + 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x0d, 0x0a, + //0x01e0: " ... + 0x0d, 0x0a, 0x24, 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + //0x01f0: ..$. .... .... .... + 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x44, 0x3a, 0x00, 0x00, 0x00, + //0x0200: .... .... ...D :... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0280: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0290: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, - //0x02a0: .... .... .... .... - 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x02b0: .... .... .... .... + //0x0210: .... .... .... .... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, + //0x0220: .... .... .... .... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, + //0x0230: .... .... .... .... + 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + //0x0240: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x02c0: .... .... .... .... + //0x0250: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x02d0: .... .... .... .... + //0x0260: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x02e0: .... .... .... .... + //0x0270: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x02f0: .... .... .... .... + //0x0280: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0300: .... .... .... .... + //0x0290: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0310: .... .... .... .... + //0x02a0: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0320: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, - //0x0330: .... .... .... .... - }; + //0x02b0: .... .... .... .... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + //0x02c0: .... .... .... .... + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, }; ds.assign(src, src + sizeof(src)); dreamweb(); } |