aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2011-12-17 00:01:45 +0200
committerFilippos Karapetis2011-12-17 00:01:45 +0200
commit654a60a90cfec631893598325dbfc5ab8adbfa35 (patch)
treed7fd9dc41603a4b92308545a3c4ddff7ad6f627f /engines
parent2887686d56544e6edfaf401c0aab5203be3c1ccc (diff)
downloadscummvm-rg350-654a60a90cfec631893598325dbfc5ab8adbfa35.tar.gz
scummvm-rg350-654a60a90cfec631893598325dbfc5ab8adbfa35.tar.bz2
scummvm-rg350-654a60a90cfec631893598325dbfc5ab8adbfa35.zip
DREAMWEB: Rewrote useCashCard() in C++ and got rid of moneyPoke() and its associated offsets in the data blob
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreamgen.cpp134
-rw-r--r--engines/dreamweb/dreamgen.h22
-rw-r--r--engines/dreamweb/stubs.h1
-rw-r--r--engines/dreamweb/use.cpp29
4 files changed, 55 insertions, 131 deletions
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();
}
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 05e7c856df..94826e8433 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -32,11 +32,9 @@
namespace DreamGen {
-static const uint16 offset_money1poke = 0x0426;
static const uint16 offset_operand1 = 0x03fc;
-static const uint16 offset_rootdir = 0x040a;
static const uint16 offset_keys = 0x0392;
-static const uint16 offset_money2poke = 0x042b;
+static const uint16 offset_rootdir = 0x040a;
static const uint16 kStartvars = 0;
static const uint16 kProgresspoints = 1;
static const uint16 kWatchon = 2;
@@ -365,14 +363,14 @@ static const uint16 kRoomssample = 443;
static const uint16 kReelroutines = 444;
static const uint16 kBasicsample = 901;
static const uint16 kCurrentfile = 1048;
-static const uint16 kRoomscango = 1131;
-static const uint16 kRoompics = 1147;
-static const uint16 kOplist = 1162;
-static const uint16 kInputline = 1165;
-static const uint16 kPresslist = 1293;
-static const uint16 kQuitrequested = 1299;
-static const uint16 kSubtitles = 1300;
-static const uint16 kForeignrelease = 1301;
+static const uint16 kRoomscango = 1123;
+static const uint16 kRoompics = 1139;
+static const uint16 kOplist = 1154;
+static const uint16 kInputline = 1157;
+static const uint16 kPresslist = 1285;
+static const uint16 kQuitrequested = 1291;
+static const uint16 kSubtitles = 1292;
+static const uint16 kForeignrelease = 1293;
static const uint16 kBlocktextdat = (0);
static const uint16 kPersonframes = (0);
static const uint16 kDebuglevel1 = (0);
@@ -480,8 +478,6 @@ public:
void getObTextStart();
void checkObjectSize();
void fillOpen();
- void useCashCard();
- void moneyPoke();
void doSomeTalk();
void resetLocation();
void adjustUp();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 741abd807f..ab09fd3ace 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -394,5 +394,6 @@
void useGun();
void identifyOb();
void showSlots();
+ void useCashCard();
#endif
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index 385bfbb101..6b59faf401 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -1613,4 +1613,33 @@ void DreamGenContext::notHeldError() {
putBackObStuff();
}
+void DreamGenContext::useCashCard() {
+ getRidOfReels();
+ loadKeypad();
+ createPanel();
+ showPanel();
+ showExit();
+ showMan();
+ uint16 y = (!data.byte(kForeignrelease)) ? 120 : 120 - 3;
+ showFrame(tempGraphics(), 114, y, 39, 0);
+ const uint8 *obText = getObTextStartCPP();
+ findNextColon(&obText);
+ findNextColon(&obText);
+ y = 98;
+ printDirect(&obText, 36, &y, 36, 36 & 1);
+ char amountStr[10];
+ sprintf(amountStr, "%04d", data.word(kCard1money) / 10);
+ data.word(kCharshift) = 91 * 2 + 75;
+ printDirect((const uint8 *)amountStr, 160, 155, 240, 240 & 1);
+ sprintf(amountStr, "%02d", (data.word(kCard1money) % 10) * 10);
+ data.word(kCharshift) = 91 * 2 + 85;
+ printDirect((const uint8 *)amountStr, 187, 155, 240, 240 & 1);
+ data.word(kCharshift) = 0;
+ workToScreenM();
+ hangOnP(400);
+ getRidOfTemp();
+ restoreReels();
+ putBackObStuff();
+}
+
} // End of namespace DreamGen