aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2011-12-09 01:23:38 +0200
committerFilippos Karapetis2011-12-09 01:24:25 +0200
commitbaf2cc8b8eaa6a4d56c0764eb7a1e1a6c8b9758e (patch)
treed3b1e25148fa81bdab9f8beecfc06cea1b53f50d /engines
parenta2da8e6b397a76e2efef41b4d07b1baef78a6abc (diff)
downloadscummvm-rg350-baf2cc8b8eaa6a4d56c0764eb7a1e1a6c8b9758e.tar.gz
scummvm-rg350-baf2cc8b8eaa6a4d56c0764eb7a1e1a6c8b9758e.tar.bz2
scummvm-rg350-baf2cc8b8eaa6a4d56c0764eb7a1e1a6c8b9758e.zip
DREAMWEB: Port 'usediary' to C++ and remove diarylist from the blob
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreamgen.cpp122
-rw-r--r--engines/dreamweb/dreamgen.h24
-rw-r--r--engines/dreamweb/stubs.cpp11
-rw-r--r--engines/dreamweb/stubs.h1
-rw-r--r--engines/dreamweb/use.cpp44
5 files changed, 94 insertions, 108 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index a6841506e7..95dd6f4490 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -3380,14 +3380,14 @@ void DreamGenContext::getDestInfo() {
push(ax);
dx = data;
es = dx;
- si = 1497;
+ si = 1455;
_add(si, ax);
cl = es.byte(si);
ax = pop();
push(cx);
dx = data;
es = dx;
- si = 1513;
+ si = 1471;
_add(si, ax);
ax = pop();
}
@@ -3439,7 +3439,7 @@ clearedlocations:
bx = ax;
dx = data;
es = dx;
- _add(bx, 1497);
+ _add(bx, 1455);
es.byte(bx) = 0;
}
@@ -3475,7 +3475,7 @@ void DreamGenContext::execCommand() {
es = cs;
bx = offset_comlist;
ds = cs;
- si = 1531;
+ si = 1489;
al = ds.byte(si);
_cmp(al, 0);
if (!flags.z())
@@ -3670,7 +3670,7 @@ notyetassigned:
push(bx);
_add(bx, 2);
ds = cs;
- si = 1531;
+ si = 1489;
checkpass:
_lodsw();
ah = es.byte(bx);
@@ -3998,7 +3998,7 @@ void DreamGenContext::parser() {
al = '=';
_stosb();
ds = cs;
- si = 1531;
+ si = 1489;
notspace1:
_lodsw();
_cmp(al, 32);
@@ -5569,48 +5569,6 @@ notwrapbackb:
data.byte(kSymbolbotdir) = 0;
}
-void DreamGenContext::useDiary() {
- STACK_CHECK;
- getRidOfReels();
- dx = 1003;
- loadIntoTemp();
- dx = 1016;
- loadTempText();
- dx = 977;
- loadTempCharset();
- createPanel();
- showIcon();
- showDiary();
- underTextLine();
- showDiaryPage();
- readMouse();
- showPointer();
- workToScreen();
- delPointer();
- data.byte(kGetback) = 0;
-diaryloop:
- delPointer();
- readMouse();
- showDiaryKeys();
- showPointer();
- vSync();
- dumpPointer();
- dumpDiaryKeys();
- dumpTextLine();
- bx = offset_diarylist;
- checkCoords();
- _cmp(data.byte(kGetback), 0);
- if (flags.z())
- goto diaryloop;
- getRidOfTemp();
- getRidOfTempText();
- getRidOfTempCharset();
- restoreReels();
- data.byte(kManisoffscreen) = 0;
- redrawMainScrn();
- workToScreenM();
-}
-
void DreamGenContext::showDiaryKeys() {
STACK_CHECK;
_cmp(data.byte(kPresscount), 0);
@@ -5874,7 +5832,7 @@ void DreamGenContext::getNamePos() {
_mul(cx);
dx = data;
es = dx;
- bx = 1665;
+ bx = 1623;
_add(bx, ax);
al = data.byte(kCursorpos);
ah = 0;
@@ -5970,7 +5928,7 @@ void DreamGenContext::showNames() {
STACK_CHECK;
dx = data;
es = dx;
- si = 1665+1;
+ si = 1623+1;
di = (60)+21;
bx = (52)+10;
cl = 0;
@@ -6346,7 +6304,7 @@ void DreamGenContext::clearChanges() {
di = 0;
_stosw(cx, true);
es = cs;
- di = 1497;
+ di = 1455;
al = 1;
_stosb(2);
al = 0;
@@ -6705,31 +6663,31 @@ void DreamGenContext::__start() {
//0x0510: ."R OOT .
0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x30, 0x30,
//0x0520: " .00
- 0x30, 0x30, 0x00, 0x30, 0x30, 0x00, 0xba, 0x00, 0xca, 0x00, 0x9d, 0x00, 0xad, 0x00, 0x1c, 0xc8,
- //0x0530: 00.0 0... .... ....
- 0xf3, 0x00, 0x03, 0x01, 0x83, 0x00, 0x93, 0x00, 0x18, 0xc8, 0x0c, 0x01, 0x1c, 0x01, 0xa8, 0x00,
- //0x0540: .... .... .... ....
- 0xb8, 0x00, 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff,
- //0x0550: ..P. ..@. .... ....
- 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x53, 0x50, 0x45, 0x45, 0x43, 0x48, 0x52, 0x32, 0x34, 0x43, 0x30,
- //0x0560: .... $SPE ECHR 24C0
- 0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, 0x57, 0x00, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x20, 0x4e,
- //0x0570: 005. RAW. OBJE CT N
- 0x41, 0x4d, 0x45, 0x20, 0x4f, 0x4e, 0x45, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- //0x0580: AME ONE
+ 0x30, 0x30, 0x00, 0x30, 0x30, 0x00, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x53, 0x50, 0x45, 0x45, 0x43,
+ //0x0530: 00.0 0... ..$S PEEC
+ 0x48, 0x52, 0x32, 0x34, 0x43, 0x30, 0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, 0x57, 0x00, 0x4f, 0x42,
+ //0x0540: HR24 C000 5.RA W.OB
+ 0x4a, 0x45, 0x43, 0x54, 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x4f, 0x4e, 0x45, 0x20, 0x20, 0x20,
+ //0x0550: JECT NAM E ON E
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- //0x0590:
- 0x00, 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+ //0x0560:
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01,
+ //0x0570: .. .... ....
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x44,
+ //0x0580: .... .... .... ...D
+ 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ //0x0590: :... .... .... ....
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
//0x05a0: .... .... .... ....
- 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x44, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00,
- //0x05b0: .... .... .D:. ....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
+ //0x05b0: .... .... .... ....
+ 0x00, 0x03, 0x02, 0x04, 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00,
//0x05c0: .... .... .... ....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x05d0: .... .... .... ....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, 0x01, 0x0a,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x05e0: .... .... .... ....
- 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x05f0: .... .... .... ....
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x0600: .... .... .... ....
@@ -6741,27 +6699,23 @@ void DreamGenContext::__start() {
//0x0630: .... .... .... ....
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x0640: .... .... .... ....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
//0x0650: .... .... .... ....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
//0x0660: .... .... .... ....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01,
//0x0670: .... .... .... ....
- 0xff, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01,
//0x0680: .... .... .... ....
- 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01,
//0x0690: .... .... .... ....
- 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01,
//0x06a0: .... .... .... ....
- 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01,
//0x06b0: .... .... .... ....
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00,
//0x06c0: .... .... .... ....
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- //0x06d0: .... .... .... ....
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- //0x06e0: .... .... .... ....
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, };
+ 0x00, };
ds.assign(src, src + sizeof(src));
dreamweb();
}
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index b0620648cf..ebc1aec764 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -33,12 +33,11 @@
namespace DreamGen {
static const uint16 offset_money1poke = 0x052e;
-static const uint16 offset_commandline = 0x0578;
+static const uint16 offset_speechfile = 0x0541;
static const uint16 offset_openchangesize = 0x0446;
static const uint16 offset_operand1 = 0x0504;
static const uint16 offset_comlist = 0x045e;
-static const uint16 offset_diarylist = 0x0536;
-static const uint16 offset_speechfile = 0x056b;
+static const uint16 offset_commandline = 0x054e;
static const uint16 offset_rootdir = 0x0512;
static const uint16 offset_money2poke = 0x0533;
static const uint16 offset_keys = 0x049a;
@@ -424,15 +423,15 @@ static const uint16 kGungraphic = 1055;
static const uint16 kMonkface = 1068;
static const uint16 kTitle7graphics = 1081;
static const uint16 kCurrentfile = 1312;
-static const uint16 kRoomscango = 1497;
-static const uint16 kRoompics = 1513;
-static const uint16 kOplist = 1528;
-static const uint16 kInputline = 1531;
-static const uint16 kPresslist = 1659;
-static const uint16 kSavenames = 1665;
-static const uint16 kQuitrequested = 1784;
-static const uint16 kSubtitles = 1785;
-static const uint16 kForeignrelease = 1786;
+static const uint16 kRoomscango = 1455;
+static const uint16 kRoompics = 1471;
+static const uint16 kOplist = 1486;
+static const uint16 kInputline = 1489;
+static const uint16 kPresslist = 1617;
+static const uint16 kSavenames = 1623;
+static const uint16 kQuitrequested = 1742;
+static const uint16 kSubtitles = 1743;
+static const uint16 kForeignrelease = 1744;
static const uint16 kBlocktextdat = (0);
static const uint16 kPersonframes = (0);
static const uint16 kDebuglevel1 = (0);
@@ -659,7 +658,6 @@ public:
void selectOpenOb();
void useGun();
void autoAppear();
- void useDiary();
void newPlace();
void useHandle();
void showPuzText();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index f0c49f4803..0e6767799e 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1685,17 +1685,6 @@ void DreamGenContext::checkCoords() {
checkCoords(quitList);
break;
}
- case offset_diarylist: {
- RectWithCallback diaryList[] = {
- { kDiaryx+94,kDiaryx+110,kDiaryy+97,kDiaryy+113,&DreamGenContext::diaryKeyN },
- { kDiaryx+151,kDiaryx+167,kDiaryy+71,kDiaryy+87,&DreamGenContext::diaryKeyP },
- { kDiaryx+176,kDiaryx+192,kDiaryy+108,kDiaryy+124,&DreamGenContext::quitKey },
- { 0,320,0,200,&DreamGenContext::blank },
- { 0xFFFF,0,0,0,0 }
- };
- checkCoords(diaryList);
- break;
- }
default:
::error("Unimplemented checkcoords() call");
}
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 422038e920..68f3d6fb74 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -558,5 +558,6 @@
void talk();
void discOps();
void doSaveLoad();
+ void useDiary();
#endif
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index f06a30d81e..be4906c8b2 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -1158,5 +1158,49 @@ void DreamBase::removeFreeObject(uint8 index) {
getFreeAd(index)->mapad[0] = 0xFF;
}
+void DreamGenContext::useDiary() {
+ getRidOfReels();
+ loadIntoTemp((const char *)data.ptr(kDiarygraphic, 0));
+ loadTempText((const char *)data.ptr(kDiarytext, 0));
+ loadTempCharset((const char *)data.ptr(kCharacterset3, 0));
+ createPanel();
+ showIcon();
+ showDiary();
+ underTextLine();
+ showDiaryPage();
+ readMouse();
+ showPointer();
+ workToScreen();
+ delPointer();
+ data.byte(kGetback) = 0;
+
+ RectWithCallback diaryList[] = {
+ { kDiaryx+94,kDiaryx+110,kDiaryy+97,kDiaryy+113,&DreamGenContext::diaryKeyN },
+ { kDiaryx+151,kDiaryx+167,kDiaryy+71,kDiaryy+87,&DreamGenContext::diaryKeyP },
+ { kDiaryx+176,kDiaryx+192,kDiaryy+108,kDiaryy+124,&DreamGenContext::quitKey },
+ { 0,320,0,200,&DreamGenContext::blank },
+ { 0xFFFF,0,0,0,0 }
+ };
+
+ do {
+ delPointer();
+ readMouse();
+ showDiaryKeys();
+ showPointer();
+ vSync();
+ dumpPointer();
+ dumpDiaryKeys();
+ dumpTextLine();
+ checkCoords(diaryList);
+ } while (!data.byte(kGetback));
+
+ getRidOfTemp();
+ getRidOfTempText();
+ getRidOfTempCharset();
+ restoreReels();
+ data.byte(kManisoffscreen) = 0;
+ redrawMainScrn();
+ workToScreenM();
+}
} // End of namespace DreamGen