aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2011-12-15 13:24:23 -0800
committerFilippos Karapetis2011-12-15 13:24:23 -0800
commit5bf9c1e024f597e56e8289c3fb122dca0749be01 (patch)
tree13591100fcedc7265eadf33b2e37c3d3bd16fc23
parent2a96ee48d466e4404ebd8feb8a3bf608a19121ce (diff)
parentd1ed87beceb68a2b33db9989e6a480bbda6a73d1 (diff)
downloadscummvm-rg350-5bf9c1e024f597e56e8289c3fb122dca0749be01.tar.gz
scummvm-rg350-5bf9c1e024f597e56e8289c3fb122dca0749be01.tar.bz2
scummvm-rg350-5bf9c1e024f597e56e8289c3fb122dca0749be01.zip
Merge pull request #143 from fingolfin/dreamweb-cleanup
Dreamweb cleanup
-rwxr-xr-xdevtools/tasmrecover/tasm-recover16
-rw-r--r--engines/dreamweb/backdrop.cpp2
-rw-r--r--engines/dreamweb/dreambase.h109
-rw-r--r--engines/dreamweb/dreamgen.cpp238
-rw-r--r--engines/dreamweb/dreamgen.h39
-rw-r--r--engines/dreamweb/dreamweb.cpp10
-rw-r--r--engines/dreamweb/keypad.cpp72
-rw-r--r--engines/dreamweb/object.cpp73
-rw-r--r--engines/dreamweb/saveload.cpp113
-rw-r--r--engines/dreamweb/sprite.cpp10
-rw-r--r--engines/dreamweb/stubs.cpp327
-rw-r--r--engines/dreamweb/stubs.h119
-rw-r--r--engines/dreamweb/use.cpp34
13 files changed, 540 insertions, 622 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 86414ddea0..d902e38d3d 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -48,6 +48,8 @@ p = parser(skip_binary_data = [
'icongraphics1',
'savenames',
'volumetabname',
+ 'commandline',
+ 'openchangesize',
# keypad.asm
'keypadlist',
'symbollist',
@@ -155,11 +157,6 @@ p = parser(skip_binary_data = [
'increment2',
'keypadax',
'keypadcx',
- 'soundbuffer',
- 'cursloc',
- 'liftsoundcount',
- 'playblock',
- 'gotfrom',
# vgagrafx.asm
'cityname',
'extragraphics1',
@@ -438,6 +435,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'getnamepos',
'getnextword',
'getnumber',
+ 'getopenedsize',
'getpersframe',
'getreelframeax',
'getreelstart',
@@ -470,7 +468,6 @@ generator = cpp(context, "DreamGen", blacklist = [
'hangonpq',
'hangonw',
'heavy',
- 'helicopter',
'hotelbell',
'hotelcontrol',
'initialinv',
@@ -576,6 +573,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'nextdest',
'nextfolder',
'nextsymbol',
+ 'nothelderror',
'obicons',
'obname',
'obpicture',
@@ -592,6 +590,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'openhoteldoor2',
'openinv',
'openlouis',
+ 'openob',
'openpoolboss',
'openryan',
'opensarters',
@@ -626,6 +625,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'printdirect',
'printlogo',
'printmessage',
+ 'printmessage2',
'printoutermon',
'printslow',
'printsprites',
@@ -871,6 +871,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'wheelsound',
'widedoor',
'width160',
+ 'withwhat',
'workoutframes',
'worktoscreen',
'worktoscreenm',
@@ -1292,7 +1293,6 @@ generator = cpp(context, "DreamGen", blacklist = [
'nextdest' : 'nextDest',
'nextfolder' : 'nextFolder',
'nextsymbol' : 'nextSymbol',
- 'nothelderror' : 'notHeldError',
'obicons' : 'obIcons',
'obname' : 'obName',
'obpicture' : 'obPicture',
@@ -1349,7 +1349,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'printdirect' : 'printDirect',
'printlogo' : 'printLogo',
'printmessage' : 'printMessage',
- 'printmessage2' : 'printmessage2',
+ 'printmessage2' : 'printMessage2',
'printoutermon' : 'printOuterMon',
'printslow' : 'printSlow',
'printsprites' : 'printSprites',
diff --git a/engines/dreamweb/backdrop.cpp b/engines/dreamweb/backdrop.cpp
index 3e005fdec9..15a226a5ac 100644
--- a/engines/dreamweb/backdrop.cpp
+++ b/engines/dreamweb/backdrop.cpp
@@ -274,7 +274,7 @@ void DreamGenContext::showAllFree() {
}
}
-void DreamGenContext::drawFlags() {
+void DreamBase::drawFlags() {
uint8 *mapFlags = getSegment(data.word(kBuffers)).ptr(kMapflags, 0);
const uint8 *mapData = getSegment(data.word(kMapdata)).ptr(kMap + data.byte(kMapy) * kMapwidth + data.byte(kMapx), 0);
const uint8 *backdropFlags = getSegment(data.word(kBackdrop)).ptr(kFlags, 0);
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h
index 1a730ac541..727a81ce8b 100644
--- a/engines/dreamweb/dreambase.h
+++ b/engines/dreamweb/dreambase.h
@@ -47,10 +47,49 @@ class DreamBase : public SegmentManager {
protected:
DreamWeb::DreamWebEngine *engine;
+ // from object.cpp
+ uint16 _openChangeSize;
+
+ // from pathfind.cpp
+ Common::Point _lineData[200]; // Output of Bresenham
+
+ // from saveload.cpp
+ char _saveNames[17*7];
+ char _saveNamesOld[17*7];
+
public:
- DreamBase(DreamWeb::DreamWebEngine *en) : engine(en) { }
+ DreamBase(DreamWeb::DreamWebEngine *en);
public:
+ // from backdrop.cpp
+ void drawFlags();
+
+ // from keypad.cpp
+ void getUnderMenu();
+ void putUnderMenu();
+ void singleKey(uint8 key, uint16 x, uint16 y);
+ void loadKeypad();
+ void showKeypad();
+ bool isItRight(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3);
+ void addToPressList();
+ void buttonOne();
+ void buttonTwo();
+ void buttonThree();
+ void buttonFour();
+ void buttonFive();
+ void buttonSix();
+ void buttonSeven();
+ void buttonEight();
+ void buttonNine();
+ void buttonNought();
+ void buttonEnter();
+ void buttonPress(uint8 buttonId);
+ void showOuterPad();
+ void dumpKeypad();
+ void dumpSymbol();
+ void dumpSymBox();
+ void quitSymbol();
+
// from monitor.cpp
void input();
byte makeCaps(byte c);
@@ -74,9 +113,12 @@ public:
// from object.cpp
void obIcons();
+ void fillRyan();
+ void findAllRyan(uint8 *inv);
+ void obToInv(uint8 index, uint8 flag, uint16 x, uint16 y);
+ void obPicture();
// from pathfind.cpp
- Common::Point _lineData[200]; // Output of Bresenham
void checkDest(const RoomPaths *roomsPaths);
RoomPaths *getRoomsPaths();
void faceRightWay();
@@ -101,8 +143,10 @@ public:
void delCurs();
// from saveload.cpp
- char _saveNames[17*7];
- char _saveNamesOld[17*7];
+ void oldToNames();
+ void namesToOld();
+ void showMainOps();
+ void showDiscOps();
void showNames();
// from sound.cpp
@@ -120,12 +164,18 @@ public:
const Frame *findSource(uint16 &frame);
void showReelFrame(Reel *reel);
const Frame *getReelFrameAX(uint16 frame);
- void soundOnReels(uint16 reelPointer);
void rollEndCredits();
void priestText(ReelRoutine &routine);
+ void checkOne(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uint8 *type, uint8 *flagX, uint8 *flagY);
+ void soundOnReels(uint16 reelPointer);
+ void clearBeforeLoad();
+ void clearReels();
+ void getRidOfReels();
+ void liftNoise(uint8 index);
// from stubs.cpp
void crosshair();
+ void delTextLine();
void showBlink();
void dumpBlink();
void dumpPointer();
@@ -150,6 +200,7 @@ public:
DynObject *getFreeAd(uint8 index);
DynObject *getExAd(uint8 index);
DynObject *getEitherAdCPP();
+ void *getAnyAdDir(uint8 index, uint8 flag);
void showWatch();
void showTime();
void showExit();
@@ -168,12 +219,60 @@ public:
void loadIntoTemp2(const char *fileName);
void loadIntoTemp3(const char *fileName);
void loadTempCharset(const char *fileName);
+ void loadTravelText();
+ void loadTempText(const char *fileName);
void clearAndLoad(uint8 *buf, uint8 c, unsigned int size, unsigned int maxSize);
void clearAndLoad(uint16 seg, uint8 c, unsigned int size, unsigned int maxSize);
void sortOutMap();
void loadRoomData(const Room &room, bool skipDat);
void useTempCharset();
void useCharset1();
+ void printMessage(uint16 x, uint16 y, uint8 index, uint8 maxWidth, bool centered);
+ void printMessage2(uint16 x, uint16 y, uint8 index, uint8 maxWidth, bool centered, uint8 count);
+ bool isItDescribed(const ObjPos *objPos);
+ void zoomIcon();
+ void roomName();
+ void showIcon();
+ void eraseOldObs();
+ void commandOnly(uint8 command);
+ void blank();
+ void setTopLeft();
+ void setTopRight();
+ void setBotLeft();
+ void setBotRight();
+ void examIcon();
+ void animPointer();
+ void getFlagUnderP(uint8 *flag, uint8 *flagEx);
+ void workToScreenM();
+ void quitKey();
+ void restoreReels();
+ void loadFolder();
+ void folderHints();
+ void folderExit();
+ void showFolder();
+ void showLeftPage();
+ void showRightPage();
+ void underTextLine();
+ void hangOnP(uint16 count);
+ void getUnderZoom();
+ void putUnderZoom();
+ void examineInventory();
+ void openInv();
+ void getBack1();
+ void getBackFromOb();
+ void getBackFromOps();
+ void getBackToOps();
+ void DOSReturn();
+ bool isItWorn(const DynObject *object);
+ bool compare(uint8 index, uint8 flag, const char id[4]);
+ void hangOnW(uint16 frameCount);
+ void getRidOfTemp();
+ void getRidOfTempText();
+ void getRidOfTemp2();
+ void getRidOfTemp3();
+ void getRidOfTempCharset();
+ void getRidOfTempsP();
+ void getRidOfAll();
// from use.cpp
void placeFreeObject(uint8 index);
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 2ee3d512cd..92bb062aab 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -950,37 +950,6 @@ findnewpage:
delPointer();
}
-void DreamGenContext::openOb() {
- STACK_CHECK;
- al = data.byte(kOpenedob);
- ah = data.byte(kOpenedtype);
- di = offset_commandline;
- copyName();
- di = (80);
- bx = (58)+86;
- al = 62;
- dl = 240;
- printMessage();
- di = data.word(kLastxpos);
- _add(di, 5);
- bx = (58)+86;
- es = cs;
- si = offset_commandline;
- dl = 220;
- al = 0;
- ah = 0;
- printDirect();
- fillOpen();
- getOpenedSize();
- al = ah;
- ah = 0;
- cx = (44);
- _mul(cx);
- _add(ax, (80));
- bx = offset_openchangesize;
- cs.word(bx) = ax;
-}
-
void DreamGenContext::getObTextStart() {
STACK_CHECK;
es = data.word(kFreedesc);
@@ -1475,29 +1444,6 @@ isex:
ax = es.word(bx+7);
}
-void DreamGenContext::getOpenedSize() {
- STACK_CHECK;
- _cmp(data.byte(kOpenedtype), 4);
- if (flags.z())
- goto isex2;
- _cmp(data.byte(kOpenedtype), 2);
- if (flags.z())
- goto isfree2;
- al = data.byte(kOpenedob);
- getSetAd();
- ax = es.word(bx+3);
- return;
-isfree2:
- al = data.byte(kOpenedob);
- getFreeAd();
- ax = es.word(bx+7);
- return;
-isex2:
- al = data.byte(kOpenedob);
- getExAd();
- ax = es.word(bx+7);
-}
-
void DreamGenContext::getSetAd() {
STACK_CHECK;
ah = 0;
@@ -2586,14 +2532,14 @@ void DreamGenContext::getDestInfo() {
push(ax);
dx = data;
es = dx;
- si = 1174;
+ si = 1131;
_add(si, ax);
cl = es.byte(si);
ax = pop();
push(cx);
dx = data;
es = dx;
- si = 1190;
+ si = 1147;
_add(si, ax);
ax = pop();
}
@@ -2645,7 +2591,7 @@ clearedlocations:
bx = ax;
dx = data;
es = dx;
- _add(bx, 1174);
+ _add(bx, 1131);
es.byte(bx) = 0;
}
@@ -2684,7 +2630,7 @@ dirroot:
si = offset_rootdir;
_inc(si);
es = cs;
- di = 1050;
+ di = 1048;
_inc(di);
cx = 12;
_movsb(cx, true);
@@ -2786,7 +2732,7 @@ notyetassigned:
push(bx);
_add(bx, 2);
ds = cs;
- si = 1208;
+ si = 1165;
checkpass:
_lodsw();
ah = es.byte(bx);
@@ -2857,7 +2803,7 @@ void DreamGenContext::read() {
return;
okcom:
es = cs;
- di = 1050;
+ di = 1048;
ax = data.word(kTextfile1);
data.word(kMonsource) = ax;
ds = ax;
@@ -2987,7 +2933,7 @@ keyok2:
ds = cs;
si = offset_operand1+1;
es = cs;
- di = 1050+1;
+ di = 1048+1;
cx = 12;
_movsb(cx, true);
monitorLogo();
@@ -3114,7 +3060,7 @@ void DreamGenContext::parser() {
al = '=';
_stosb();
ds = cs;
- si = 1208;
+ si = 1165;
notspace1:
_lodsw();
_cmp(al, 32);
@@ -3142,25 +3088,6 @@ finishpars:
di = offset_operand1;
}
-void DreamGenContext::notHeldError() {
- STACK_CHECK;
- createPanel();
- showPanel();
- showMan();
- showExit();
- obIcons();
- di = 64;
- bx = 100;
- al = 63;
- ah = 1;
- dl = 201;
- printmessage2();
- workToScreenM();
- cx = 50;
- hangOnP();
- putBackObStuff();
-}
-
void DreamGenContext::nextColon() {
STACK_CHECK;
lookcolon:
@@ -3333,48 +3260,6 @@ stereoon:
putBackObStuff();
}
-void DreamGenContext::withWhat() {
- STACK_CHECK;
- createPanel();
- showPanel();
- showMan();
- showExit();
- al = data.byte(kCommand);
- ah = data.byte(kObjecttype);
- es = cs;
- di = offset_commandline;
- copyName();
- di = 100;
- bx = 21;
- dl = 200;
- al = 63;
- ah = 2;
- printmessage2();
- di = data.word(kLastxpos);
- _add(di, 5);
- bx = 21;
- es = cs;
- si = offset_commandline;
- dl = 220;
- al = 0;
- ah = 0;
- printDirect();
- di = data.word(kLastxpos);
- _add(di, 5);
- bx = 21;
- dl = 200;
- al = 63;
- ah = 3;
- printmessage2();
- fillRyan();
- data.byte(kCommandtype) = 255;
- readMouse();
- showPointer();
- workToScreen();
- delPointer();
- data.byte(kInvopen) = 2;
-}
-
void DreamGenContext::selectOb() {
STACK_CHECK;
findInvPos();
@@ -3795,7 +3680,7 @@ void DreamGenContext::clearChanges() {
di = 0;
_stosw(cx, true);
es = cs;
- di = 1174;
+ di = 1131;
al = 1;
_stosb(2);
al = 0;
@@ -3957,35 +3842,6 @@ gotfirst:
al = es.byte(bx+6);
}
-void DreamGenContext::printmessage2() {
- STACK_CHECK;
- push(dx);
- push(bx);
- push(di);
- push(ax);
- ah = 0;
- _add(ax, ax);
- bx = ax;
- es = data.word(kCommandtext);
- ax = es.word(bx);
- _add(ax, (66*2));
- si = ax;
- ax = pop();
-searchmess:
- push(ax);
- findNextColon();
- ax = pop();
- _dec(ah);
- if (!flags.z())
- goto searchmess;
- di = pop();
- bx = pop();
- dx = pop();
- al = 0;
- ah = 0;
- printDirect();
-}
-
void DreamGenContext::__start() {
static const uint8 src[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x13, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -4102,43 +3958,43 @@ void DreamGenContext::__start() {
//0x0370: .2.. .... .2.. .!(.
0x00, 0x32, 0x14, 0x00, 0xff, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x39,
//0x0380: .2.. .DRE AMWE B.V9
- 0x39, 0x00, 0x00, 0x01, 0x01, 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20,
- //0x0390: 9... ..PU BLIC
- 0x20, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00,
- //0x03a0: PU BLIC ...
- 0x42, 0x4c, 0x41, 0x43, 0x4b, 0x44, 0x52, 0x41, 0x47, 0x4f, 0x4e, 0x20, 0x52, 0x59, 0x41, 0x4e,
- //0x03b0: BLAC KDRA GON RYAN
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x48, 0x45, 0x4e, 0x44, 0x52, 0x49,
- //0x03c0: . ..HE NDRI
- 0x58, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x4f, 0x55, 0x49, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20,
- //0x03d0: X LO UIS
- 0x20, 0x00, 0x00, 0x00, 0x53, 0x45, 0x50, 0x54, 0x49, 0x4d, 0x55, 0x53, 0x20, 0x20, 0x20, 0x20,
- //0x03e0: ... SEPT IMUS
- 0x42, 0x45, 0x43, 0x4b, 0x45, 0x54, 0x54, 0x20, 0x20, 0x20, 0x20, 0x00, 0xff, 0xff, 0x20, 0x20,
- //0x03f0: BECK ETT . ..
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x52, 0x4f, 0x4f,
- //0x0400: . "ROO
- 0x54, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20,
- //0x0410: T ."
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x30, 0x30, 0x00,
- //0x0420: . 0000 .00.
- 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x20, 0x4e, 0x41, 0x4d, 0x45,
- //0x0430: .... $OBJ ECT NAME
- 0x20, 0x4f, 0x4e, 0x45, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- //0x0440: ONE
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x10, 0x12,
- //0x0450: ...
- 0x12, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02,
- //0x0460: .... .... .... ....
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x44, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- //0x0470: .... ..D: .... ....
+ 0x39, 0x00, 0x01, 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ //0x0390: 9... PUBL IC
+ 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x42, 0x4c,
+ //0x03a0: PUBL IC . ..BL
+ 0x41, 0x43, 0x4b, 0x44, 0x52, 0x41, 0x47, 0x4f, 0x4e, 0x20, 0x52, 0x59, 0x41, 0x4e, 0x20, 0x20,
+ //0x03b0: ACKD RAGO N RY AN
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x48, 0x45, 0x4e, 0x44, 0x52, 0x49, 0x58, 0x20,
+ //0x03c0: ... HEND RIX
+ 0x20, 0x20, 0x20, 0x20, 0x4c, 0x4f, 0x55, 0x49, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
+ //0x03d0: LOUI S .
+ 0x00, 0x00, 0x53, 0x45, 0x50, 0x54, 0x49, 0x4d, 0x55, 0x53, 0x20, 0x20, 0x20, 0x20, 0x42, 0x45,
+ //0x03e0: ..SE PTIM US BE
+ 0x43, 0x4b, 0x45, 0x54, 0x54, 0x20, 0x20, 0x20, 0x20, 0x00, 0xff, 0xff, 0x20, 0x20, 0x20, 0x20,
+ //0x03f0: CKET T ...
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x52, 0x4f, 0x4f, 0x54, 0x20,
+ //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 :...
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,
+ //0x0460: .... .... .... ....
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04,
+ //0x0470: .... .... .... ....
+ 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x0480: .... .... .... ....
- 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, 0x00, 0x00, 0x00,
//0x0490: .... .... .... ....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, 0x01, 0x0a, 0x09, 0x08, 0x06,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x04a0: .... .... .... ....
- 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, 0x00, 0x00, 0x00,
//0x04b0: .... .... .... ....
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x04c0: .... .... .... ....
@@ -4148,15 +4004,9 @@ 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, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
//0x0500: .... .... .... ....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- //0x0510: .... .... .... ....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- //0x0520: .... .... .... ....
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
- //0x0530: .... .... .... ....
- 0x00, };
+ 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 582caa712f..fbefd91099 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -32,13 +32,11 @@
namespace DreamGen {
-static const uint16 offset_money2poke = 0x042d;
-static const uint16 offset_rootdir = 0x040c;
-static const uint16 offset_openchangesize = 0x0392;
-static const uint16 offset_keys = 0x0394;
-static const uint16 offset_commandline = 0x0435;
-static const uint16 offset_money1poke = 0x0428;
-static const uint16 offset_operand1 = 0x03fe;
+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 kStartvars = 0;
static const uint16 kProgresspoints = 1;
static const uint16 kWatchon = 2;
@@ -366,15 +364,15 @@ static const uint16 kCurrentsample = 442;
static const uint16 kRoomssample = 443;
static const uint16 kReelroutines = 444;
static const uint16 kBasicsample = 901;
-static const uint16 kCurrentfile = 1050;
-static const uint16 kRoomscango = 1174;
-static const uint16 kRoompics = 1190;
-static const uint16 kOplist = 1205;
-static const uint16 kInputline = 1208;
-static const uint16 kPresslist = 1336;
-static const uint16 kQuitrequested = 1342;
-static const uint16 kSubtitles = 1343;
-static const uint16 kForeignrelease = 1344;
+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 kBlocktextdat = (0);
static const uint16 kPersonframes = (0);
static const uint16 kDebuglevel1 = (0);
@@ -478,6 +476,7 @@ public:
void fadeDownMon();
void identifyOb();
+ void getPersonText();
void clearBuffers();
void getObTextStart();
void checkObjectSize();
@@ -487,7 +486,6 @@ public:
void moneyPoke();
void doSomeTalk();
void resetLocation();
- void getOpenedSize();
void adjustUp();
void fadeScreenDownHalf();
void outOfOpen();
@@ -506,7 +504,6 @@ public:
void removeObFromInv();
void dirFile();
void pickupConts();
- void nextColon();
void findInvPos();
void getKeyAndLogo();
void selectOb();
@@ -517,10 +514,9 @@ public:
void transferMap();
void purgeAnItem();
void purgeALocation();
- void notHeldError();
void getSetAd();
void showKeys();
- void printmessage2();
+ void nextColon();
void findOpenPos();
void deleteExFrame();
void searchForSame();
@@ -533,7 +529,6 @@ public:
void getEitherAd();
void setPickup();
void dropObject();
- void openOb();
void useStereo();
void showDiaryKeys();
void useOpened();
@@ -558,12 +553,10 @@ public:
void swapWithInv();
void adjustRight();
void transferToEx();
- void getPersonText();
void parser();
void emergencyPurge();
void transferConToEx();
void adjustDown();
- void withWhat();
};
} // End of namespace DreamGen
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index b4fc1b7b77..082b7d8ce7 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -410,3 +410,13 @@ uint8 DreamWebEngine::modifyChar(uint8 c) const {
}
} // End of namespace DreamWeb
+
+
+namespace DreamGen {
+
+// FIXME/TODO: Move this to a better place.
+DreamBase::DreamBase(DreamWeb::DreamWebEngine *en) : engine(en) {
+ _openChangeSize = kInventx+(4*kItempicsize);
+}
+
+} // End of namespace DreamGen
diff --git a/engines/dreamweb/keypad.cpp b/engines/dreamweb/keypad.cpp
index 09bdcb837b..032f01873e 100644
--- a/engines/dreamweb/keypad.cpp
+++ b/engines/dreamweb/keypad.cpp
@@ -24,15 +24,15 @@
namespace DreamGen {
-void DreamGenContext::getUnderMenu() {
+void DreamBase::getUnderMenu() {
multiGet(getSegment(data.word(kBuffers)).ptr(kUndertimedtext, 0), kMenux, kMenuy, 48, 48);
}
-void DreamGenContext::putUnderMenu() {
+void DreamBase::putUnderMenu() {
multiPut(getSegment(data.word(kBuffers)).ptr(kUndertimedtext, 0), kMenux, kMenuy, 48, 48);
}
-void DreamGenContext::singleKey(uint8 key, uint16 x, uint16 y) {
+void DreamBase::singleKey(uint8 key, uint16 x, uint16 y) {
if (key == data.byte(kGraphicpress)) {
key += 11;
if (data.byte(kPresscount) < 8)
@@ -42,11 +42,11 @@ void DreamGenContext::singleKey(uint8 key, uint16 x, uint16 y) {
showFrame(tempGraphics(), x, y, key, 0);
}
-void DreamGenContext::loadKeypad() {
+void DreamBase::loadKeypad() {
loadIntoTemp("DREAMWEB.G02");
}
-void DreamGenContext::showKeypad() {
+void DreamBase::showKeypad() {
singleKey(22, kKeypadx+9, kKeypady+5);
singleKey(23, kKeypadx+31, kKeypady+5);
singleKey(24, kKeypadx+53, kKeypady+5);
@@ -75,13 +75,13 @@ void DreamGenContext::showKeypad() {
}
}
-bool DreamGenContext::isItRight(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3) {
+bool DreamBase::isItRight(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3) {
return digit0 == data.byte(kPresslist+0) && digit1 == data.byte(kPresslist+1)
&& digit2 == data.byte(kPresslist+2) && digit3 == data.byte(kPresslist+3);
}
-void DreamGenContext::addToPressList() {
+void DreamBase::addToPressList() {
if (data.word(kPresspointer) == 5)
return;
uint8 pressed = data.byte(kPressed);
@@ -94,18 +94,18 @@ void DreamGenContext::addToPressList() {
void DreamGenContext::enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3) {
RectWithCallback keypadList[] = {
- { kKeypadx+9,kKeypadx+30,kKeypady+9,kKeypady+22,&DreamGenContext::buttonOne },
- { kKeypadx+31,kKeypadx+52,kKeypady+9,kKeypady+22,&DreamGenContext::buttonTwo },
- { kKeypadx+53,kKeypadx+74,kKeypady+9,kKeypady+22,&DreamGenContext::buttonThree },
- { kKeypadx+9,kKeypadx+30,kKeypady+23,kKeypady+40,&DreamGenContext::buttonFour },
- { kKeypadx+31,kKeypadx+52,kKeypady+23,kKeypady+40,&DreamGenContext::buttonFive },
- { kKeypadx+53,kKeypadx+74,kKeypady+23,kKeypady+40,&DreamGenContext::buttonSix },
- { kKeypadx+9,kKeypadx+30,kKeypady+41,kKeypady+58,&DreamGenContext::buttonSeven },
- { kKeypadx+31,kKeypadx+52,kKeypady+41,kKeypady+58,&DreamGenContext::buttonEight },
- { kKeypadx+53,kKeypadx+74,kKeypady+41,kKeypady+58,&DreamGenContext::buttonNine },
- { kKeypadx+9,kKeypadx+30,kKeypady+59,kKeypady+73,&DreamGenContext::buttonNought },
- { kKeypadx+31,kKeypadx+74,kKeypady+59,kKeypady+73,&DreamGenContext::buttonEnter },
- { kKeypadx+72,kKeypadx+86,kKeypady+80,kKeypady+94,&DreamGenContext::quitKey },
+ { kKeypadx+9,kKeypadx+30,kKeypady+9,kKeypady+22,&DreamBase::buttonOne },
+ { kKeypadx+31,kKeypadx+52,kKeypady+9,kKeypady+22,&DreamBase::buttonTwo },
+ { kKeypadx+53,kKeypadx+74,kKeypady+9,kKeypady+22,&DreamBase::buttonThree },
+ { kKeypadx+9,kKeypadx+30,kKeypady+23,kKeypady+40,&DreamBase::buttonFour },
+ { kKeypadx+31,kKeypadx+52,kKeypady+23,kKeypady+40,&DreamBase::buttonFive },
+ { kKeypadx+53,kKeypadx+74,kKeypady+23,kKeypady+40,&DreamBase::buttonSix },
+ { kKeypadx+9,kKeypadx+30,kKeypady+41,kKeypady+58,&DreamBase::buttonSeven },
+ { kKeypadx+31,kKeypadx+52,kKeypady+41,kKeypady+58,&DreamBase::buttonEight },
+ { kKeypadx+53,kKeypadx+74,kKeypady+41,kKeypady+58,&DreamBase::buttonNine },
+ { kKeypadx+9,kKeypadx+30,kKeypady+59,kKeypady+73,&DreamBase::buttonNought },
+ { kKeypadx+31,kKeypadx+74,kKeypady+59,kKeypady+73,&DreamBase::buttonEnter },
+ { kKeypadx+72,kKeypadx+86,kKeypady+80,kKeypady+94,&DreamBase::quitKey },
{ 0,320,0,200,&DreamGenContext::blank },
{ 0xFFFF,0,0,0,0 }
};
@@ -164,51 +164,51 @@ void DreamGenContext::enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8
workToScreenM();
}
-void DreamGenContext::buttonOne() {
+void DreamBase::buttonOne() {
buttonPress(1);
}
-void DreamGenContext::buttonTwo() {
+void DreamBase::buttonTwo() {
buttonPress(2);
}
-void DreamGenContext::buttonThree() {
+void DreamBase::buttonThree() {
buttonPress(3);
}
-void DreamGenContext::buttonFour() {
+void DreamBase::buttonFour() {
buttonPress(4);
}
-void DreamGenContext::buttonFive() {
+void DreamBase::buttonFive() {
buttonPress(5);
}
-void DreamGenContext::buttonSix() {
+void DreamBase::buttonSix() {
buttonPress(6);
}
-void DreamGenContext::buttonSeven() {
+void DreamBase::buttonSeven() {
buttonPress(7);
}
-void DreamGenContext::buttonEight() {
+void DreamBase::buttonEight() {
buttonPress(8);
}
-void DreamGenContext::buttonNine() {
+void DreamBase::buttonNine() {
buttonPress(9);
}
-void DreamGenContext::buttonNought() {
+void DreamBase::buttonNought() {
buttonPress(10);
}
-void DreamGenContext::buttonEnter() {
+void DreamBase::buttonEnter() {
buttonPress(11);
}
-void DreamGenContext::buttonPress(uint8 buttonId) {
+void DreamBase::buttonPress(uint8 buttonId) {
uint8 commandType = 100 + buttonId;
if (data.byte(kCommandtype) != commandType) {
data.byte(kCommandtype) = commandType;
@@ -223,28 +223,28 @@ void DreamGenContext::buttonPress(uint8 buttonId) {
}
}
-void DreamGenContext::showOuterPad() {
+void DreamBase::showOuterPad() {
showFrame(tempGraphics(), kKeypadx-3, kKeypady-4, 1, 0);
showFrame(tempGraphics(), kKeypadx+74, kKeypady+76, 37, 0);
}
-void DreamGenContext::dumpKeypad() {
+void DreamBase::dumpKeypad() {
multiDump(kKeypadx - 3, kKeypady - 4, 120, 90);
}
-void DreamGenContext::dumpSymbol() {
+void DreamBase::dumpSymbol() {
data.byte(kNewtextline) = 0;
multiDump(kSymbolx, kSymboly + 20, 104, 60);
}
-void DreamGenContext::dumpSymBox() {
+void DreamBase::dumpSymBox() {
if (data.word(kDumpx) != 0xFFFF) {
multiDump(data.word(kDumpx), data.word(kDumpy), 30, 77);
data.word(kDumpx) = 0xFFFF;
}
}
-void DreamGenContext::quitSymbol() {
+void DreamBase::quitSymbol() {
if (data.byte(kSymboltopx) != 24 || data.byte(kSymbolbotx) != 24) {
blank();
return;
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp
index 53d834e74c..5f326a5a03 100644
--- a/engines/dreamweb/object.cpp
+++ b/engines/dreamweb/object.cpp
@@ -24,7 +24,27 @@
namespace DreamGen {
-void DreamGenContext::fillRyan() {
+void DreamBase::showRyanPage() {
+ showFrame(engine->icons1(), kInventx + 167, kInventy - 12, 12, 0);
+ showFrame(engine->icons1(), kInventx + 167 + 18 * data.byte(kRyanpage), kInventy - 12, 13 + data.byte(kRyanpage), 0);
+}
+
+void DreamBase::findAllRyan(uint8 *inv) {
+ memset(inv, 0xff, 60);
+ for (size_t i = 0; i < kNumexobjects; ++i) {
+ DynObject *extra = getExAd(i);
+ if (extra->mapad[0] != 4)
+ continue;
+ if (extra->mapad[1] != 0xff)
+ continue;
+ uint8 slot = extra->mapad[2];
+ assert(slot < 30);
+ inv[2 * slot + 0] = i;
+ inv[2 * slot + 1] = 4;
+ }
+}
+
+void DreamBase::fillRyan() {
uint8 *inv = getSegment(data.word(kBuffers)).ptr(kRyaninvlist, 60);
findAllRyan(inv);
inv += data.byte(kRyanpage) * 2 * 10;
@@ -42,7 +62,7 @@ void DreamGenContext::isItWorn() {
flags._z = isItWorn((const DynObject *)es.ptr(bx, sizeof(DynObject)));
}
-bool DreamGenContext::isItWorn(const DynObject *object) {
+bool DreamBase::isItWorn(const DynObject *object) {
return (object->id[0] == 'W'-'A') && (object->id[1] == 'E'-'A');
}
@@ -72,7 +92,7 @@ void DreamGenContext::obToInv() {
obToInv(al, ah, di, bx);
}
-void DreamGenContext::obToInv(uint8 index, uint8 flag, uint16 x, uint16 y) {
+void DreamBase::obToInv(uint8 index, uint8 flag, uint16 x, uint16 y) {
showFrame(engine->icons1(), x - 2, y - 1, 10, 0);
if (index == 0xff)
return;
@@ -87,7 +107,7 @@ void DreamGenContext::obToInv(uint8 index, uint8 flag, uint16 x, uint16 y) {
showFrame(engine->icons1(), x - 3, y - 2, 7, 0);
}
-void DreamGenContext::obPicture() {
+void DreamBase::obPicture() {
if (data.byte(kObjecttype) == 1)
return;
Frame *frames;
@@ -154,22 +174,22 @@ void DreamGenContext::examineOb(bool examineAgain) {
{ 260,300,0,44,&DreamGenContext::useObject },
{ 210,254,0,44,&DreamGenContext::selectOpenOb },
{ 144,176,64,96,&DreamGenContext::setPickup },
- { 0,50,50,200,&DreamGenContext::examineInventory },
- { 0,320,0,200,&DreamGenContext::blank },
+ { 0,50,50,200,&DreamBase::examineInventory },
+ { 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 }
};
checkCoords(examList);
break;
}
case 1: {
- // NB: This table contains the non-constant openChangeSize!
+ // Note: This table contains the non-constant _openChangeSize!
RectWithCallback invList1[] = {
{ 273,320,157,198,&DreamGenContext::getBackFromOb },
{ 255,294,0,24,&DreamGenContext::dropObject },
{ kInventx+167,kInventx+167+(18*3),kInventy-18,kInventy-2,&DreamGenContext::incRyanPage },
- { kInventx, data.word(offset_openchangesize),kInventy+100,kInventy+100+kItempicsize,&DreamGenContext::useOpened },
- { kInventx,kInventx+(5*kItempicsize), kInventy,kInventy+(2*kItempicsize),&DreamGenContext::inToInv },
- { 0,320,0,200,&DreamGenContext::blank },
+ { kInventx,_openChangeSize,kInventy+100,kInventy+100+kItempicsize,&DreamGenContext::useOpened },
+ { kInventx,kInventx+(5*kItempicsize),kInventy,kInventy+(2*kItempicsize),&DreamGenContext::inToInv },
+ { 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 }
};
checkCoords(invList1);
@@ -180,7 +200,7 @@ void DreamGenContext::examineOb(bool examineAgain) {
{ 273,320,157,198,&DreamGenContext::getBackFromOb },
{ kInventx+167,kInventx+167+(18*3),kInventy-18,kInventy-2,&DreamGenContext::incRyanPage },
{ kInventx,kInventx+(5*kItempicsize), kInventy,kInventy+(2*kItempicsize),&DreamGenContext::selectOb },
- { 0,320,0,200,&DreamGenContext::blank },
+ { 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 }
};
checkCoords(withList1);
@@ -256,11 +276,40 @@ void DreamGenContext::transferText() {
data.word(kExtextpos) += len + 1;
}
-void DreamGenContext::getBackFromOb() {
+void DreamBase::getBackFromOb() {
if (data.byte(kPickup) != 1)
getBack1();
else
blank();
}
+void DreamGenContext::getOpenedSize() {
+ ax = getOpenedSizeCPP();
+}
+
+byte DreamGenContext::getOpenedSizeCPP() {
+ byte obj = data.byte(kOpenedob);
+ switch (data.byte(kOpenedtype)) {
+ case 4:
+ return getExAd(obj)->b7;
+ case 2:
+ return getFreeAd(obj)->b7;
+ default:
+ return getSetAd(obj)->b3;
+ }
+}
+
+void DreamGenContext::openOb() {
+ uint8 commandLine[64] = "OBJECT NAME ONE ";
+
+ copyName(data.byte(kOpenedtype), data.byte(kOpenedob), commandLine);
+
+ printMessage(kInventx, kInventy+86, 62, 240, false);
+
+ al = printDirect(commandLine, data.word(kLastxpos) + 5, kInventy+86, 220, false);
+
+ fillOpen();
+ _openChangeSize = getOpenedSizeCPP() * kItempicsize + kInventx;
+}
+
} // End of namespace DreamGen
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp
index f0fd477ec1..2945874e1a 100644
--- a/engines/dreamweb/saveload.cpp
+++ b/engines/dreamweb/saveload.cpp
@@ -71,7 +71,7 @@ void DreamGenContext::doLoad(int savegameId) {
{ kOpsx+176,kOpsx+192,kOpsy+60,kOpsy+76,&DreamGenContext::getBackToOps },
{ kOpsx+128,kOpsx+190,kOpsy+12,kOpsy+100,&DreamGenContext::actualLoad },
{ kOpsx+2,kOpsx+92,kOpsy+4,kOpsy+81,&DreamGenContext::selectSlot },
- { 0,320,0,200,&DreamGenContext::blank },
+ { 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 }
};
checkCoords(loadlist);
@@ -167,7 +167,7 @@ void DreamGenContext::saveGame() {
{ kOpsx+176,kOpsx+192,kOpsy+60,kOpsy+76,&DreamGenContext::getBackToOps },
{ kOpsx+128,kOpsx+190,kOpsy+12,kOpsy+100,&DreamGenContext::actualSave },
{ kOpsx+2,kOpsx+92,kOpsy+4,kOpsy+81,&DreamGenContext::selectSlot },
- { 0,320,0,200,&DreamGenContext::blank },
+ { 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 }
};
checkCoords(savelist);
@@ -216,11 +216,11 @@ void DreamGenContext::saveGame() {
}
}
-void DreamGenContext::namesToOld() {
+void DreamBase::namesToOld() {
memcpy(_saveNamesOld, _saveNames, 17*7);
}
-void DreamGenContext::oldToNames() {
+void DreamBase::oldToNames() {
memcpy(_saveNames, _saveNamesOld, 17*7);
}
@@ -237,13 +237,77 @@ void DreamGenContext::saveLoad() {
doSaveLoad();
}
-void DreamGenContext::showMainOps() {
+void DreamGenContext::doSaveLoad() {
+ data.byte(kPointerframe) = 0;
+ data.word(kTextaddressx) = 70;
+ data.word(kTextaddressy) = 182-8;
+ data.byte(kTextlen) = 181;
+ data.byte(kManisoffscreen) = 1;
+ clearWork();
+ createPanel2();
+ underTextLine();
+ getRidOfAll();
+ loadSaveBox();
+ showOpBox();
+ showMainOps();
+ workToScreenCPP();
+
+ RectWithCallback opsList[] = {
+ { kOpsx+59,kOpsx+114,kOpsy+30,kOpsy+76,&DreamGenContext::getBackFromOps },
+ { kOpsx+10,kOpsx+77,kOpsy+10,kOpsy+59,&DreamBase::DOSReturn },
+ { kOpsx+128,kOpsx+190,kOpsy+16,kOpsy+100,&DreamGenContext::discOps },
+ { 0,320,0,200,&DreamBase::blank },
+ { 0xFFFF,0,0,0,0 }
+ };
+
+ bool firstOps = true;
+
+ do { // restart ops
+ if (firstOps) {
+ firstOps = false;
+ } else {
+ showOpBox();
+ showMainOps();
+ workToScreenM();
+ }
+ data.byte(kGetback) = 0;
+
+ do { // wait ops
+ if (data.byte(kQuitrequested)) {
+ data.byte(kManisoffscreen) = 0;
+ return;
+ }
+
+ readMouse();
+ showPointer();
+ vSync();
+ dumpPointer();
+ dumpTextLine();
+ delPointer();
+ checkCoords(opsList);
+ } while (!data.byte(kGetback));
+ } while (data.byte(kGetback) == 2);
+
+ data.word(kTextaddressx) = 13;
+ data.word(kTextaddressy) = 182;
+ data.byte(kTextlen) = 240;
+ if (data.byte(kGetback) != 4) {
+ getRidOfTemp();
+ restoreAll();
+ redrawMainScrn();
+ workToScreenM();
+ data.byte(kCommandtype) = 200;
+ }
+ data.byte(kManisoffscreen) = 0;
+}
+
+void DreamBase::showMainOps() {
showFrame(tempGraphics(), kOpsx+10, kOpsy+10, 8, 0);
showFrame(tempGraphics(), kOpsx+59, kOpsy+30, 7, 0);
showFrame(tempGraphics(), kOpsx+128+4, kOpsy+12, 1, 0);
}
-void DreamGenContext::showDiscOps() {
+void DreamBase::showDiscOps() {
showFrame(tempGraphics(), kOpsx+128+4, kOpsy+12, 1, 0);
showFrame(tempGraphics(), kOpsx+10, kOpsy+10, 9, 0);
showFrame(tempGraphics(), kOpsx+59, kOpsy+30, 10, 0);
@@ -522,5 +586,42 @@ void DreamGenContext::checkInput() {
workToScreenM();
}
+void DreamGenContext::selectSlot() {
+ if (data.byte(kCommandtype) != 244) {
+ data.byte(kCommandtype) = 244;
+ commandOnly(45);
+ }
+
+ if (data.word(kMousebutton) != 1 || data.word(kMousebutton) == data.word(kOldbutton))
+ return; // noselslot
+ if (data.byte(kLoadingorsave) == 3)
+ data.byte(kLoadingorsave)--;
+
+ oldToNames();
+ int y = data.word(kMousey) - (kOpsy + 4);
+ if (y < 11)
+ data.byte(kCurrentslot) = 0;
+ else
+ data.byte(kCurrentslot) = y / 11;
+
+ delPointer();
+ showOpBox();
+ showSlots();
+ showNames();
+ if (data.byte(kLoadingorsave) == 1)
+ showLoadOps();
+ else
+ showSaveOps();
+ readMouse();
+ showPointer();
+ workToScreen();
+ delPointer();
+}
+
+void DreamGenContext::selectSlot2() {
+ if (data.word(kMousebutton))
+ data.byte(kLoadingorsave) = 2;
+ selectSlot();
+}
} // End of namespace DreamGen
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index aca935cde9..c69ac2a3f5 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -581,7 +581,7 @@ void DreamGenContext::checkOne() {
al = type;
}
-void DreamGenContext::checkOne(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uint8 *type, uint8 *flagX, uint8 *flagY) {
+void DreamBase::checkOne(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uint8 *type, uint8 *flagX, uint8 *flagY) {
*flagX = x / 16;
*flagY = y / 16;
const uint8 *tileData = getSegment(data.word(kBuffers)).ptr(kMapflags + (*flagY * 11 + *flagX) * 3, 3);
@@ -1191,7 +1191,7 @@ void DreamBase::soundOnReels(uint16 reelPointer) {
data.word(kLastsoundreel) = (uint16)-1;
}
-void DreamGenContext::clearBeforeLoad() {
+void DreamBase::clearBeforeLoad() {
if (data.byte(kRoomloaded) != 1)
return /* (noclear) */;
@@ -1213,13 +1213,13 @@ void DreamGenContext::clearBeforeLoad() {
data.byte(kRoomloaded) = 0;
}
-void DreamGenContext::clearReels() {
+void DreamBase::clearReels() {
deallocateMem(data.word(kReel1));
deallocateMem(data.word(kReel2));
deallocateMem(data.word(kReel3));
}
-void DreamGenContext::getRidOfReels() {
+void DreamBase::getRidOfReels() {
if (data.byte(kRoomloaded) == 0)
return /* (dontgetrid) */;
@@ -1228,7 +1228,7 @@ void DreamGenContext::getRidOfReels() {
deallocateMem(data.word(kReel3));
}
-void DreamGenContext::liftNoise(uint8 index) {
+void DreamBase::liftNoise(uint8 index) {
if (data.byte(kReallocation) == 5 || data.byte(kReallocation) == 21)
playChannel1(13); // hiss noise
else
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 0c57d0d767..c353948abb 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -882,13 +882,13 @@ void DreamGenContext::triggerMessage(uint16 index) {
void DreamGenContext::processTrigger() {
if (data.byte(kLasttrigger) == '1') {
- DreamBase::setLocation(8);
+ setLocation(8);
triggerMessage(45);
} else if (data.byte(kLasttrigger) == '2') {
- DreamBase::setLocation(9);
+ setLocation(9);
triggerMessage(55);
} else if (data.byte(kLasttrigger) == '3') {
- DreamBase::setLocation(2);
+ setLocation(2);
triggerMessage(59);
}
}
@@ -1000,7 +1000,7 @@ void DreamBase::deallocateMem(uint16 segment) {
}
}
-void DreamGenContext::DOSReturn() {
+void DreamBase::DOSReturn() {
if (data.byte(kCommandtype) != 250) {
data.byte(kCommandtype) = 250;
commandOnly(46);
@@ -1015,7 +1015,7 @@ void DreamGenContext::DOSReturn() {
void DreamGenContext::set16ColPalette() {
}
-void DreamGenContext::eraseOldObs() {
+void DreamBase::eraseOldObs() {
if (data.byte(kNewobs) == 0)
return;
@@ -1191,7 +1191,7 @@ void DreamBase::crosshair() {
showFrame(engine->icons1(), kZoomx + 24, kZoomy + 19, frame, 0);
}
-void DreamGenContext::delTextLine() {
+void DreamBase::delTextLine() {
uint16 x = data.word(kTextaddressx);
uint16 y = data.word(kTextaddressy);
if (data.byte(kForeignrelease) != 0)
@@ -1200,10 +1200,10 @@ void DreamGenContext::delTextLine() {
}
void DreamGenContext::commandOnly() {
- commandOnly(al);
+ commandOnly(al);
}
-void DreamGenContext::commandOnly(uint8 command) {
+void DreamBase::commandOnly(uint8 command) {
delTextLine();
uint16 index = command * 2;
uint16 offset = kTextstart + getSegment(data.word(kCommandtext)).word(index);
@@ -1409,7 +1409,7 @@ void *DreamBase::getAnyAd(uint8 *value1, uint8 *value2) {
}
}
-void *DreamGenContext::getAnyAdDir(uint8 index, uint8 flag) {
+void *DreamBase::getAnyAdDir(uint8 index, uint8 flag) {
if (flag == 4)
return getExAd(index);
else if (flag == 2)
@@ -1488,18 +1488,11 @@ bool DreamGenContext::finishedWalkingCPP() {
return (data.byte(kLinepointer) == 254) && (data.byte(kFacing) == data.byte(kTurntoface));
}
-void DreamGenContext::getFlagUnderP() {
- uint8 flag, flagEx;
- getFlagUnderP(&flag, &flagEx);
- cl = flag;
- ch = flagEx;
-}
-
-void DreamGenContext::getFlagUnderP(uint8 *flag, uint8 *flagEx) {
+void DreamBase::getFlagUnderP(uint8 *flag, uint8 *flagEx) {
uint8 type, flagX, flagY;
checkOne(data.word(kMousex) - data.word(kMapadx), data.word(kMousey) - data.word(kMapady), flag, flagEx, &type, &flagX, &flagY);
- cl = data.byte(kLastflag) = *flag;
- ch = data.byte(kLastflagex) = *flagEx;
+ data.byte(kLastflag) = *flag;
+ data.byte(kLastflagex) = *flagEx;
}
void DreamGenContext::walkAndExamine() {
@@ -1574,7 +1567,8 @@ void DreamGenContext::obName(uint8 command, uint8 commandType) {
}
}
- getFlagUnderP();
+ uint8 flag, flagEx;
+ getFlagUnderP(&flag, &flagEx);
if (data.byte(kLastflag) < 2) {
blockNameText();
return;
@@ -1691,7 +1685,7 @@ void DreamBase::showPointer() {
}
}
-void DreamGenContext::animPointer() {
+void DreamBase::animPointer() {
if (data.byte(kPointermode) == 2) {
data.byte(kPointerframe) = 0;
@@ -1745,17 +1739,22 @@ void DreamGenContext::animPointer() {
data.byte(kPointerframe) = 8;
}
-void DreamGenContext::printMessage() {
- printMessage(di, bx, al, dl, (bool)(dl & 1));
+void DreamBase::printMessage(uint16 x, uint16 y, uint8 index, uint8 maxWidth, bool centered) {
+ uint16 offset = kTextstart + getSegment(data.word(kCommandtext)).word(index * 2);
+ const uint8 *string = getSegment(data.word(kCommandtext)).ptr(offset, 0);
+ printDirect(string, x, y, maxWidth, centered);
}
-void DreamGenContext::printMessage(uint16 x, uint16 y, uint8 index, uint8 maxWidth, bool centered) {
+void DreamBase::printMessage2(uint16 x, uint16 y, uint8 index, uint8 maxWidth, bool centered, uint8 count) {
uint16 offset = kTextstart + getSegment(data.word(kCommandtext)).word(index * 2);
const uint8 *string = getSegment(data.word(kCommandtext)).ptr(offset, 0);
- printDirect(&string, x, &y, maxWidth, centered);
+ while (count--) {
+ findNextColon(&string);
+ }
+ printDirect(string, x, y, maxWidth, centered);
}
-bool objectMatches(void *object, const char *id) {
+static bool objectMatches(void *object, const char *id) {
const char *objId = (const char *)(((const uint8 *)object) + 12); // whether it is a DynObject or a SetObject
for (size_t i = 0; i < 4; ++i) {
if (id[i] != objId[i] + 'A')
@@ -1769,7 +1768,7 @@ void DreamGenContext::compare() {
flags._z = compare(al, ah, id);
}
-bool DreamGenContext::compare(uint8 index, uint8 flag, const char id[4]) {
+bool DreamBase::compare(uint8 index, uint8 flag, const char id[4]) {
return objectMatches(getAnyAdDir(index, flag), id);
}
@@ -1813,7 +1812,7 @@ uint16 DreamGenContext::findExObject(const char *id) {
return kNumexobjects;
}
-bool DreamGenContext::isItDescribed(const ObjPos *pos) {
+bool DreamBase::isItDescribed(const ObjPos *pos) {
uint16 offset = getSegment(data.word(kSetdesc)).word(kSettextdat + pos->index * 2);
uint8 result = getSegment(data.word(kSetdesc)).byte(kSettext + offset);
return result != 0;
@@ -1827,7 +1826,7 @@ bool DreamGenContext::isCD() {
return (data.byte(kSpeechloaded) == 1);
}
-void DreamGenContext::showIcon() {
+void DreamBase::showIcon() {
if (data.byte(kReallocation) < 50) {
showPanel();
showMan();
@@ -1866,30 +1865,6 @@ bool DreamGenContext::checkIfSet(uint8 x, uint8 y) {
return false;
}
-void DreamBase::showRyanPage() {
- showFrame(engine->icons1(), kInventx + 167, kInventy - 12, 12, 0);
- showFrame(engine->icons1(), kInventx + 167 + 18 * data.byte(kRyanpage), kInventy - 12, 13 + data.byte(kRyanpage), 0);
-}
-
-void DreamGenContext::findAllRyan() {
- findAllRyan(es.ptr(di, 60));
-}
-
-void DreamGenContext::findAllRyan(uint8 *inv) {
- memset(inv, 0xff, 60);
- for (size_t i = 0; i < kNumexobjects; ++i) {
- DynObject *extra = getExAd(i);
- if (extra->mapad[0] != 4)
- continue;
- if (extra->mapad[1] != 0xff)
- continue;
- uint8 slot = extra->mapad[2];
- assert(slot < 30);
- inv[2 * slot + 0] = i;
- inv[2 * slot + 1] = 4;
- }
-}
-
void DreamGenContext::hangOn() {
hangOn(cx);
}
@@ -1903,11 +1878,7 @@ void DreamBase::hangOn(uint16 frameCount) {
}
}
-void DreamGenContext::hangOnW() {
- hangOnW(cx);
-}
-
-void DreamGenContext::hangOnW(uint16 frameCount) {
+void DreamBase::hangOnW(uint16 frameCount) {
while (frameCount) {
delPointer();
readMouse();
@@ -1925,7 +1896,7 @@ void DreamGenContext::hangOnP() {
hangOnP(cx);
}
-void DreamGenContext::hangOnP(uint16 count) {
+void DreamBase::hangOnP(uint16 count) {
data.word(kMaintimer) = 0;
uint8 pointerFrame = data.byte(kPointerframe);
uint8 pickup = data.byte(kPickup);
@@ -2009,12 +1980,12 @@ void DreamGenContext::enterSymbol() {
dumpTextLine();
dumpSymbol();
RectWithCallback symbolList[] = {
- { kSymbolx+40,kSymbolx+64,kSymboly+2,kSymboly+16,&DreamGenContext::quitSymbol },
- { kSymbolx,kSymbolx+52,kSymboly+20,kSymboly+50,&DreamGenContext::setTopLeft },
- { kSymbolx+52,kSymbolx+104,kSymboly+20,kSymboly+50,&DreamGenContext::setTopRight },
- { kSymbolx,kSymbolx+52,kSymboly+50,kSymboly+80,&DreamGenContext::setBotLeft },
- { kSymbolx+52,kSymbolx+104,kSymboly+50,kSymboly+80,&DreamGenContext::setBotRight },
- { 0,320,0,200,&DreamGenContext::blank },
+ { kSymbolx+40,kSymbolx+64,kSymboly+2,kSymboly+16,&DreamBase::quitSymbol },
+ { kSymbolx,kSymbolx+52,kSymboly+20,kSymboly+50,&DreamBase::setTopLeft },
+ { kSymbolx+52,kSymbolx+104,kSymboly+20,kSymboly+50,&DreamBase::setTopRight },
+ { kSymbolx,kSymbolx+52,kSymboly+50,kSymboly+80,&DreamBase::setBotLeft },
+ { kSymbolx+52,kSymbolx+104,kSymboly+50,kSymboly+80,&DreamBase::setBotRight },
+ { 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 }
};
checkCoords(symbolList);
@@ -2175,7 +2146,7 @@ void DreamGenContext::watchCount() {
}
}
-void DreamGenContext::roomName() {
+void DreamBase::roomName() {
printMessage(88, 18, 53, 240, false);
uint16 textIndex = data.byte(kRoomnum);
if (textIndex >= 32)
@@ -2189,7 +2160,7 @@ void DreamGenContext::roomName() {
useCharset1();
}
-void DreamGenContext::zoomIcon() {
+void DreamBase::zoomIcon() {
if (data.byte(kZoomon) == 0)
return;
showFrame(engine->icons1(), kZoomx, kZoomy-1, 8, 0);
@@ -2312,31 +2283,31 @@ void DreamBase::useTempCharset() {
engine->setCurrentCharset(engine->tempCharset());
}
-void DreamGenContext::getRidOfTemp() {
+void DreamBase::getRidOfTemp() {
deallocateMem(data.word(kTempgraphics));
}
-void DreamGenContext::getRidOfTempText() {
+void DreamBase::getRidOfTempText() {
deallocateMem(data.word(kTextfile1));
}
-void DreamGenContext::getRidOfTemp2() {
+void DreamBase::getRidOfTemp2() {
deallocateMem(data.word(kTempgraphics2));
}
-void DreamGenContext::getRidOfTemp3() {
+void DreamBase::getRidOfTemp3() {
deallocateMem(data.word(kTempgraphics3));
}
-void DreamGenContext::getRidOfTempCharset() {
+void DreamBase::getRidOfTempCharset() {
engine->freeTempCharset();
}
-void DreamGenContext::getRidOfTempsP() {
+void DreamBase::getRidOfTempsP() {
deallocateMem(data.word(kTempsprites));
}
-void DreamGenContext::getRidOfAll() {
+void DreamBase::getRidOfAll() {
deallocateMem(data.word(kBackdrop));
deallocateMem(data.word(kSetframes));
deallocateMem(data.word(kReel1));
@@ -2398,7 +2369,7 @@ void DreamGenContext::restoreAll() {
setAllChanges();
}
-void DreamGenContext::restoreReels() {
+void DreamBase::restoreReels() {
if (data.byte(kRoomloaded) == 0)
return;
@@ -2425,7 +2396,7 @@ void DreamGenContext::restoreReels() {
engine->closeFile();
}
-void DreamGenContext::loadFolder() {
+void DreamBase::loadFolder() {
loadIntoTemp("DREAMWEB.G09"); // folder graphics 1
loadIntoTemp2("DREAMWEB.G10"); // folder graphics 2
loadIntoTemp3("DREAMWEB.G11"); // folder graphics 3
@@ -2433,7 +2404,7 @@ void DreamGenContext::loadFolder() {
loadTempText("DREAMWEB.T50"); // folder text
}
-void DreamGenContext::showFolder() {
+void DreamBase::showFolder() {
data.byte(kCommandtype) = 255;
if (data.byte(kFolderpage)) {
useTempCharset();
@@ -2458,7 +2429,7 @@ void DreamGenContext::showFolder() {
}
}
-void DreamGenContext::showLeftPage() {
+void DreamBase::showLeftPage() {
showFrame(tempGraphics2(), 0, 12, 3, 0);
uint16 y = 12+5;
for (size_t i = 0; i < 9; ++i) {
@@ -2491,7 +2462,7 @@ void DreamGenContext::showLeftPage() {
}
}
-void DreamGenContext::showRightPage() {
+void DreamBase::showRightPage() {
showFrame(tempGraphics2(), 143, 12, 0, 0);
uint16 y = 12+37;
for (size_t i = 0; i < 7; ++i) {
@@ -2539,7 +2510,7 @@ void DreamBase::panelIcons1() {
showWatch();
}
-void DreamGenContext::examIcon() {
+void DreamBase::examIcon() {
showFrame(engine->icons2(), 254, 5, 3, 0);
}
@@ -2547,10 +2518,6 @@ uint8 DreamBase::getLocation(uint8 index) {
return data.byte(kRoomscango + index);
}
-void DreamGenContext::getLocation() {
- al = DreamBase::getLocation(al);
-}
-
void DreamBase::setLocation(uint8 index) {
data.byte(kRoomscango + index) = 1;
}
@@ -2568,10 +2535,10 @@ const uint8 *DreamBase::getTextInFile1(uint16 index) {
void DreamGenContext::checkFolderCoords() {
RectWithCallback folderList[] = {
- { 280,320,160,200, &DreamGenContext::quitKey },
+ { 280,320,160,200, &DreamBase::quitKey },
{ 143,300,6,194, &DreamGenContext::nextFolder },
{ 0,143,6,194, &DreamGenContext::lastFolder },
- { 0,320,0,200, &DreamGenContext::blank },
+ { 0,320,0,200, &DreamBase::blank },
{ 0xFFFF,0,0,0, 0 }
};
checkCoords(folderList);
@@ -2617,10 +2584,10 @@ void DreamGenContext::lastFolder() {
}
}
-void DreamGenContext::folderHints() {
+void DreamBase::folderHints() {
if (data.byte(kFolderpage) == 5) {
- if ((data.byte(kAidedead) != 1) && (DreamBase::getLocation(13) != 1)) {
- DreamBase::setLocation(13);
+ if ((data.byte(kAidedead) != 1) && (getLocation(13) != 1)) {
+ setLocation(13);
showFolder();
const uint8 *string = getTextInFile1(30);
printDirect(string, 0, 86, 141, true);
@@ -2628,8 +2595,8 @@ void DreamGenContext::folderHints() {
hangOnP(200);
}
} else if (data.byte(kFolderpage) == 9) {
- if (DreamBase::getLocation(7) != 1) {
- DreamBase::setLocation(7);
+ if (getLocation(7) != 1) {
+ setLocation(7);
showFolder();
const uint8 *string = getTextInFile1(31);
printDirect(string, 0, 86, 141, true);
@@ -2639,19 +2606,15 @@ void DreamGenContext::folderHints() {
}
}
-void DreamGenContext::folderExit() {
+void DreamBase::folderExit() {
showFrame(tempGraphics2(), 296, 178, 6, 0);
}
-void DreamGenContext::loadTravelText() {
+void DreamBase::loadTravelText() {
data.word(kTraveltext) = standardLoad("DREAMWEB.T81"); // location descs
}
-void DreamGenContext::loadTempText() {
- loadTempText((const char *)data.ptr(dx, 0));
-}
-
-void DreamGenContext::loadTempText(const char *fileName) {
+void DreamBase::loadTempText(const char *fileName) {
data.word(kTextfile1) = standardLoad(fileName);
}
@@ -2679,7 +2642,7 @@ void DreamGenContext::allocateBuffers() {
data.word(kSounddata2) = allocateMem(2048/16);
}
-void DreamGenContext::workToScreenM() {
+void DreamBase::workToScreenM() {
animPointer();
readMouse();
showPointer();
@@ -2729,8 +2692,8 @@ void DreamGenContext::useMenu() {
dumpMenu();
dumpTextLine();
RectWithCallback menuList[] = {
- { kMenux+54,kMenux+68,kMenuy+72,kMenuy+88,&DreamGenContext::quitKey },
- { 0,320,0,200,&DreamGenContext::blank },
+ { kMenux+54,kMenux+68,kMenuy+72,kMenuy+88,&DreamBase::quitKey },
+ { 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 }
};
checkCoords(menuList);
@@ -3156,7 +3119,7 @@ void DreamGenContext::intro() {
data.byte(kLasthardkey) = 0;
}
-void DreamGenContext::setTopLeft() {
+void DreamBase::setTopLeft() {
if (data.byte(kSymboltopdir) != 0) {
blank();
return;
@@ -3171,7 +3134,7 @@ void DreamGenContext::setTopLeft() {
data.byte(kSymboltopdir) = 0xFF;
}
-void DreamGenContext::setTopRight() {
+void DreamBase::setTopRight() {
if (data.byte(kSymboltopdir) != 0) {
blank();
return;
@@ -3186,7 +3149,7 @@ void DreamGenContext::setTopRight() {
data.byte(kSymboltopdir) = 1;
}
-void DreamGenContext::setBotLeft() {
+void DreamBase::setBotLeft() {
if (data.byte(kSymbolbotdir) != 0) {
blank();
return;
@@ -3201,7 +3164,7 @@ void DreamGenContext::setBotLeft() {
data.byte(kSymbolbotdir) = 0xFF;
}
-void DreamGenContext::setBotRight() {
+void DreamBase::setBotRight() {
if (data.byte(kSymbolbotdir) != 0) {
blank();
return;
@@ -3226,14 +3189,14 @@ void DreamGenContext::newGame() {
data.byte(kGetback) = 3;
}
-void DreamGenContext::getBackFromOps() {
+void DreamBase::getBackFromOps() {
if (data.byte(kMandead) == 2)
blank();
else
getBack1();
}
-void DreamGenContext::getBackToOps() {
+void DreamBase::getBackToOps() {
if (data.byte(kCommandtype) != 201) {
data.byte(kCommandtype) = 201;
commandOnly(42);
@@ -3343,13 +3306,7 @@ void DreamGenContext::redrawMainScrn() {
data.byte(kCommandtype) = 255;
}
-void DreamGenContext::selectSlot2() {
- if (data.word(kMousebutton))
- data.byte(kLoadingorsave) = 2;
- selectSlot();
-}
-
-void DreamGenContext::blank() {
+void DreamBase::blank() {
if (data.byte(kCommandtype) != 199) {
data.byte(kCommandtype) = 199;
commandOnly(0);
@@ -3379,7 +3336,7 @@ void DreamGenContext::makeMainScreen() {
data.byte(kManisoffscreen) = 0;
}
-void DreamGenContext::openInv() {
+void DreamBase::openInv() {
data.byte(kInvopen) = 1;
printMessage(80, 58 - 10, 61, 240, (240 & 1));
fillRyan();
@@ -3390,8 +3347,8 @@ void DreamGenContext::obsThatDoThings() {
if (!compare(data.byte(kCommand), data.byte(kObjecttype), "MEMB"))
return; // notlouiscard
- if (DreamBase::getLocation(4) != 1) {
- DreamBase::setLocation(4);
+ if (getLocation(4) != 1) {
+ setLocation(4);
lookAtCard();
}
}
@@ -3691,7 +3648,7 @@ void DreamGenContext::selectLocation() {
{ 280,308,4,44,&DreamGenContext::lookAtPlace },
{ 104,216,138,192,&DreamGenContext::destSelect },
{ 273,320,157,198,&DreamGenContext::getBack1 },
- { 0,320,0,200,&DreamGenContext::blank },
+ { 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 }
};
checkCoords(destList);
@@ -3709,7 +3666,7 @@ void DreamGenContext::selectLocation() {
}
-void DreamGenContext::examineInventory() {
+void DreamBase::examineInventory() {
if (data.byte(kCommandtype) != 249) {
data.byte(kCommandtype) = 249;
commandOnly(32);
@@ -3768,13 +3725,11 @@ void DreamBase::showDiary() {
showFrame(tempGraphics(), kDiaryx + 176, kDiaryy + 108, 2, 0);
}
-void DreamGenContext::underTextLine() {
+void DreamBase::underTextLine() {
uint16 y = data.word(kTextaddressy);
if (data.byte(kForeignrelease))
y -= 3;
- ds = data.word(kBuffers);
- si = kTextunder;
- multiGet(ds.ptr(si, 0), data.byte(kTextaddressx), y, kUndertextsizex, kUndertextsizey);
+ multiGet(textUnder(), data.byte(kTextaddressx), y, kUndertextsizex, kUndertextsizey);
}
void DreamGenContext::showDecisions() {
@@ -3784,16 +3739,12 @@ void DreamGenContext::showDecisions() {
underTextLine();
}
-void DreamGenContext::getUnderZoom() {
- ds = data.word(kBuffers);
- si = kZoomspace;
- multiGet(ds.ptr(si, 0), kZoomx + 5, kZoomy + 4, 46, 40);
+void DreamBase::getUnderZoom() {
+ multiGet(getSegment(data.word(kBuffers)).ptr(kZoomspace, 0), kZoomx + 5, kZoomy + 4, 46, 40);
}
-void DreamGenContext::putUnderZoom() {
- ds = data.word(kBuffers);
- si = kZoomspace;
- multiPut(ds.ptr(si, 0), kZoomx + 5, kZoomy + 4, 46, 40);
+void DreamBase::putUnderZoom() {
+ multiPut(getSegment(data.word(kBuffers)).ptr(kZoomspace, 0), kZoomx + 5, kZoomy + 4, 46, 40);
}
void DreamGenContext::showWatchReel() {
@@ -3926,9 +3877,9 @@ void DreamGenContext::decide() {
RectWithCallback decideList[] = {
{ kOpsx+69,kOpsx+124,kOpsy+30,kOpsy+76,&DreamGenContext::newGame },
- { kOpsx+20,kOpsx+87,kOpsy+10,kOpsy+59,&DreamGenContext::DOSReturn },
+ { kOpsx+20,kOpsx+87,kOpsy+10,kOpsy+59,&DreamBase::DOSReturn },
{ kOpsx+123,kOpsx+190,kOpsy+10,kOpsy+59,&DreamGenContext::loadOld },
- { 0,320,0,200,&DreamGenContext::blank },
+ { 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 }
};
@@ -3972,7 +3923,7 @@ void DreamGenContext::talk() {
RectWithCallback talkList[] = {
{ 273,320,157,198,&DreamGenContext::getBack1 },
{ 240,290,2,44,&DreamGenContext::moreTalk },
- { 0,320,0,200,&DreamGenContext::blank },
+ { 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 }
};
@@ -4027,7 +3978,7 @@ void DreamGenContext::discOps() {
{ kOpsx+59,kOpsx+114,kOpsy+30,kOpsy+76,&DreamGenContext::loadGame },
{ kOpsx+10,kOpsx+79,kOpsy+10,kOpsy+59,&DreamGenContext::saveGame },
{ kOpsx+176,kOpsx+192,kOpsy+60,kOpsy+76,&DreamGenContext::getBackToOps },
- { 0,320,0,200,&DreamGenContext::blank },
+ { 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 }
};
@@ -4045,76 +3996,12 @@ void DreamGenContext::discOps() {
} while (!data.byte(kGetback));
}
-void DreamGenContext::doSaveLoad() {
- data.byte(kPointerframe) = 0;
- data.word(kTextaddressx) = 70;
- data.word(kTextaddressy) = 182-8;
- data.byte(kTextlen) = 181;
- data.byte(kManisoffscreen) = 1;
- clearWork();
- createPanel2();
- underTextLine();
- getRidOfAll();
- loadSaveBox();
- showOpBox();
- showMainOps();
- workToScreenCPP();
-
- RectWithCallback opsList[] = {
- { kOpsx+59,kOpsx+114,kOpsy+30,kOpsy+76,&DreamGenContext::getBackFromOps },
- { kOpsx+10,kOpsx+77,kOpsy+10,kOpsy+59,&DreamGenContext::DOSReturn },
- { kOpsx+128,kOpsx+190,kOpsy+16,kOpsy+100,&DreamGenContext::discOps },
- { 0,320,0,200,&DreamGenContext::blank },
- { 0xFFFF,0,0,0,0 }
- };
-
- bool firstOps = true;
-
- do { // restart ops
- if (firstOps) {
- firstOps = false;
- } else {
- showOpBox();
- showMainOps();
- workToScreenM();
- }
- data.byte(kGetback) = 0;
-
- do { // wait ops
- if (data.byte(kQuitrequested)) {
- data.byte(kManisoffscreen) = 0;
- return;
- }
-
- readMouse();
- showPointer();
- vSync();
- dumpPointer();
- dumpTextLine();
- delPointer();
- checkCoords(opsList);
- } while (!data.byte(kGetback));
- } while (data.byte(kGetback) == 2);
-
- data.word(kTextaddressx) = 13;
- data.word(kTextaddressy) = 182;
- data.byte(kTextlen) = 240;
- if (data.byte(kGetback) != 4) {
- getRidOfTemp();
- restoreAll();
- redrawMainScrn();
- workToScreenM();
- data.byte(kCommandtype) = 200;
- }
- data.byte(kManisoffscreen) = 0;
-}
-
void DreamGenContext::hangOnPQ() {
data.byte(kGetback) = 0;
RectWithCallback quitList[] = {
{ 273,320,157,198,&DreamGenContext::getBack1 },
- { 0,320,0,200,&DreamGenContext::blank },
+ { 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 }
};
@@ -4263,7 +4150,7 @@ void DreamGenContext::cantDrop() {
workToScreenM();
}
-void DreamGenContext::getBack1() {
+void DreamBase::getBack1() {
if (data.byte(kPickup) != 0) {
blank();
return;
@@ -4370,7 +4257,7 @@ void DreamGenContext::autoAppear() {
// In alley
al = 5;
resetLocation();
- DreamBase::setLocation(10);
+ setLocation(10);
data.byte(kDestpos) = 10;
return;
}
@@ -4401,7 +4288,7 @@ void DreamGenContext::autoAppear() {
data.byte(kNewsitem) = 3;
al = 6;
resetLocation();
- DreamBase::setLocation(11);
+ setLocation(11);
data.byte(kDestpos) = 11;
} else {
if (data.byte(kReallocation) == 2 && data.byte(kRockstardead) != 0)
@@ -4410,7 +4297,7 @@ void DreamGenContext::autoAppear() {
}
}
-void DreamGenContext::quitKey() {
+void DreamBase::quitKey() {
if (data.byte(kCommandtype) != 222) {
data.byte(kCommandtype) = 222;
commandOnly(4);
@@ -4544,38 +4431,6 @@ void DreamGenContext::entryAnims() {
}
}
-void DreamGenContext::selectSlot() {
- if (data.byte(kCommandtype) != 244) {
- data.byte(kCommandtype) = 244;
- commandOnly(45);
- }
-
- if (data.word(kMousebutton) != 1 || data.word(kMousebutton) == data.word(kOldbutton))
- return; // noselslot
- if (data.byte(kLoadingorsave) == 3)
- data.byte(kLoadingorsave)--;
-
- oldToNames();
- int y = data.word(kMousey) - (kOpsy + 4);
- if (y < 11)
- data.byte(kCurrentslot) = 0;
- else
- data.byte(kCurrentslot) = y / 11;
-
- delPointer();
- showOpBox();
- showSlots();
- showNames();
- if (data.byte(kLoadingorsave) == 1)
- showLoadOps();
- else
- showSaveOps();
- readMouse();
- showPointer();
- workToScreen();
- delPointer();
-}
-
void DreamGenContext::updateSymbolTop() {
if (!data.byte(kSymboltopdir))
return; // topfinished
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 8218a1ac0f..0f5a5ca115 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -58,16 +58,12 @@
uint8 printDirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered) {
return DreamBase::printDirect(string, x, y, maxWidth, centered);
}
- void printMessage(uint16 x, uint16 y, uint8 index, uint8 maxWidth, bool centered);
- void printMessage();
void useTimedText();
void dumpTimedText();
void setupTimedTemp(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount);
void getUnderTimed();
void putUnderTimed();
void dumpTextLine();
- void oldToNames();
- void namesToOld();
void startLoading(const Room &room);
void showFrame();
void showFrame(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height) {
@@ -78,7 +74,6 @@
}
void printASprite(const Sprite *sprite);
void width160();
- void eraseOldObs();
void clearSprites();
Sprite *makeSprite(uint8 x, uint8 y, uint16 updateCallback, uint16 frameData, uint16 somethingInDi);
void spriteUpdate();
@@ -111,9 +106,10 @@
void dealWithSpecial(uint8 firstParam, uint8 secondParam);
void zoom();
void showRain();
- void delTextLine();
void commandOnly();
- void commandOnly(uint8 command);
+ void commandOnly(uint8 command) {
+ DreamBase::commandOnly(command);
+ }
void doBlocks();
void checkIfPerson();
bool checkIfPerson(uint8 x, uint8 y);
@@ -154,14 +150,12 @@
DynObject *getExAd(uint8 index) {
return DreamBase::getExAd(index);
}
- DynObject *getEitherAdCPP();
void *getAnyAd(uint8 *value1, uint8 *value2) {
return DreamBase::getAnyAd(value1, value2);
}
SetObject *getSetAd(uint8 index) {
return DreamBase::getSetAd(index);
}
- void *getAnyAdDir(uint8 index, uint8 flag);
void setAllChanges();
void doChange(uint8 index, uint8 value, uint8 type);
void deleteTaken();
@@ -175,47 +169,45 @@
bool finishedWalkingCPP();
void finishedWalking();
void checkOne();
- void checkOne(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uint8 *type, uint8 *flagX, uint8 *flagY);
- void getFlagUnderP();
- void getFlagUnderP(uint8 *flag, uint8 *flagEx);
+ void checkOne(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uint8 *type, uint8 *flagX, uint8 *flagY) {
+ DreamBase::checkOne(x, y, flag, flagEx, type, flagX, flagY);
+ }
void walkAndExamine();
void obName();
void obName(uint8 command, uint8 commandType);
- void animPointer();
void checkCoords(const RectWithCallback *rectWithCallbacks);
- void drawFlags();
void addToPeopleList();
void addToPeopleList(ReelRoutine *routine);
void getExPos();
- void obPicture();
void compare();
- bool compare(uint8 index, uint8 flag, const char id[4]);
+ bool compare(uint8 index, uint8 flag, const char id[4]) {
+ return DreamBase::compare(index, flag, id);
+ }
bool pixelCheckSet(const ObjPos *pos, uint8 x, uint8 y);
- bool isItDescribed(const ObjPos *objPos);
void checkIfSet();
bool checkIfSet(uint8 x, uint8 y);
void checkIfPathIsOn();
bool checkIfPathIsOn(uint8 index);
void isItWorn();
- bool isItWorn(const DynObject *object);
+ bool isItWorn(const DynObject *object) {
+ return DreamBase::isItWorn(object);
+ }
void wornError();
void makeWorn();
void makeWorn(DynObject *object);
void obToInv();
- void obToInv(uint8 index, uint8 flag, uint16 x, uint16 y);
- void findAllRyan();
- void findAllRyan(uint8 *inv);
- void fillRyan();
+ void obToInv(uint8 index, uint8 flag, uint16 x, uint16 y) {
+ DreamBase::obToInv(index, flag, x, y);
+ }
void useRoutine();
void hangOn();
void hangOn(uint16 frameCount) {
DreamBase::hangOn(frameCount);
}
- void hangOnW();
- void hangOnW(uint16 frameCount);
void hangOnP();
- void hangOnP(uint16 count);
- void showIcon();
+ void hangOnP(uint16 count) {
+ DreamBase::hangOnP(count);
+ }
uint8 findNextColon(const uint8 **string) {
return DreamBase::findNextColon(string);
}
@@ -231,15 +223,11 @@
void convIcons();
void examineOb(bool examineAgain = true);
void dumpWatch();
- void roomName();
void transferText();
void initRain();
Rain *splitIntoLines(uint8 x, uint8 y, Rain *rain);
void watchCount();
- void zoomIcon();
void loadRoom();
- void getUnderMenu();
- void putUnderMenu();
void textForMonk();
void textForMonkHelper(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount);
void textForEnd();
@@ -275,22 +263,12 @@
void playChannel1(uint8 index) {
DreamBase::playChannel1(index);
}
- void showMainOps();
- void showDiscOps();
void findRoomInLoc();
void reelsOnScreen();
void reconstruct();
void look();
void autoLook();
void doLook();
- void getBackFromOb();
- void getRidOfAll();
- void getRidOfTemp();
- void getRidOfTempText();
- void getRidOfTemp2();
- void getRidOfTemp3();
- void getRidOfTempCharset();
- void getRidOfTempsP();
void showFirstUse();
void showSecondUse();
void actualSave();
@@ -298,7 +276,6 @@
void loadPosition(unsigned int slot);
void savePosition(unsigned int slot, const char *descbuf);
void restoreAll();
- void restoreReels();
void enterSymbol();
void viewFolder();
void edensCDPlayer();
@@ -352,28 +329,14 @@
void wearWatch();
void wearShades();
void checkFolderCoords();
- void loadFolder();
- void showFolder();
- void showLeftPage();
- void showRightPage();
void nextFolder();
void lastFolder();
- void folderHints();
- void folderExit();
- void getLocation();
- uint8 getLocation(uint8 index) {
- return DreamBase::getLocation(index);
- }
void setLocation();
void setLocation(uint8 index) {
DreamBase::setLocation(index);
}
- void loadTempText();
- void loadTempText(const char *fileName);
- void loadTravelText();
void drawFloor();
void allocateBuffers();
- void workToScreenM();
bool checkSpeed(ReelRoutine &routine);
void checkSpeed();
void sparkyDrip(ReelRoutine &routine);
@@ -421,26 +384,8 @@
void helicopter(ReelRoutine &routine);
void singleKey(uint8 key, uint16 x, uint16 y);
void loadSaveBox();
- void loadKeypad();
- void showKeypad();
- void showOuterPad();
uint8 nextSymbol(uint8 symbol);
void showSymbol();
- void examIcon();
- void buttonOne();
- void buttonTwo();
- void buttonThree();
- void buttonFour();
- void buttonFive();
- void buttonSix();
- void buttonSeven();
- void buttonEight();
- void buttonNine();
- void buttonNought();
- void buttonEnter();
- void buttonPress(uint8 buttonId);
- void addToPressList();
- bool isItRight(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3);
void enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3);
unsigned int scanForNames();
void doLoad(int slot);
@@ -460,17 +405,7 @@
void realCredits();
void runIntroSeq();
void intro();
- void clearBeforeLoad();
- void clearReels();
- void getRidOfReels();
- void liftNoise(uint8 index);
- void setTopLeft();
- void setTopRight();
- void setBotLeft();
- void setBotRight();
void newGame();
- void getBackFromOps();
- void getBackToOps();
void pickupOb(uint8 command, uint8 pos);
void initialInv();
void walkIntoRoom();
@@ -480,7 +415,6 @@
void redrawMainScrn();
void selectSlot();
void selectSlot2();
- void blank();
void allPointer();
void openYourNeighbour();
void openRyan();
@@ -488,7 +422,6 @@
void openEden();
void openSarters();
void openLouis();
- void DOSReturn();
void useLadder();
void useLadderB();
void useCart();
@@ -509,7 +442,6 @@
void hotelControl();
void obsThatDoThings();
void makeMainScreen();
- void openInv();
void delEverything();
void clearPalette();
void errorMessage1();
@@ -524,9 +456,6 @@
void redes();
void isSetObOnMap();
bool isSetObOnMap(uint8 index);
- void dumpKeypad();
- void dumpSymbol();
- void dumpSymBox();
void dumpZoom();
void selectLocation();
void showGroup();
@@ -536,7 +465,6 @@
}
void getTime();
void set16ColPalette();
- void examineInventory();
void showSaveOps();
void showLoadOps();
void watchReel();
@@ -548,9 +476,6 @@
void afterNewRoom();
void madmanRun();
void showDecisions();
- void underTextLine();
- void getUnderZoom();
- void putUnderZoom();
void decide();
void talk();
void discOps();
@@ -559,13 +484,11 @@
void hangOnPQ();
void showGun();
void endGame();
- void quitSymbol();
void diaryKeyP();
void diaryKeyN();
void checkInput();
void dropError();
void cantDrop();
- void getBack1();
void newPlace();
void showPuzText(uint16 command, uint16 count);
void showPuzText();
@@ -573,7 +496,6 @@
void rollEndCredits2();
void useButtonA();
void autoAppear();
- void quitKey();
void setupTimedUse();
void entryAnims();
void triggerMessage(uint16 index);
@@ -590,5 +512,10 @@
void findExObject();
uint16 findExObject(const char *id);
void describeOb();
+ void getOpenedSize();
+ byte getOpenedSizeCPP();
+ void openOb();
+ void withWhat();
+ void notHeldError();
#endif
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index 5306522c13..08b96cf33a 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -1473,4 +1473,38 @@ void DreamGenContext::useAltar() {
}
}
+void DreamGenContext::withWhat() {
+ uint8 commandLine[64] = "OBJECT NAME ONE ";
+
+ createPanel();
+ showPanel();
+ showMan();
+ showExit();
+
+ copyName(data.byte(kObjecttype), data.byte(kCommand), commandLine);
+ printMessage2(100, 21, 63, 200, false, 2);
+ printDirect(commandLine, data.word(kLastxpos) + 5, 21, 220, false);
+ printMessage2(data.word(kLastxpos) + 5, 21, 63, 200, false, 3);
+
+ fillRyan();
+ data.byte(kCommandtype) = 255;
+ readMouse();
+ showPointer();
+ workToScreen();
+ delPointer();
+ data.byte(kInvopen) = 2;
+}
+
+void DreamGenContext::notHeldError() {
+ createPanel();
+ showPanel();
+ showMan();
+ showExit();
+ obIcons();
+ printMessage2(64, 100, 63, 200 + 1, true, 1);
+ workToScreenM();
+ hangOnP(50);
+ putBackObStuff();
+}
+
} // End of namespace DreamGen