From 654a60a90cfec631893598325dbfc5ab8adbfa35 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 17 Dec 2011 00:01:45 +0200 Subject: DREAMWEB: Rewrote useCashCard() in C++ and got rid of moneyPoke() and its associated offsets in the data blob --- engines/dreamweb/dreamgen.cpp | 134 +++++------------------------------------- 1 file changed, 16 insertions(+), 118 deletions(-) (limited to 'engines/dreamweb/dreamgen.cpp') diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index b756c39bbf..47b01d3785 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2170,14 +2170,14 @@ void DreamGenContext::getDestInfo() { push(ax); dx = data; es = dx; - si = 1131; + si = 1123; _add(si, ax); cl = es.byte(si); ax = pop(); push(cx); dx = data; es = dx; - si = 1147; + si = 1139; _add(si, ax); ax = pop(); } @@ -2229,7 +2229,7 @@ clearedlocations: bx = ax; dx = data; es = dx; - _add(bx, 1131); + _add(bx, 1123); es.byte(bx) = 0; } @@ -2370,7 +2370,7 @@ notyetassigned: push(bx); _add(bx, 2); ds = cs; - si = 1165; + si = 1157; checkpass: _lodsw(); ah = es.byte(bx); @@ -2698,7 +2698,7 @@ void DreamGenContext::parser() { al = '='; _stosb(); ds = cs; - si = 1165; + si = 1157; notspace1: _lodsw(); _cmp(al, 32); @@ -2736,106 +2736,6 @@ lookcolon: goto lookcolon; } -void DreamGenContext::useCashCard() { - STACK_CHECK; - getRidOfReels(); - loadKeypad(); - createPanel(); - showPanel(); - showExit(); - showMan(); - di = 114; - bx = 120; - _cmp(data.byte(kForeignrelease), 0); - if (flags.z()) - goto _tmp1; - bx = 120-3; -_tmp1: - ds = data.word(kTempgraphics); - al = 39; - ah = 0; - showFrame(); - ax = data.word(kCard1money); - moneyPoke(); - getObTextStart(); - nextColon(); - nextColon(); - di = 36; - bx = 98; - dl = 241; - al = 0; - ah = 0; - printDirect(); - di = 160; - bx = 155; - es = cs; - si = offset_money1poke; - data.word(kCharshift) = 91*2+75; - al = 0; - ah = 0; - dl = 240; - printDirect(); - di = 187; - bx = 155; - es = cs; - si = offset_money2poke; - data.word(kCharshift) = 91*2+85; - al = 0; - ah = 0; - dl = 240; - printDirect(); - data.word(kCharshift) = 0; - workToScreenM(); - cx = 400; - hangOnP(); - getRidOfTemp(); - restoreReels(); - putBackObStuff(); -} - -void DreamGenContext::moneyPoke() { - STACK_CHECK; - bx = offset_money1poke; - cl = 48-1; -numberpoke0: - _inc(cl); - _sub(ax, 10000); - if (!flags.c()) - goto numberpoke0; - _add(ax, 10000); - cs.byte(bx) = cl; - _inc(bx); - cl = 48-1; -numberpoke1: - _inc(cl); - _sub(ax, 1000); - if (!flags.c()) - goto numberpoke1; - _add(ax, 1000); - cs.byte(bx) = cl; - _inc(bx); - cl = 48-1; -numberpoke2: - _inc(cl); - _sub(ax, 100); - if (!flags.c()) - goto numberpoke2; - _add(ax, 100); - cs.byte(bx) = cl; - _inc(bx); - cl = 48-1; -numberpoke3: - _inc(cl); - _sub(ax, 10); - if (!flags.c()) - goto numberpoke3; - _add(ax, 10); - cs.byte(bx) = cl; - bx = offset_money2poke; - _add(al, 48); - cs.byte(bx) = al; -} - void DreamGenContext::useStereo() { STACK_CHECK; _cmp(data.byte(kLocation), 0); @@ -3059,7 +2959,7 @@ void DreamGenContext::clearChanges() { di = 0; _stosw(cx, true); es = cs; - di = 1131; + di = 1123; al = 1; _stosb(2); al = 0; @@ -3292,19 +3192,19 @@ void DreamGenContext::__start() { //0x0400: ."R OOT 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, //0x0410: . " - 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x30, 0x30, 0x00, 0x0d, 0x0a, - //0x0420: .00 00.0 0... - 0x0d, 0x0a, 0x24, 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - //0x0430: ..$. .... .... .... - 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x44, 0x3a, 0x00, 0x00, 0x00, - //0x0440: .... .... ...D :... + 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x10, 0x12, 0x12, 0x11, 0x10, + //0x0420: ... ..$. .... + 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, + //0x0430: .... .... .... .... + 0x02, 0x02, 0x02, 0x44, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + //0x0440: ...D :... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0450: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0460: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, + 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, //0x0470: .... .... .... .... - 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0480: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0490: .... .... .... .... @@ -3320,9 +3220,7 @@ void DreamGenContext::__start() { //0x04e0: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x04f0: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, - //0x0500: .... .... .... .... - 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, }; + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, }; ds.assign(src, src + sizeof(src)); dreamweb(); } -- cgit v1.2.3