DREAMWEB: Move more things to DreamBase; cleanup some code

This commit is contained in:
Max Horn 2011-12-16 16:38:21 +01:00
parent 027249ec30
commit 202f9d18f1
6 changed files with 92 additions and 114 deletions

View File

@ -165,13 +165,41 @@ public:
// from sprite.cpp // from sprite.cpp
Sprite *spriteTable(); Sprite *spriteTable();
void printSprites();
void printASprite(const Sprite *sprite);
void clearSprites();
Sprite *makeSprite(uint8 x, uint8 y, uint16 updateCallback, uint16 frameData, uint16 somethingInDi);
void initMan();
void walking(Sprite *sprite);
void aboutTurn(Sprite *sprite);
void backObject(Sprite *sprite);
void constant(Sprite *sprite, SetObject *objData);
void randomSprite(Sprite *sprite, SetObject *objData);
void doorway(Sprite *sprite, SetObject *objData);
void wideDoor(Sprite *sprite, SetObject *objData);
void doDoor(Sprite *sprite, SetObject *objData, Common::Rect check);
void steady(Sprite *sprite, SetObject *objData);
void lockedDoorway(Sprite *sprite, SetObject *objData);
void liftSprite(Sprite *sprite, SetObject *objData);
Reel *getReelStart(uint16 reelPointer); Reel *getReelStart(uint16 reelPointer);
const Frame *findSource(uint16 &frame); const Frame *findSource(uint16 &frame);
void showReelFrame(Reel *reel); void showReelFrame(Reel *reel);
void showGameReel(ReelRoutine *routine);
const Frame *getReelFrameAX(uint16 frame); const Frame *getReelFrameAX(uint16 frame);
void rollEndCredits(); void moveMap(uint8 param);
void priestText(ReelRoutine &routine);
void checkOne(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uint8 *type, uint8 *flagX, uint8 *flagY); void checkOne(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uint8 *type, uint8 *flagX, uint8 *flagY);
uint8 getBlockOfPixel(uint8 x, uint8 y);
Rain *splitIntoLines(uint8 x, uint8 y, Rain *rain);
void initRain();
void rollEndCredits();
void monks2text();
void textForEnd();
void textForMonkHelper(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount);
void textForMonk();
void priestText(ReelRoutine &routine);
void soundOnReels(uint16 reelPointer); void soundOnReels(uint16 reelPointer);
void clearBeforeLoad(); void clearBeforeLoad();
void clearReels(); void clearReels();
@ -179,6 +207,7 @@ public:
void liftNoise(uint8 index); void liftNoise(uint8 index);
// from stubs.cpp // from stubs.cpp
bool isCD();
void crosshair(); void crosshair();
void delTextLine(); void delTextLine();
void showBlink(); void showBlink();
@ -187,6 +216,8 @@ public:
void showPointer(); void showPointer();
void delPointer(); void delPointer();
void showRyanPage(); void showRyanPage();
void switchRyanOn();
void switchRyanOff();
Frame *tempGraphics(); Frame *tempGraphics();
Frame *tempGraphics2(); Frame *tempGraphics2();
Frame *tempGraphics3(); Frame *tempGraphics3();
@ -215,6 +246,7 @@ public:
void *getAnyAd(uint8 *value1, uint8 *value2); void *getAnyAd(uint8 *value1, uint8 *value2);
const uint8 *getTextInFile1(uint16 index); const uint8 *getTextInFile1(uint16 index);
uint8 findNextColon(const uint8 **string); uint8 findNextColon(const uint8 **string);
void allocateBuffers();
uint16 allocateMem(uint16 paragraphs); uint16 allocateMem(uint16 paragraphs);
void deallocateMem(uint16 segment); void deallocateMem(uint16 segment);
uint16 allocateAndLoad(unsigned int size); uint16 allocateAndLoad(unsigned int size);
@ -282,6 +314,15 @@ public:
void removeSetObject(uint8 index); void removeSetObject(uint8 index);
bool isSetObOnMap(uint8 index); bool isSetObOnMap(uint8 index);
void dumpZoom(); void dumpZoom();
void diaryKeyP();
void diaryKeyN();
void findRoomInLoc();
void loadMenu();
void showMenu();
void dumpMenu();
void dealWithSpecial(uint8 firstParam, uint8 secondParam);
void plotReel(uint16 &reelPointer);
void setupTimedTemp(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount);
// from use.cpp // from use.cpp
void placeFreeObject(uint8 index); void placeFreeObject(uint8 index);

View File

@ -106,7 +106,7 @@ void DreamGenContext::enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8
{ kKeypadx+9,kKeypadx+30,kKeypady+59,kKeypady+73,&DreamBase::buttonNought }, { kKeypadx+9,kKeypadx+30,kKeypady+59,kKeypady+73,&DreamBase::buttonNought },
{ kKeypadx+31,kKeypadx+74,kKeypady+59,kKeypady+73,&DreamBase::buttonEnter }, { kKeypadx+31,kKeypadx+74,kKeypady+59,kKeypady+73,&DreamBase::buttonEnter },
{ kKeypadx+72,kKeypadx+86,kKeypady+80,kKeypady+94,&DreamBase::quitKey }, { kKeypadx+72,kKeypadx+86,kKeypady+80,kKeypady+94,&DreamBase::quitKey },
{ 0,320,0,200,&DreamGenContext::blank }, { 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 } { 0xFFFF,0,0,0,0 }
}; };

View File

@ -29,7 +29,7 @@ Sprite *DreamBase::spriteTable() {
return sprite; return sprite;
} }
void DreamGenContext::printSprites() { void DreamBase::printSprites() {
for (size_t priority = 0; priority < 7; ++priority) { for (size_t priority = 0; priority < 7; ++priority) {
Sprite *sprites = spriteTable(); Sprite *sprites = spriteTable();
for (size_t j = 0; j < 16; ++j) { for (size_t j = 0; j < 16; ++j) {
@ -45,7 +45,7 @@ void DreamGenContext::printSprites() {
} }
} }
void DreamGenContext::printASprite(const Sprite *sprite) { void DreamBase::printASprite(const Sprite *sprite) {
uint16 x, y; uint16 x, y;
if (sprite->y >= 220) { if (sprite->y >= 220) {
y = data.word(kMapady) - (256 - sprite->y); y = data.word(kMapady) - (256 - sprite->y);
@ -67,11 +67,11 @@ void DreamGenContext::printASprite(const Sprite *sprite) {
showFrame((const Frame *)getSegment(sprite->frameData()).ptr(0, 0), x, y, sprite->frameNumber, c); showFrame((const Frame *)getSegment(sprite->frameData()).ptr(0, 0), x, y, sprite->frameNumber, c);
} }
void DreamGenContext::clearSprites() { void DreamBase::clearSprites() {
memset(spriteTable(), 0xff, sizeof(Sprite) * 16); memset(spriteTable(), 0xff, sizeof(Sprite) * 16);
} }
Sprite *DreamGenContext::makeSprite(uint8 x, uint8 y, uint16 updateCallback, uint16 frameData, uint16 somethingInDi) { Sprite *DreamBase::makeSprite(uint8 x, uint8 y, uint16 updateCallback, uint16 frameData, uint16 somethingInDi) {
Sprite *sprite = spriteTable(); Sprite *sprite = spriteTable();
while (sprite->frameNumber != 0xff) { // NB: No boundchecking in the original code either while (sprite->frameNumber != 0xff) { // NB: No boundchecking in the original code either
++sprite; ++sprite;
@ -111,17 +111,13 @@ void DreamGenContext::spriteUpdate() {
} }
} }
void DreamGenContext::initMan() { void DreamBase::initMan() {
Sprite *sprite = makeSprite(data.byte(kRyanx), data.byte(kRyany), addr_mainman, data.word(kMainsprites), 0); Sprite *sprite = makeSprite(data.byte(kRyanx), data.byte(kRyany), addr_mainman, data.word(kMainsprites), 0);
sprite->priority = 4; sprite->priority = 4;
sprite->speed = 0; sprite->speed = 0;
sprite->walkFrame = 0; sprite->walkFrame = 0;
} }
void DreamGenContext::mainMan() {
assert(false);
}
void DreamGenContext::mainMan(Sprite *sprite) { void DreamGenContext::mainMan(Sprite *sprite) {
push(es); push(es);
push(ds); push(ds);
@ -186,7 +182,7 @@ void DreamGenContext::mainMan(Sprite *sprite) {
es = pop(); es = pop();
} }
void DreamGenContext::walking(Sprite *sprite) { void DreamBase::walking(Sprite *sprite) {
uint8 comp; uint8 comp;
if (data.byte(kLinedirection) != 0) { if (data.byte(kLinedirection) != 0) {
--data.byte(kLinepointer); --data.byte(kLinepointer);
@ -208,14 +204,10 @@ void DreamGenContext::walking(Sprite *sprite) {
return; return;
} }
data.byte(kDestination) = data.byte(kFinaldest); data.byte(kDestination) = data.byte(kFinaldest);
push(es);
push(bx);
autoSetWalk(); autoSetWalk();
bx = pop();
es = pop();
} }
void DreamGenContext::aboutTurn(Sprite *sprite) { void DreamBase::aboutTurn(Sprite *sprite) {
bool incdir = true; bool incdir = true;
if (data.byte(kTurndirection) == 1) if (data.byte(kTurndirection) == 1)
@ -249,11 +241,7 @@ void DreamGenContext::aboutTurn(Sprite *sprite) {
} }
} }
void DreamGenContext::backObject() { void DreamBase::backObject(Sprite *sprite) {
assert(false);
}
void DreamGenContext::backObject(Sprite *sprite) {
SetObject *objData = (SetObject *)getSegment(data.word(kSetdat)).ptr(sprite->objData(), 0); SetObject *objData = (SetObject *)getSegment(data.word(kSetdat)).ptr(sprite->objData(), 0);
if (sprite->delay != 0) { if (sprite->delay != 0) {
@ -278,7 +266,7 @@ void DreamGenContext::backObject(Sprite *sprite) {
steady(sprite, objData); steady(sprite, objData);
} }
void DreamGenContext::constant(Sprite *sprite, SetObject *objData) { void DreamBase::constant(Sprite *sprite, SetObject *objData) {
++sprite->animFrame; ++sprite->animFrame;
if (objData->frames[sprite->animFrame] == 255) { if (objData->frames[sprite->animFrame] == 255) {
sprite->animFrame = 0; sprite->animFrame = 0;
@ -288,22 +276,22 @@ void DreamGenContext::constant(Sprite *sprite, SetObject *objData) {
sprite->frameNumber = frame; sprite->frameNumber = frame;
} }
void DreamGenContext::randomSprite(Sprite *sprite, SetObject *objData) { void DreamBase::randomSprite(Sprite *sprite, SetObject *objData) {
uint8 r = engine->randomNumber(); uint8 r = engine->randomNumber();
sprite->frameNumber = objData->frames[r&7]; sprite->frameNumber = objData->frames[r&7];
} }
void DreamGenContext::doorway(Sprite *sprite, SetObject *objData) { void DreamBase::doorway(Sprite *sprite, SetObject *objData) {
Common::Rect check(-24, -30, 10, 10); Common::Rect check(-24, -30, 10, 10);
doDoor(sprite, objData, check); doDoor(sprite, objData, check);
} }
void DreamGenContext::wideDoor(Sprite *sprite, SetObject *objData) { void DreamBase::wideDoor(Sprite *sprite, SetObject *objData) {
Common::Rect check(-24, -30, 24, 24); Common::Rect check(-24, -30, 24, 24);
doDoor(sprite, objData, check); doDoor(sprite, objData, check);
} }
void DreamGenContext::doDoor(Sprite *sprite, SetObject *objData, Common::Rect check) { void DreamBase::doDoor(Sprite *sprite, SetObject *objData, Common::Rect check) {
int ryanx = data.byte(kRyanx); int ryanx = data.byte(kRyanx);
int ryany = data.byte(kRyany); int ryany = data.byte(kRyany);
@ -352,13 +340,13 @@ void DreamGenContext::doDoor(Sprite *sprite, SetObject *objData, Common::Rect ch
} }
} }
void DreamGenContext::steady(Sprite *sprite, SetObject *objData) { void DreamBase::steady(Sprite *sprite, SetObject *objData) {
uint8 frame = objData->frames[0]; uint8 frame = objData->frames[0];
objData->index = frame; objData->index = frame;
sprite->frameNumber = frame; sprite->frameNumber = frame;
} }
void DreamGenContext::lockedDoorway(Sprite *sprite, SetObject *objData) { void DreamBase::lockedDoorway(Sprite *sprite, SetObject *objData) {
int ryanx = data.byte(kRyanx); int ryanx = data.byte(kRyanx);
int ryany = data.byte(kRyany); int ryany = data.byte(kRyany);
@ -409,13 +397,13 @@ void DreamGenContext::lockedDoorway(Sprite *sprite, SetObject *objData) {
} }
} }
void DreamGenContext::liftSprite(Sprite *sprite, SetObject *objData) { void DreamBase::liftSprite(Sprite *sprite, SetObject *objData) {
uint8 liftFlag = data.byte(kLiftflag); uint8 liftFlag = data.byte(kLiftflag);
if (liftFlag == 0) { //liftclosed if (liftFlag == 0) { //liftclosed
turnPathOff(data.byte(kLiftpath)); turnPathOff(data.byte(kLiftpath));
if (data.byte(kCounttoopen) != 0) { if (data.byte(kCounttoopen) != 0) {
_dec(data.byte(kCounttoopen)); data.byte(kCounttoopen)--;
if (data.byte(kCounttoopen) == 0) if (data.byte(kCounttoopen) == 0)
data.byte(kLiftflag) = 3; data.byte(kLiftflag) = 3;
} }
@ -426,7 +414,7 @@ void DreamGenContext::liftSprite(Sprite *sprite, SetObject *objData) {
turnPathOn(data.byte(kLiftpath)); turnPathOn(data.byte(kLiftpath));
if (data.byte(kCounttoclose) != 0) { if (data.byte(kCounttoclose) != 0) {
_dec(data.byte(kCounttoclose)); data.byte(kCounttoclose)--;
if (data.byte(kCounttoclose) == 0) if (data.byte(kCounttoclose) == 0)
data.byte(kLiftflag) = 2; data.byte(kLiftflag) = 2;
} }
@ -486,7 +474,7 @@ void DreamBase::showReelFrame(Reel *reel) {
showFrame(base, x, y, frame, 8); showFrame(base, x, y, frame, 8);
} }
void DreamGenContext::showGameReel(ReelRoutine *routine) { void DreamBase::showGameReel(ReelRoutine *routine) {
uint16 reelPointer = routine->reelPointer(); uint16 reelPointer = routine->reelPointer();
if (reelPointer >= 512) if (reelPointer >= 512)
return; return;
@ -545,7 +533,7 @@ void DreamGenContext::showRain() {
playChannel1(soundIndex); playChannel1(soundIndex);
} }
void DreamGenContext::moveMap(uint8 param) { void DreamBase::moveMap(uint8 param) {
switch (param) { switch (param) {
case 32: case 32:
data.byte(kMapy) -= 20; data.byte(kMapy) -= 20;
@ -586,11 +574,7 @@ void DreamBase::checkOne(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uint8 *ty
*type = tileData[2]; *type = tileData[2];
} }
void DreamGenContext::getBlockOfPixel() { uint8 DreamBase::getBlockOfPixel(uint8 x, uint8 y) {
al = getBlockOfPixel(cl, ch);
}
uint8 DreamGenContext::getBlockOfPixel(uint8 x, uint8 y) {
uint8 flag, flagEx, type, flagX, flagY; uint8 flag, flagEx, type, flagX, flagY;
checkOne(x + data.word(kMapxstart), y + data.word(kMapystart), &flag, &flagEx, &type, &flagX, &flagY); checkOne(x + data.word(kMapxstart), y + data.word(kMapystart), &flag, &flagEx, &type, &flagX, &flagY);
if (flag & 1) if (flag & 1)
@ -599,7 +583,7 @@ uint8 DreamGenContext::getBlockOfPixel(uint8 x, uint8 y) {
return type; return type;
} }
Rain *DreamGenContext::splitIntoLines(uint8 x, uint8 y, Rain *rain) { Rain *DreamBase::splitIntoLines(uint8 x, uint8 y, Rain *rain) {
do { do {
// Look for line start // Look for line start
while (!getBlockOfPixel(x, y)) { while (!getBlockOfPixel(x, y)) {
@ -670,7 +654,7 @@ static const RainLocation rainLocationList[] = {
{ 255,0,0,0 } { 255,0,0,0 }
}; };
void DreamGenContext::initRain() { void DreamBase::initRain() {
const RainLocation *r = rainLocationList; const RainLocation *r = rainLocationList;
Rain *rainList = (Rain *)getSegment(data.word(kBuffers)).ptr(kRainlist, 0); Rain *rainList = (Rain *)getSegment(data.word(kBuffers)).ptr(kRainlist, 0);
Rain *rain = rainList; Rain *rain = rainList;
@ -799,7 +783,7 @@ void DreamBase::rollEndCredits() {
} }
void DreamGenContext::monks2text() { void DreamBase::monks2text() {
bool isGermanCD = isCD() && engine->getLanguage() == Common::DE_DEU; bool isGermanCD = isCD() && engine->getLanguage() == Common::DE_DEU;
if (data.byte(kIntrocount) == 1) if (data.byte(kIntrocount) == 1)
@ -836,7 +820,7 @@ void DreamGenContext::monks2text() {
setupTimedTemp(18, 82, 36, 160, 120, 1); setupTimedTemp(18, 82, 36, 160, 120, 1);
} }
void DreamGenContext::textForEnd() { void DreamBase::textForEnd() {
if (data.byte(kIntrocount) == 20) if (data.byte(kIntrocount) == 20)
setupTimedTemp(0, 83, 34, 20, 60, 1); setupTimedTemp(0, 83, 34, 20, 60, 1);
else if (data.byte(kIntrocount) == (isCD() ? 50 : 65)) else if (data.byte(kIntrocount) == (isCD() ? 50 : 65))
@ -845,14 +829,14 @@ void DreamGenContext::textForEnd() {
setupTimedTemp(2, 83, 34, 20, 60, 1); setupTimedTemp(2, 83, 34, 20, 60, 1);
} }
void DreamGenContext::textForMonkHelper(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount) { void DreamBase::textForMonkHelper(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount) {
if (isCD() && data.byte(kCh1playing) != 255) if (isCD() && data.byte(kCh1playing) != 255)
data.byte(kIntrocount)--; data.byte(kIntrocount)--;
else else
setupTimedTemp(textIndex, voiceIndex, x, y, countToTimed, timeCount); setupTimedTemp(textIndex, voiceIndex, x, y, countToTimed, timeCount);
} }
void DreamGenContext::textForMonk() { void DreamBase::textForMonk() {
if (data.byte(kIntrocount) == 1) if (data.byte(kIntrocount) == 1)
textForMonkHelper(19, 82, 68, 154, 120, 1); textForMonkHelper(19, 82, 68, 154, 120, 1);
else if (data.byte(kIntrocount) == 5) else if (data.byte(kIntrocount) == 5)

View File

@ -732,11 +732,11 @@ void DreamGenContext::startup1() {
fadeScreenUp(); fadeScreenUp();
} }
void DreamGenContext::switchRyanOn() { void DreamBase::switchRyanOn() {
data.byte(kRyanon) = 255; data.byte(kRyanon) = 255;
} }
void DreamGenContext::switchRyanOff() { void DreamBase::switchRyanOff() {
data.byte(kRyanon) = 1; data.byte(kRyanon) = 1;
} }
@ -916,7 +916,7 @@ void DreamGenContext::useTimedText() {
data.byte(kNeedtodumptimed) = 1; data.byte(kNeedtodumptimed) = 1;
} }
void DreamGenContext::setupTimedTemp(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount) { void DreamBase::setupTimedTemp(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount) {
#if 1 // if cd #if 1 // if cd
if (voiceIndex != 0) { if (voiceIndex != 0) {
if (loadSpeech('T', voiceIndex, 'T', textIndex)) { if (loadSpeech('T', voiceIndex, 'T', textIndex)) {
@ -1110,7 +1110,6 @@ void DreamGenContext::startLoading(const Room &room) {
data.byte(kLiftpath) = room.liftPath; data.byte(kLiftpath) = room.liftPath;
data.byte(kDoorpath) = room.doorPath; data.byte(kDoorpath) = room.doorPath;
data.byte(kLastweapon) = (uint8)-1; data.byte(kLastweapon) = (uint8)-1;
ah = data.byte(kReallocation);
data.byte(kReallocation) = room.realLocation; data.byte(kReallocation) = room.realLocation;
loadRoomData(room, false); loadRoomData(room, false);
@ -1131,14 +1130,12 @@ void DreamGenContext::startLoading(const Room &room) {
data.byte(kLinepointer) = 254; data.byte(kLinepointer) = 254;
if (room.b27 != 255) { if (room.b27 != 255) {
data.byte(kManspath) = room.b27; data.byte(kManspath) = room.b27;
push(bx);
autoSetWalk(); autoSetWalk();
bx = pop();
} }
findXYFromPath(); findXYFromPath();
} }
void DreamGenContext::dealWithSpecial(uint8 firstParam, uint8 secondParam) { void DreamBase::dealWithSpecial(uint8 firstParam, uint8 secondParam) {
uint8 type = firstParam - 220; uint8 type = firstParam - 220;
if (type == 0) { if (type == 0) {
placeSetObject(secondParam); placeSetObject(secondParam);
@ -1165,7 +1162,7 @@ void DreamGenContext::dealWithSpecial(uint8 firstParam, uint8 secondParam) {
} }
} }
void DreamGenContext::plotReel(uint16 &reelPointer) { void DreamBase::plotReel(uint16 &reelPointer) {
Reel *reel = getReelStart(reelPointer); Reel *reel = getReelStart(reelPointer);
while (reel->x >= 220 && reel->x != 255) { while (reel->x >= 220 && reel->x != 255) {
dealWithSpecial(reel->x, reel->y); dealWithSpecial(reel->x, reel->y);
@ -1810,7 +1807,7 @@ bool DreamBase::isItDescribed(const ObjPos *pos) {
return result != 0; return result != 0;
} }
bool DreamGenContext::isCD() { bool DreamBase::isCD() {
// The original sources has two codepaths depending if the game is 'if cd' or not // The original sources has two codepaths depending if the game is 'if cd' or not
// This is a hack to guess which version to use with the assumption that if we have a cd version // This is a hack to guess which version to use with the assumption that if we have a cd version
// we managed to load the speech. At least it is isolated in this function and can be changed. // we managed to load the speech. At least it is isolated in this function and can be changed.
@ -2208,7 +2205,7 @@ Frame * DreamBase::tempGraphics3() {
return (Frame *)getSegment(data.word(kTempgraphics3)).ptr(0, 0); return (Frame *)getSegment(data.word(kTempgraphics3)).ptr(0, 0);
} }
void DreamGenContext::findRoomInLoc() { void DreamBase::findRoomInLoc() {
uint8 x = data.byte(kMapx) / 11; uint8 x = data.byte(kMapx) / 11;
uint8 y = data.byte(kMapy) / 10; uint8 y = data.byte(kMapy) / 10;
uint8 roomNum = y * 6 + x; uint8 roomNum = y * 6 + x;
@ -2619,7 +2616,7 @@ void DreamGenContext::drawFloor() {
data.byte(kNewobs) = 0; data.byte(kNewobs) = 0;
} }
void DreamGenContext::allocateBuffers() { void DreamBase::allocateBuffers() {
data.word(kExtras) = allocateMem(kLengthofextra/16); data.word(kExtras) = allocateMem(kLengthofextra/16);
data.word(kMapdata) = allocateMem(kLengthofmap/16); data.word(kMapdata) = allocateMem(kLengthofmap/16);
data.word(kBuffers) = allocateMem(kLengthofbuffer/16); data.word(kBuffers) = allocateMem(kLengthofbuffer/16);
@ -2639,19 +2636,19 @@ void DreamBase::workToScreenM() {
delPointer(); delPointer();
} }
void DreamGenContext::loadMenu() { void DreamBase::loadMenu() {
loadIntoTemp("DREAMWEB.S02"); // sprite name 3 loadIntoTemp("DREAMWEB.S02"); // sprite name 3
loadIntoTemp2("DREAMWEB.G07"); // mon. graphics 2 loadIntoTemp2("DREAMWEB.G07"); // mon. graphics 2
} }
void DreamGenContext::showMenu() { void DreamBase::showMenu() {
++data.byte(kMenucount); ++data.byte(kMenucount);
if (data.byte(kMenucount) == 37*2) if (data.byte(kMenucount) == 37*2)
data.byte(kMenucount) = 0; data.byte(kMenucount) = 0;
showFrame(tempGraphics(), kMenux, kMenuy, data.byte(kMenucount) / 2, 0); showFrame(tempGraphics(), kMenux, kMenuy, data.byte(kMenucount) / 2, 0);
} }
void DreamGenContext::dumpMenu() { void DreamBase::dumpMenu() {
multiDump(kMenux, kMenuy, 48, 48); multiDump(kMenux, kMenuy, 48, 48);
} }
@ -3631,7 +3628,7 @@ void DreamGenContext::selectLocation() {
{ 104,124,4,44,&DreamGenContext::lastDest }, { 104,124,4,44,&DreamGenContext::lastDest },
{ 280,308,4,44,&DreamGenContext::lookAtPlace }, { 280,308,4,44,&DreamGenContext::lookAtPlace },
{ 104,216,138,192,&DreamGenContext::destSelect }, { 104,216,138,192,&DreamGenContext::destSelect },
{ 273,320,157,198,&DreamGenContext::getBack1 }, { 273,320,157,198,&DreamBase::getBack1 },
{ 0,320,0,200,&DreamBase::blank }, { 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 } { 0xFFFF,0,0,0,0 }
}; };
@ -3905,7 +3902,7 @@ void DreamGenContext::talk() {
workToScreenCPP(); workToScreenCPP();
RectWithCallback talkList[] = { RectWithCallback talkList[] = {
{ 273,320,157,198,&DreamGenContext::getBack1 }, { 273,320,157,198,&DreamBase::getBack1 },
{ 240,290,2,44,&DreamGenContext::moreTalk }, { 240,290,2,44,&DreamGenContext::moreTalk },
{ 0,320,0,200,&DreamBase::blank }, { 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 } { 0xFFFF,0,0,0,0 }
@ -3984,7 +3981,7 @@ void DreamGenContext::hangOnPQ() {
data.byte(kGetback) = 0; data.byte(kGetback) = 0;
RectWithCallback quitList[] = { RectWithCallback quitList[] = {
{ 273,320,157,198,&DreamGenContext::getBack1 }, { 273,320,157,198,&DreamBase::getBack1 },
{ 0,320,0,200,&DreamBase::blank }, { 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 } { 0xFFFF,0,0,0,0 }
}; };
@ -4068,7 +4065,7 @@ void DreamGenContext::showGun() {
getRidOfTempText(); getRidOfTempText();
} }
void DreamGenContext::diaryKeyP() { void DreamBase::diaryKeyP() {
if (data.byte(kCommandtype) != 214) { if (data.byte(kCommandtype) != 214) {
data.byte(kCommandtype) = 214; data.byte(kCommandtype) = 214;
commandOnly(23); commandOnly(23);
@ -4088,7 +4085,7 @@ void DreamGenContext::diaryKeyP() {
data.byte(kDiarypage) = 11; data.byte(kDiarypage) = 11;
} }
void DreamGenContext::diaryKeyN() { void DreamBase::diaryKeyN() {
if (data.byte(kCommandtype) != 213) { if (data.byte(kCommandtype) != 213) {
data.byte(kCommandtype) = 213; data.byte(kCommandtype) = 213;
commandOnly(23); commandOnly(23);

View File

@ -25,8 +25,6 @@
void screenUpdate(); void screenUpdate();
void startup(); void startup();
void startup1(); void startup1();
void switchRyanOn();
void switchRyanOff();
void saveLoad(); void saveLoad();
void hangOnCurs(uint16 frameCount); void hangOnCurs(uint16 frameCount);
void hangOnCurs(); void hangOnCurs();
@ -43,7 +41,6 @@
void multiDump(uint16 x, uint16 y, uint8 width, uint8 height) { void multiDump(uint16 x, uint16 y, uint8 width, uint8 height) {
DreamBase::multiDump(x, y, width, height); DreamBase::multiDump(x, y, width, height);
} }
void printSprites();
void quickQuit(); void quickQuit();
void readOneBlock(); void readOneBlock();
void readCityPic(); void readCityPic();
@ -60,7 +57,6 @@
} }
void useTimedText(); void useTimedText();
void dumpTimedText(); void dumpTimedText();
void setupTimedTemp(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount);
void getUnderTimed(); void getUnderTimed();
void putUnderTimed(); void putUnderTimed();
void dumpTextLine(); void dumpTextLine();
@ -72,29 +68,10 @@
void showFrame(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag) { void showFrame(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag) {
DreamBase::showFrame(frameData, x, y, frameNumber, effectsFlag); DreamBase::showFrame(frameData, x, y, frameNumber, effectsFlag);
} }
void printASprite(const Sprite *sprite);
void width160(); void width160();
void clearSprites();
Sprite *makeSprite(uint8 x, uint8 y, uint16 updateCallback, uint16 frameData, uint16 somethingInDi);
void spriteUpdate(); void spriteUpdate();
void initMan();
void mainMan(Sprite *sprite); void mainMan(Sprite *sprite);
void mainMan();
void walking(Sprite *sprite);
void aboutTurn(Sprite *sprite);
void backObject(Sprite *sprite);
void backObject();
void constant(Sprite *sprite, SetObject *objData);
void steady(Sprite *sprite, SetObject *objData);
void randomSprite(Sprite *sprite, SetObject *objData);
void doDoor(Sprite *sprite, SetObject *objData, Common::Rect check);
void doorway(Sprite *sprite, SetObject *objData);
void wideDoor(Sprite *sprite, SetObject *objData);
void lockedDoorway(Sprite *sprite, SetObject *objData);
void liftSprite(Sprite *sprite, SetObject *objData);
void showGameReel(ReelRoutine *routine);
void makeBackOb(SetObject *objData); void makeBackOb(SetObject *objData);
void dealWithSpecial(uint8 firstParam, uint8 secondParam);
void zoom(); void zoom();
void showRain(); void showRain();
void commandOnly(); void commandOnly();
@ -117,7 +94,6 @@
void madman(ReelRoutine &routine); void madman(ReelRoutine &routine);
void madmanText(); void madmanText();
void madMode(); void madMode();
void moveMap(uint8 param);
bool addAlong(const uint8 *mapFlags); bool addAlong(const uint8 *mapFlags);
bool addLength(const uint8 *mapFlags); bool addLength(const uint8 *mapFlags);
void getDimension(); void getDimension();
@ -150,7 +126,6 @@
void setAllChanges(); void setAllChanges();
void doChange(uint8 index, uint8 value, uint8 type); void doChange(uint8 index, uint8 value, uint8 type);
void deleteTaken(); void deleteTaken();
bool isCD();
void showAllFree(); void showAllFree();
void showAllEx(); void showAllEx();
bool finishedWalkingCPP(); bool finishedWalkingCPP();
@ -199,8 +174,6 @@
const uint8 *getObTextStartCPP(); const uint8 *getObTextStartCPP();
void useText(const uint8 *string); void useText(const uint8 *string);
void useText(); void useText();
void getBlockOfPixel();
uint8 getBlockOfPixel(uint8 x, uint8 y);
void examineObText(); void examineObText();
void showCity(); void showCity();
uint16 getPersFrame(uint8 index); uint16 getPersFrame(uint8 index);
@ -208,23 +181,14 @@
void examineOb(bool examineAgain = true); void examineOb(bool examineAgain = true);
void dumpWatch(); void dumpWatch();
void transferText(); void transferText();
void initRain();
Rain *splitIntoLines(uint8 x, uint8 y, Rain *rain);
void watchCount(); void watchCount();
void loadRoom(); void loadRoom();
void textForMonk();
void textForMonkHelper(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount);
void textForEnd();
void monks2text();
void intro1Text(); void intro1Text();
void intro2Text(); void intro2Text();
void intro3Text(); void intro3Text();
void readSetData(); void readSetData();
void fadeupYellows(); void fadeupYellows();
void fadeupMonFirst(); void fadeupMonFirst();
void loadMenu();
void showMenu();
void dumpMenu();
void useMenu(); void useMenu();
void useMon(); void useMon();
void makeCaps(); void makeCaps();
@ -247,7 +211,6 @@
void playChannel1(uint8 index) { void playChannel1(uint8 index) {
DreamBase::playChannel1(index); DreamBase::playChannel1(index);
} }
void findRoomInLoc();
void reelsOnScreen(); void reelsOnScreen();
void reconstruct(); void reconstruct();
void look(); void look();
@ -316,7 +279,6 @@
void nextFolder(); void nextFolder();
void lastFolder(); void lastFolder();
void drawFloor(); void drawFloor();
void allocateBuffers();
bool checkSpeed(ReelRoutine &routine); bool checkSpeed(ReelRoutine &routine);
void checkSpeed(); void checkSpeed();
void sparkyDrip(ReelRoutine &routine); void sparkyDrip(ReelRoutine &routine);
@ -450,10 +412,6 @@
void showLoadOps(); void showLoadOps();
void watchReel(); void watchReel();
void showWatchReel(); void showWatchReel();
void plotReel(uint16 &reelPointer);
void removeFreeObject(uint8 index) {
DreamBase::removeFreeObject(index);
}
void afterNewRoom(); void afterNewRoom();
void madmanRun(); void madmanRun();
void showDecisions(); void showDecisions();
@ -465,8 +423,6 @@
void hangOnPQ(); void hangOnPQ();
void showGun(); void showGun();
void endGame(); void endGame();
void diaryKeyP();
void diaryKeyN();
void checkInput(); void checkInput();
void dropError(); void dropError();
void cantDrop(); void cantDrop();

View File

@ -975,7 +975,7 @@ void DreamGenContext::useElvDoor() {
// Axe on door // Axe on door
showPuzText(15, 300); showPuzText(15, 300);
_inc(data.byte(kProgresspoints)); data.byte(kProgresspoints)++;
data.word(kWatchingtime) = 46 * 2; data.word(kWatchingtime) = 46 * 2;
data.word(kReeltowatch) = 31; data.word(kReeltowatch) = 31;
data.word(kEndwatchreel) = 77; data.word(kEndwatchreel) = 77;
@ -1288,10 +1288,10 @@ void DreamGenContext::useDiary() {
data.byte(kGetback) = 0; data.byte(kGetback) = 0;
RectWithCallback diaryList[] = { RectWithCallback diaryList[] = {
{ kDiaryx+94,kDiaryx+110,kDiaryy+97,kDiaryy+113,&DreamGenContext::diaryKeyN }, { kDiaryx+94,kDiaryx+110,kDiaryy+97,kDiaryy+113,&DreamBase::diaryKeyN },
{ kDiaryx+151,kDiaryx+167,kDiaryy+71,kDiaryy+87,&DreamGenContext::diaryKeyP }, { kDiaryx+151,kDiaryx+167,kDiaryy+71,kDiaryy+87,&DreamBase::diaryKeyP },
{ kDiaryx+176,kDiaryx+192,kDiaryy+108,kDiaryy+124,&DreamGenContext::quitKey }, { kDiaryx+176,kDiaryx+192,kDiaryy+108,kDiaryy+124,&DreamBase::quitKey },
{ 0,320,0,200,&DreamGenContext::blank }, { 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 } { 0xFFFF,0,0,0,0 }
}; };