diff options
author | Filippos Karapetis | 2011-12-16 10:54:31 -0800 |
---|---|---|
committer | Filippos Karapetis | 2011-12-16 10:54:31 -0800 |
commit | 70fd1b604342863778e2cac3e667f4ee2de42b82 (patch) | |
tree | 392e62f0464e7485e95f0c06deb5929b7168c698 /engines/dreamweb | |
parent | 86c3c8b4620f3841ba587790bdad9f262d1ed339 (diff) | |
parent | 1d09f7c12a79416349cb33a7de88792c85ada5c1 (diff) | |
download | scummvm-rg350-70fd1b604342863778e2cac3e667f4ee2de42b82.tar.gz scummvm-rg350-70fd1b604342863778e2cac3e667f4ee2de42b82.tar.bz2 scummvm-rg350-70fd1b604342863778e2cac3e667f4ee2de42b82.zip |
Merge pull request #144 from fingolfin/dreamweb-cleanup
Dreamweb cleanup
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/dreambase.h | 121 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 207 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 2 | ||||
-rw-r--r-- | engines/dreamweb/keypad.cpp | 2 | ||||
-rw-r--r-- | engines/dreamweb/pathfind.cpp | 30 | ||||
-rw-r--r-- | engines/dreamweb/people.cpp | 196 | ||||
-rw-r--r-- | engines/dreamweb/sprite.cpp | 84 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 123 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 131 | ||||
-rw-r--r-- | engines/dreamweb/use.cpp | 122 | ||||
-rw-r--r-- | engines/dreamweb/vgafades.cpp | 23 |
11 files changed, 418 insertions, 623 deletions
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h index 727a81ce8b..20cafcb203 100644 --- a/engines/dreamweb/dreambase.h +++ b/engines/dreamweb/dreambase.h @@ -119,15 +119,74 @@ public: void obPicture(); // from pathfind.cpp - void checkDest(const RoomPaths *roomsPaths); + void turnPathOn(uint8 param); + void turnPathOff(uint8 param); + void turnAnyPathOn(uint8 param, uint8 room); + void turnAnyPathOff(uint8 param, uint8 room); RoomPaths *getRoomsPaths(); void faceRightWay(); void setWalk(); void autoSetWalk(); + void checkDest(const RoomPaths *roomsPaths); void findXYFromPath(); + bool checkIfPathIsOn(uint8 index); void bresenhams(); void workoutFrames(); + // from people.cpp + void madmanText(); + void madman(ReelRoutine &routine); + void madMode(); + void addToPeopleList(ReelRoutine *routine); + bool checkSpeed(ReelRoutine &routine); + void sparkyDrip(ReelRoutine &routine); + void genericPerson(ReelRoutine &routine); + void gamer(ReelRoutine &routine); + void eden(ReelRoutine &routine); + void sparky(ReelRoutine &routine); + void rockstar(ReelRoutine &routine); + void madmansTelly(ReelRoutine &routine); + void smokeBloke(ReelRoutine &routine); + void manAsleep(ReelRoutine &routine); + void drunk(ReelRoutine &routine); + void introMagic1(ReelRoutine &routine); + void introMagic2(ReelRoutine &routine); + void introMagic3(ReelRoutine &routine); + void introMusic(ReelRoutine &routine); + void candles(ReelRoutine &routine); + void candles1(ReelRoutine &routine); + void candles2(ReelRoutine &routine); + void smallCandle(ReelRoutine &routine); + void gates(ReelRoutine &routine); + void security(ReelRoutine &routine); + void edenInBath(ReelRoutine &routine); + void louis(ReelRoutine &routine); + void handClap(ReelRoutine &routine); + void carParkDrip(ReelRoutine &routine); + void foghornSound(ReelRoutine &routine); + void train(ReelRoutine &routine); + void attendant(ReelRoutine &routine); + void keeper(ReelRoutine &routine); + void interviewer(ReelRoutine &routine); + void drinker(ReelRoutine &routine); + void alleyBarkSound(ReelRoutine &routine); + void louisChair(ReelRoutine &routine); + void bossMan(ReelRoutine &routine); + void priest(ReelRoutine &routine); + void monkAndRyan(ReelRoutine &routine); + void copper(ReelRoutine &routine); + void introMonks1(ReelRoutine &routine); + void introMonks2(ReelRoutine &routine); + void soldier1(ReelRoutine &routine); + void receptionist(ReelRoutine &routine); + void bartender(ReelRoutine &routine); + void heavy(ReelRoutine &routine); + void helicopter(ReelRoutine &routine); + //void mugger(ReelRoutine &routine); + void businessMan(ReelRoutine &routine); + void endGameSeq(ReelRoutine &routine); + void poolGuard(ReelRoutine &routine); + // from print.cpp uint8 getNextWord(const Frame *charSet, const uint8 *string, uint8 *totalWidth, uint8 *charCount); void printChar(const Frame* charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height); @@ -160,13 +219,45 @@ public: // from sprite.cpp 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); const Frame *findSource(uint16 &frame); void showReelFrame(Reel *reel); + void showGameReel(ReelRoutine *routine); const Frame *getReelFrameAX(uint16 frame); + void moveMap(uint8 param); + 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 intro1Text(); + void intro2Text(uint16 nextReelPointer); + void intro3Text(uint16 nextReelPointer); + 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 checkOne(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uint8 *type, uint8 *flagX, uint8 *flagY); void soundOnReels(uint16 reelPointer); void clearBeforeLoad(); void clearReels(); @@ -174,6 +265,7 @@ public: void liftNoise(uint8 index); // from stubs.cpp + bool isCD(); void crosshair(); void delTextLine(); void showBlink(); @@ -182,6 +274,8 @@ public: void showPointer(); void delPointer(); void showRyanPage(); + void switchRyanOn(); + void switchRyanOff(); Frame *tempGraphics(); Frame *tempGraphics2(); Frame *tempGraphics3(); @@ -210,6 +304,7 @@ public: void *getAnyAd(uint8 *value1, uint8 *value2); const uint8 *getTextInFile1(uint16 index); uint8 findNextColon(const uint8 **string); + void allocateBuffers(); uint16 allocateMem(uint16 paragraphs); void deallocateMem(uint16 segment); uint16 allocateAndLoad(unsigned int size); @@ -273,6 +368,26 @@ public: void getRidOfTempCharset(); void getRidOfTempsP(); void getRidOfAll(); + void placeSetObject(uint8 index); + void removeSetObject(uint8 index); + bool isSetObOnMap(uint8 index); + 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); + void getUnderTimed(); + void putUnderTimed(); + void dumpTextLine(); + void useTimedText(); + void dumpTimedText(); + void getTime(); + void doChange(uint8 index, uint8 value, uint8 type); // from use.cpp void placeFreeObject(uint8 index); @@ -297,6 +412,8 @@ public: void fadeScreenUpHalf(); void fadeScreenDown(); void fadeScreenDowns(); + void fadeScreenDownHalf(); + void clearPalette(); void greyscaleSum(); void allPalette(); void dumpCurrent(); diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 9106dc0425..ea731fcb21 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -285,36 +285,6 @@ void DreamGenContext::transferMap() { _add(data.word(kExframepos), cx); } -void DreamGenContext::fadeScreenDownHalf() { - STACK_CHECK; - palToStartPal(); - palToEndPal(); - cx = 768; - es = data.word(kBuffers); - bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); -halfend: - al = es.byte(bx); - _shr(al, 1); - es.byte(bx) = al; - _inc(bx); - if (--cx) - goto halfend; - ds = data.word(kBuffers); - es = data.word(kBuffers); - si = (0+(228*13)+32+60+(32*32)+(11*10*3))+(56*3); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(56*3); - cx = 3*5; - _movsb(cx, true); - si = (0+(228*13)+32+60+(32*32)+(11*10*3))+(77*3); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(77*3); - cx = 3*2; - _movsb(cx, true); - data.byte(kFadedirection) = 1; - data.byte(kFadecount) = 31; - data.byte(kColourpos) = 0; - data.byte(kNumtofade) = 32; -} - void DreamGenContext::rollEm() { STACK_CHECK; cl = 160; @@ -3026,183 +2996,6 @@ notfoundinside: goto insideloop; } -void DreamGenContext::useGun() { - STACK_CHECK; - _cmp(data.byte(kObjecttype), 4); - if (flags.z()) - goto istakengun; - showSecondUse(); - putBackObStuff(); - return; -istakengun: - _cmp(data.byte(kReallocation), 22); - if (!flags.z()) - goto notinpoolroom; - cx = 300; - al = 34; - showPuzText(); - data.byte(kLastweapon) = 1; - data.byte(kCombatcount) = 39; - data.byte(kGetback) = 1; - _inc(data.byte(kProgresspoints)); - return; -notinpoolroom: - _cmp(data.byte(kReallocation), 25); - if (!flags.z()) - goto nothelicopter; - cx = 300; - al = 34; - showPuzText(); - data.byte(kLastweapon) = 1; - data.byte(kCombatcount) = 19; - data.byte(kGetback) = 1; - data.byte(kDreamnumber) = 2; - data.byte(kRoomafterdream) = 38; - data.byte(kSartaindead) = 1; - _inc(data.byte(kProgresspoints)); - return; -nothelicopter: - _cmp(data.byte(kReallocation), 27); - if (!flags.z()) - goto notinrockroom; - cx = 300; - al = 46; - showPuzText(); - data.byte(kPointermode) = 2; - data.byte(kRockstardead) = 1; - data.byte(kLastweapon) = 1; - data.byte(kNewsitem) = 1; - data.byte(kGetback) = 1; - data.byte(kRoomafterdream) = 32; - data.byte(kDreamnumber) = 0; - _inc(data.byte(kProgresspoints)); - return; -notinrockroom: - _cmp(data.byte(kReallocation), 8); - if (!flags.z()) - goto notbystudio; - _cmp(data.byte(kMapx), 22); - if (!flags.z()) - goto notbystudio; - _cmp(data.byte(kMapy), 40); - if (!flags.z()) - goto notbystudio; - al = 92; - isSetObOnMap(); - if (flags.z()) - goto notbystudio; - _cmp(data.byte(kManspath), 9); - if (flags.z()) - goto notbystudio; - data.byte(kDestination) = 9; - data.byte(kFinaldest) = 9; - autoSetWalk(); - data.byte(kLastweapon) = 1; - data.byte(kGetback) = 1; - _inc(data.byte(kProgresspoints)); - return; -notbystudio: - _cmp(data.byte(kReallocation), 6); - if (!flags.z()) - goto notsarters; - _cmp(data.byte(kMapx), 11); - if (!flags.z()) - goto notsarters; - _cmp(data.byte(kMapy), 20); - if (!flags.z()) - goto notsarters; - al = 5; - isSetObOnMap(); - if (!flags.z()) - goto notsarters; - data.byte(kDestination) = 1; - data.byte(kFinaldest) = 1; - autoSetWalk(); - al = 5; - removeSetObject(); - al = 6; - placeSetObject(); - al = 1; - ah = data.byte(kRoomnum); - _dec(ah); - turnAnyPathOn(); - data.byte(kLiftflag) = 1; - data.word(kWatchingtime) = 40*2; - data.word(kReeltowatch) = 4; - data.word(kEndwatchreel) = 43; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; - _inc(data.byte(kProgresspoints)); - return; -notsarters: - _cmp(data.byte(kReallocation), 29); - if (!flags.z()) - goto notaide; - data.byte(kGetback) = 1; - al = 13; - resetLocation(); - al = 12; - setLocation(); - data.byte(kDestpos) = 12; - data.byte(kDestination) = 2; - data.byte(kFinaldest) = 2; - autoSetWalk(); - data.word(kWatchingtime) = 164*2; - data.word(kReeltowatch) = 3; - data.word(kEndwatchreel) = 164; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kAidedead) = 1; - data.byte(kDreamnumber) = 3; - data.byte(kRoomafterdream) = 33; - _inc(data.byte(kProgresspoints)); - return; -notaide: - _cmp(data.byte(kReallocation), 23); - if (!flags.z()) - goto notwithboss; - _cmp(data.byte(kMapx), 0); - if (!flags.z()) - goto notwithboss; - _cmp(data.byte(kMapy), 50); - if (!flags.z()) - goto notwithboss; - _cmp(data.byte(kManspath), 5); - if (flags.z()) - goto pathokboss; - data.byte(kDestination) = 5; - data.byte(kFinaldest) = 5; - autoSetWalk(); -pathokboss: - data.byte(kLastweapon) = 1; - data.byte(kGetback) = 1; - return; -notwithboss: - _cmp(data.byte(kReallocation), 8); - if (!flags.z()) - goto nottvsoldier; - _cmp(data.byte(kMapx), 11); - if (!flags.z()) - goto nottvsoldier; - _cmp(data.byte(kMapy), 10); - if (!flags.z()) - goto nottvsoldier; - _cmp(data.byte(kManspath), 2); - if (flags.z()) - goto pathoktv; - data.byte(kDestination) = 2; - data.byte(kFinaldest) = 2; - autoSetWalk(); -pathoktv: - data.byte(kLastweapon) = 1; - data.byte(kGetback) = 1; - return; -nottvsoldier: - showFirstUse(); - putBackObStuff(); -} - void DreamGenContext::showDiaryKeys() { STACK_CHECK; _cmp(data.byte(kPresscount), 0); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 945e8ad10f..f22461ef0f 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -487,7 +487,6 @@ public: void doSomeTalk(); void resetLocation(); void adjustUp(); - void fadeScreenDownHalf(); void outOfOpen(); void dirCom(); void findFirstPath(); @@ -539,7 +538,6 @@ public: void read(); void searchForString(); void selectOpenOb(); - void useGun(); void incRyanPage(); void clearChanges(); void searchForFiles(); diff --git a/engines/dreamweb/keypad.cpp b/engines/dreamweb/keypad.cpp index 032f01873e..43f6749cad 100644 --- a/engines/dreamweb/keypad.cpp +++ b/engines/dreamweb/keypad.cpp @@ -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+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 }, + { 0,320,0,200,&DreamBase::blank }, { 0xFFFF,0,0,0,0 } }; diff --git a/engines/dreamweb/pathfind.cpp b/engines/dreamweb/pathfind.cpp index 212d61e6e2..8d9d9a95bb 100644 --- a/engines/dreamweb/pathfind.cpp +++ b/engines/dreamweb/pathfind.cpp @@ -24,11 +24,7 @@ namespace DreamGen { -void DreamGenContext::turnPathOn() { - turnPathOn(al); -} - -void DreamGenContext::turnPathOn(uint8 param) { +void DreamBase::turnPathOn(uint8 param) { findOrMake(param, 0xff, data.byte(kRoomnum) + 100); PathNode *roomsPaths = getRoomsPaths()->nodes; if (param == 0xff) @@ -36,11 +32,7 @@ void DreamGenContext::turnPathOn(uint8 param) { roomsPaths[param].on = 0xff; } -void DreamGenContext::turnPathOff() { - turnPathOff(al); -} - -void DreamGenContext::turnPathOff(uint8 param) { +void DreamBase::turnPathOff(uint8 param) { findOrMake(param, 0x00, data.byte(kRoomnum) + 100); PathNode *roomsPaths = getRoomsPaths()->nodes; if (param == 0xff) @@ -48,26 +40,18 @@ void DreamGenContext::turnPathOff(uint8 param) { roomsPaths[param].on = 0x00; } -void DreamGenContext::turnAnyPathOn(uint8 param, uint8 room) { +void DreamBase::turnAnyPathOn(uint8 param, uint8 room) { findOrMake(param, 0xff, room + 100); PathNode *paths = (PathNode *)getSegment(data.word(kReels)).ptr(kPathdata + 144 * room, 0); paths[param].on = 0xff; } -void DreamGenContext::turnAnyPathOn() { - turnAnyPathOn(al, ah); -} - -void DreamGenContext::turnAnyPathOff(uint8 param, uint8 room) { +void DreamBase::turnAnyPathOff(uint8 param, uint8 room) { findOrMake(param, 0x00, room + 100); PathNode *paths = (PathNode *)getSegment(data.word(kReels)).ptr(kPathdata + 144 * room, 0); paths[param].on = 0x00; } -void DreamGenContext::turnAnyPathOff() { - turnAnyPathOff(al, ah); -} - RoomPaths *DreamBase::getRoomsPaths() { void *result = getSegment(data.word(kReels)).ptr(data.byte(kRoomnum) * 144, 144); return (RoomPaths *)result; @@ -150,11 +134,7 @@ void DreamBase::findXYFromPath() { data.byte(kRyany) = roomsPaths[data.byte(kManspath)].y - 12; } -void DreamGenContext::checkIfPathIsOn() { - flags._z = checkIfPathIsOn(al); -} - -bool DreamGenContext::checkIfPathIsOn(uint8 index) { +bool DreamBase::checkIfPathIsOn(uint8 index) { RoomPaths *roomsPaths = getRoomsPaths(); uint8 pathOn = roomsPaths->nodes[index].on; return pathOn == 0xff; diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp index aeb0b5db22..887a4452ad 100644 --- a/engines/dreamweb/people.cpp +++ b/engines/dreamweb/people.cpp @@ -25,35 +25,35 @@ namespace DreamGen { static void (DreamGenContext::*reelCallbacks[57])(ReelRoutine &) = { - &DreamGenContext::gamer, &DreamGenContext::sparkyDrip, - &DreamGenContext::eden, &DreamGenContext::edenInBath, - &DreamGenContext::sparky, &DreamGenContext::smokeBloke, - &DreamGenContext::manAsleep, &DreamGenContext::drunk, - &DreamGenContext::receptionist, &DreamGenContext::genericPerson /*maleFan*/, - &DreamGenContext::genericPerson /*femaleFan*/, &DreamGenContext::louis, - &DreamGenContext::louisChair, &DreamGenContext::soldier1, - &DreamGenContext::bossMan, &DreamGenContext::interviewer, - &DreamGenContext::heavy, &DreamGenContext::manAsleep /*manAsleep2*/, - &DreamGenContext::genericPerson /*manSatStill*/, &DreamGenContext::drinker, - &DreamGenContext::bartender, &DreamGenContext::genericPerson /*otherSmoker*/, - &DreamGenContext::genericPerson /*tattooMan*/, &DreamGenContext::attendant, - &DreamGenContext::keeper, &DreamGenContext::candles1, - &DreamGenContext::smallCandle, &DreamGenContext::security, - &DreamGenContext::copper, &DreamGenContext::poolGuard, - &DreamGenContext::rockstar, &DreamGenContext::businessMan, - &DreamGenContext::train, &DreamGenContext::genericPerson /*aide*/, - &DreamGenContext::mugger, &DreamGenContext::helicopter, - &DreamGenContext::introMagic1, &DreamGenContext::introMusic, - &DreamGenContext::introMagic2, &DreamGenContext::candles2, - &DreamGenContext::gates, &DreamGenContext::introMagic3, - &DreamGenContext::introMonks1, &DreamGenContext::candles, - &DreamGenContext::introMonks2, &DreamGenContext::handClap, - &DreamGenContext::monkAndRyan, &DreamGenContext::endGameSeq, - &DreamGenContext::priest, &DreamGenContext::madman, - &DreamGenContext::madmansTelly, &DreamGenContext::alleyBarkSound, - &DreamGenContext::foghornSound, &DreamGenContext::carParkDrip, - &DreamGenContext::carParkDrip, &DreamGenContext::carParkDrip, - &DreamGenContext::carParkDrip + &DreamBase::gamer, &DreamBase::sparkyDrip, + &DreamBase::eden, &DreamBase::edenInBath, + &DreamBase::sparky, &DreamBase::smokeBloke, + &DreamBase::manAsleep, &DreamBase::drunk, + &DreamBase::receptionist, &DreamBase::genericPerson /*maleFan*/, + &DreamBase::genericPerson /*femaleFan*/, &DreamBase::louis, + &DreamBase::louisChair, &DreamBase::soldier1, + &DreamBase::bossMan, &DreamBase::interviewer, + &DreamBase::heavy, &DreamBase::manAsleep /*manAsleep2*/, + &DreamBase::genericPerson /*manSatStill*/, &DreamBase::drinker, + &DreamBase::bartender, &DreamBase::genericPerson /*otherSmoker*/, + &DreamBase::genericPerson /*tattooMan*/, &DreamBase::attendant, + &DreamBase::keeper, &DreamBase::candles1, + &DreamBase::smallCandle, &DreamBase::security, + &DreamBase::copper, &DreamBase::poolGuard, + &DreamBase::rockstar, &DreamBase::businessMan, + &DreamBase::train, &DreamBase::genericPerson /*aide*/, + &DreamGenContext::mugger, &DreamBase::helicopter, + &DreamBase::introMagic1, &DreamBase::introMusic, + &DreamBase::introMagic2, &DreamBase::candles2, + &DreamBase::gates, &DreamBase::introMagic3, + &DreamBase::introMonks1, &DreamBase::candles, + &DreamBase::introMonks2, &DreamBase::handClap, + &DreamBase::monkAndRyan, &DreamGenContext::endGameSeq, + &DreamBase::priest, &DreamBase::madman, + &DreamBase::madmansTelly, &DreamBase::alleyBarkSound, + &DreamBase::foghornSound, &DreamBase::carParkDrip, + &DreamBase::carParkDrip, &DreamBase::carParkDrip, + &DreamBase::carParkDrip }; void DreamGenContext::updatePeople() { @@ -74,7 +74,7 @@ void DreamGenContext::updatePeople() { } } -void DreamGenContext::madmanText() { +void DreamBase::madmanText() { byte origCount; if (isCD()) { @@ -94,7 +94,7 @@ void DreamGenContext::madmanText() { setupTimedTemp(47 + origCount, 82, 72, 80, 90, 1); } -void DreamGenContext::madman(ReelRoutine &routine) { +void DreamBase::madman(ReelRoutine &routine) { data.word(kWatchingtime) = 2; if (checkSpeed(routine)) { uint16 newReelPointer = routine.reelPointer(); @@ -140,7 +140,7 @@ void DreamGenContext::madman(ReelRoutine &routine) { madMode(); } -void DreamGenContext::madMode() { +void DreamBase::madMode() { data.word(kWatchingtime) = 2; data.byte(kPointermode) = 0; if (data.byte(kCombatcount) < (isCD() ? 65 : 63)) @@ -150,7 +150,7 @@ void DreamGenContext::madMode() { data.byte(kPointermode) = 2; } -void DreamGenContext::addToPeopleList(ReelRoutine *routine) { +void DreamBase::addToPeopleList(ReelRoutine *routine) { uint16 routinePointer = (const uint8 *)routine - data.ptr(0, 0); People *people = (People *)getSegment(data.word(kBuffers)).ptr(data.word(kListpos), sizeof(People)); @@ -160,12 +160,7 @@ void DreamGenContext::addToPeopleList(ReelRoutine *routine) { data.word(kListpos) += sizeof(People); } -void DreamGenContext::checkSpeed() { - ReelRoutine *routine = (ReelRoutine *)es.ptr(bx, sizeof(ReelRoutine)); - flags._z = checkSpeed(*routine); -} - -bool DreamGenContext::checkSpeed(ReelRoutine &routine) { +bool DreamBase::checkSpeed(ReelRoutine &routine) { if (data.byte(kLastweapon) != (uint8)-1) return true; ++routine.counter; @@ -175,17 +170,17 @@ bool DreamGenContext::checkSpeed(ReelRoutine &routine) { return true; } -void DreamGenContext::sparkyDrip(ReelRoutine &routine) { +void DreamBase::sparkyDrip(ReelRoutine &routine) { if (checkSpeed(routine)) playChannel0(14, 0); } -void DreamGenContext::genericPerson(ReelRoutine &routine) { +void DreamBase::genericPerson(ReelRoutine &routine) { showGameReel(&routine); addToPeopleList(&routine); } -void DreamGenContext::gamer(ReelRoutine &routine) { +void DreamBase::gamer(ReelRoutine &routine) { if (checkSpeed(routine)) { uint8 v; do { @@ -198,14 +193,14 @@ void DreamGenContext::gamer(ReelRoutine &routine) { addToPeopleList(&routine); } -void DreamGenContext::eden(ReelRoutine &routine) { +void DreamBase::eden(ReelRoutine &routine) { if (data.byte(kGeneraldead)) return; showGameReel(&routine); addToPeopleList(&routine); } -void DreamGenContext::sparky(ReelRoutine &routine) { +void DreamBase::sparky(ReelRoutine &routine) { if (data.word(kCard1money)) routine.b7 = 3; if (checkSpeed(routine)) { @@ -227,7 +222,7 @@ void DreamGenContext::sparky(ReelRoutine &routine) { data.byte(kTalkedtosparky) = 1; } -void DreamGenContext::rockstar(ReelRoutine &routine) { +void DreamBase::rockstar(ReelRoutine &routine) { if ((routine.reelPointer() == 303) || (routine.reelPointer() == 118)) { data.byte(kNewlocation) = 45; showGameReel(&routine); @@ -264,7 +259,7 @@ void DreamGenContext::rockstar(ReelRoutine &routine) { } } -void DreamGenContext::madmansTelly(ReelRoutine &routine) { +void DreamBase::madmansTelly(ReelRoutine &routine) { uint16 nextReelPointer = routine.reelPointer() + 1; if (nextReelPointer == 307) nextReelPointer = 300; @@ -273,7 +268,7 @@ void DreamGenContext::madmansTelly(ReelRoutine &routine) { } -void DreamGenContext::smokeBloke(ReelRoutine &routine) { +void DreamBase::smokeBloke(ReelRoutine &routine) { if (data.byte(kRockstardead) == 0) { if (routine.b7 & 128) DreamBase::setLocation(5); @@ -293,20 +288,20 @@ void DreamGenContext::smokeBloke(ReelRoutine &routine) { addToPeopleList(&routine); } -void DreamGenContext::manAsleep(ReelRoutine &routine) { +void DreamBase::manAsleep(ReelRoutine &routine) { routine.b7 &= 127; showGameReel(&routine); addToPeopleList(&routine); } -void DreamGenContext::attendant(ReelRoutine &routine) { +void DreamBase::attendant(ReelRoutine &routine) { showGameReel(&routine); addToPeopleList(&routine); if (routine.b7 & 128) data.byte(kTalkedtoattendant) = 1; } -void DreamGenContext::keeper(ReelRoutine &routine) { +void DreamBase::keeper(ReelRoutine &routine) { if (data.byte(kKeeperflag) != 0) { // Not waiting addToPeopleList(&routine); @@ -323,7 +318,7 @@ void DreamGenContext::keeper(ReelRoutine &routine) { routine.b7 = data.byte(kDreamnumber); } -void DreamGenContext::drunk(ReelRoutine &routine) { +void DreamBase::drunk(ReelRoutine &routine) { if (data.byte(kGeneraldead)) return; routine.b7 &= 127; @@ -331,7 +326,7 @@ void DreamGenContext::drunk(ReelRoutine &routine) { addToPeopleList(&routine); } -void DreamGenContext::interviewer(ReelRoutine &routine) { +void DreamBase::interviewer(ReelRoutine &routine) { if (data.word(kReeltowatch) == 68) routine.incReelPointer(); @@ -341,7 +336,7 @@ void DreamGenContext::interviewer(ReelRoutine &routine) { showGameReel(&routine); } -void DreamGenContext::drinker(ReelRoutine &routine) { +void DreamBase::drinker(ReelRoutine &routine) { if (checkSpeed(routine)) { routine.incReelPointer(); @@ -354,7 +349,7 @@ void DreamGenContext::drinker(ReelRoutine &routine) { addToPeopleList(&routine); } -void DreamGenContext::alleyBarkSound(ReelRoutine &routine) { +void DreamBase::alleyBarkSound(ReelRoutine &routine) { uint16 prevReelPointer = routine.reelPointer() - 1; if (prevReelPointer == 0) { playChannel1(14); @@ -364,7 +359,7 @@ void DreamGenContext::alleyBarkSound(ReelRoutine &routine) { } } -void DreamGenContext::introMagic1(ReelRoutine &routine) { +void DreamBase::introMagic1(ReelRoutine &routine) { if (checkSpeed(routine)) { uint16 nextReelPointer = routine.reelPointer() + 1; if (nextReelPointer == 145) @@ -372,11 +367,7 @@ void DreamGenContext::introMagic1(ReelRoutine &routine) { routine.setReelPointer(nextReelPointer); if (nextReelPointer == 121) { ++data.byte(kIntrocount); - push(es); - push(bx); intro1Text(); - bx = pop(); - es = pop(); if (data.byte(kIntrocount) == 8) { data.byte(kMapy) += 10; data.byte(kNowinnewroom) = 1; @@ -386,7 +377,7 @@ void DreamGenContext::introMagic1(ReelRoutine &routine) { showGameReel(&routine); } -void DreamGenContext::introMagic2(ReelRoutine &routine) { +void DreamBase::introMagic2(ReelRoutine &routine) { if (checkSpeed(routine)) { uint16 nextReelPointer = routine.reelPointer() + 1; if (nextReelPointer == 216) @@ -396,7 +387,7 @@ void DreamGenContext::introMagic2(ReelRoutine &routine) { showGameReel(&routine); } -void DreamGenContext::introMagic3(ReelRoutine &routine) { +void DreamBase::introMagic3(ReelRoutine &routine) { if (checkSpeed(routine)) { uint16 nextReelPointer = routine.reelPointer() + 1; if (nextReelPointer == 218) @@ -407,7 +398,7 @@ void DreamGenContext::introMagic3(ReelRoutine &routine) { routine.mapX = data.byte(kMapx); } -void DreamGenContext::candles1(ReelRoutine &routine) { +void DreamBase::candles1(ReelRoutine &routine) { if (checkSpeed(routine)) { uint16 nextReelPointer = routine.reelPointer() + 1; if (nextReelPointer == 44) @@ -417,7 +408,7 @@ void DreamGenContext::candles1(ReelRoutine &routine) { showGameReel(&routine); } -void DreamGenContext::candles2(ReelRoutine &routine) { +void DreamBase::candles2(ReelRoutine &routine) { if (checkSpeed(routine)) { uint16 nextReelPointer = routine.reelPointer() + 1; if (nextReelPointer == 238) @@ -427,7 +418,7 @@ void DreamGenContext::candles2(ReelRoutine &routine) { showGameReel(&routine); } -void DreamGenContext::smallCandle(ReelRoutine &routine) { +void DreamBase::smallCandle(ReelRoutine &routine) { if (checkSpeed(routine)) { uint16 nextReelPointer = routine.reelPointer() + 1; if (nextReelPointer == 37) @@ -437,10 +428,10 @@ void DreamGenContext::smallCandle(ReelRoutine &routine) { showGameReel(&routine); } -void DreamGenContext::introMusic(ReelRoutine &routine) { +void DreamBase::introMusic(ReelRoutine &routine) { } -void DreamGenContext::candles(ReelRoutine &routine) { +void DreamBase::candles(ReelRoutine &routine) { if (checkSpeed(routine)) { uint16 nextReelPointer = routine.reelPointer() + 1; if (nextReelPointer == 167) @@ -450,7 +441,7 @@ void DreamGenContext::candles(ReelRoutine &routine) { showGameReel(&routine); } -void DreamGenContext::gates(ReelRoutine &routine) { +void DreamBase::gates(ReelRoutine &routine) { if (checkSpeed(routine)) { uint16 nextReelPointer = routine.reelPointer() + 1; if (nextReelPointer == 116) @@ -462,17 +453,12 @@ void DreamGenContext::gates(ReelRoutine &routine) { nextReelPointer = 119; } routine.setReelPointer(nextReelPointer); - push(es); - push(bx); - ax = nextReelPointer; - intro3Text(); - bx = pop(); - es = pop(); + intro3Text(nextReelPointer); } showGameReel(&routine); } -void DreamGenContext::security(ReelRoutine &routine) { +void DreamBase::security(ReelRoutine &routine) { if (routine.reelPointer() == 32) { if (data.byte(kLastweapon) == 1) { data.word(kWatchingtime) = 10; @@ -492,7 +478,7 @@ void DreamGenContext::security(ReelRoutine &routine) { addToPeopleList(&routine); } -void DreamGenContext::edenInBath(ReelRoutine &routine) { +void DreamBase::edenInBath(ReelRoutine &routine) { if (data.byte(kGeneraldead) == 0 || data.byte(kSartaindead) != 0) return; @@ -500,7 +486,7 @@ void DreamGenContext::edenInBath(ReelRoutine &routine) { addToPeopleList(&routine); } -void DreamGenContext::louis(ReelRoutine &routine) { +void DreamBase::louis(ReelRoutine &routine) { if (data.byte(kRockstardead) != 0) return; @@ -508,26 +494,26 @@ void DreamGenContext::louis(ReelRoutine &routine) { addToPeopleList(&routine); } -void DreamGenContext::handClap(ReelRoutine &routine) { +void DreamBase::handClap(ReelRoutine &routine) { } -void DreamGenContext::carParkDrip(ReelRoutine &routine) { +void DreamBase::carParkDrip(ReelRoutine &routine) { if (!checkSpeed(routine)) return; // cantdrip2 playChannel1(14); } -void DreamGenContext::foghornSound(ReelRoutine &routine) { +void DreamBase::foghornSound(ReelRoutine &routine) { if (engine->randomNumber() == 198) playChannel1(13); } -void DreamGenContext::train(ReelRoutine &routine) { +void DreamBase::train(ReelRoutine &routine) { // The original code has logic for this, but it is disabled } -void DreamGenContext::louisChair(ReelRoutine &routine) { +void DreamBase::louisChair(ReelRoutine &routine) { if (data.byte(kRockstardead) == 0) return; // notlouis2 @@ -549,7 +535,7 @@ void DreamGenContext::louisChair(ReelRoutine &routine) { addToPeopleList(&routine); } -void DreamGenContext::bossMan(ReelRoutine &routine) { +void DreamBase::bossMan(ReelRoutine &routine) { if (checkSpeed(routine)) { uint16 nextReelPointer = routine.reelPointer() + 1; @@ -575,7 +561,7 @@ void DreamGenContext::bossMan(ReelRoutine &routine) { data.byte(kTalkedtoboss) = 1; } -void DreamGenContext::priest(ReelRoutine &routine) { +void DreamBase::priest(ReelRoutine &routine) { if (routine.reelPointer() == 8) return; // priestspoken @@ -596,7 +582,7 @@ void DreamBase::priestText(ReelRoutine &routine) { setupTimedUse((reel >> 1) + 50, 54, 1, 72, 80); } -void DreamGenContext::monkAndRyan(ReelRoutine &routine) { +void DreamBase::monkAndRyan(ReelRoutine &routine) { if (checkSpeed(routine)) { uint16 nextReelPointer = routine.reelPointer() + 1; if (nextReelPointer == 83) { @@ -616,7 +602,7 @@ void DreamGenContext::monkAndRyan(ReelRoutine &routine) { showGameReel(&routine); } -void DreamGenContext::copper(ReelRoutine &routine) { +void DreamBase::copper(ReelRoutine &routine) { if (checkSpeed(routine)) { uint16 nextReelPointer = routine.reelPointer() + 1; if (nextReelPointer == 94) { @@ -634,7 +620,7 @@ void DreamGenContext::copper(ReelRoutine &routine) { addToPeopleList(&routine); } -void DreamGenContext::introMonks1(ReelRoutine &routine) { +void DreamBase::introMonks1(ReelRoutine &routine) { if (checkSpeed(routine)) { uint16 nextReelPointer = routine.reelPointer() + 1; @@ -655,11 +641,7 @@ void DreamGenContext::introMonks1(ReelRoutine &routine) { nextReelPointer == 25 || nextReelPointer == 61 || nextReelPointer == 71) { // Wait step - push(es); - push(bx); - intro2Text(); - bx = pop(); - es = pop(); + intro2Text(nextReelPointer); routine.counter = (uint8)-20; } } @@ -668,16 +650,12 @@ void DreamGenContext::introMonks1(ReelRoutine &routine) { routine.mapY = data.byte(kMapy); } -void DreamGenContext::introMonks2(ReelRoutine &routine) { +void DreamBase::introMonks2(ReelRoutine &routine) { if (checkSpeed(routine)) { uint16 nextReelPointer = routine.reelPointer() + 1; if (nextReelPointer == 87) { data.byte(kIntrocount)++; - push(es); - push(bx); monks2text(); - bx = pop(); - es = pop(); if (data.byte(kIntrocount), 19) nextReelPointer = 87; @@ -687,11 +665,7 @@ void DreamGenContext::introMonks2(ReelRoutine &routine) { if (nextReelPointer == 110) { data.byte(kIntrocount)++; - push(es); - push(bx); monks2text(); - bx = pop(); - es = pop(); if (data.byte(kIntrocount) == 35) nextReelPointer = 111; @@ -709,7 +683,7 @@ void DreamGenContext::introMonks2(ReelRoutine &routine) { showGameReel(&routine); } -void DreamGenContext::soldier1(ReelRoutine &routine) { +void DreamBase::soldier1(ReelRoutine &routine) { if (routine.reelPointer() != 0) { data.word(kWatchingtime) = 10; if (routine.reelPointer() == 30) { @@ -732,7 +706,7 @@ void DreamGenContext::soldier1(ReelRoutine &routine) { addToPeopleList(&routine); } -void DreamGenContext::receptionist(ReelRoutine &routine) { +void DreamBase::receptionist(ReelRoutine &routine) { if (checkSpeed(routine)) { if (data.byte(kCardpassflag) == 1) { // Set card @@ -769,7 +743,7 @@ void DreamGenContext::receptionist(ReelRoutine &routine) { data.byte(kTalkedtorecep) = 1; } -void DreamGenContext::bartender(ReelRoutine &routine) { +void DreamBase::bartender(ReelRoutine &routine) { if (checkSpeed(routine)) { if (routine.reelPointer() == 86) { if (engine->randomNumber() >= 18) @@ -790,7 +764,7 @@ void DreamGenContext::bartender(ReelRoutine &routine) { addToPeopleList(&routine); } -void DreamGenContext::heavy(ReelRoutine &routine) { +void DreamBase::heavy(ReelRoutine &routine) { routine.b7 &= 127; if (routine.reelPointer() != 43) { data.word(kWatchingtime) = 10; @@ -814,7 +788,7 @@ void DreamGenContext::heavy(ReelRoutine &routine) { addToPeopleList(&routine); } -void DreamGenContext::helicopter(ReelRoutine &routine) { +void DreamBase::helicopter(ReelRoutine &routine) { if (routine.reelPointer() == 203) { // Won helicopter data.byte(kPointermode) = 0; @@ -899,7 +873,7 @@ void DreamGenContext::mugger(ReelRoutine &routine) { } } -void DreamGenContext::businessMan(ReelRoutine &routine) { +void DreamBase::businessMan(ReelRoutine &routine) { data.byte(kPointermode) = 0; data.word(kWatchingtime) = 2; if (routine.reelPointer() == 2) { @@ -963,7 +937,7 @@ void DreamGenContext::businessMan(ReelRoutine &routine) { } } -void DreamGenContext::endGameSeq(ReelRoutine &routine) { +void DreamBase::endGameSeq(ReelRoutine &routine) { if (checkSpeed(routine)) { uint16 nextReelPointer = routine.reelPointer() + 1; if (nextReelPointer == 51 && data.byte(kIntrocount) != 140) { @@ -974,13 +948,7 @@ void DreamGenContext::endGameSeq(ReelRoutine &routine) { routine.setReelPointer(nextReelPointer); if (nextReelPointer == 134) { - push(es); - push(bx); - push(ax); fadeScreenDownHalf(); - ax = pop(); - bx = pop(); - es = pop(); } else if (nextReelPointer == 324) { fadeScreenDowns(); data.byte(kVolumeto) = 7; @@ -1000,7 +968,7 @@ void DreamGenContext::endGameSeq(ReelRoutine &routine) { } } -void DreamGenContext::poolGuard(ReelRoutine &routine) { +void DreamBase::poolGuard(ReelRoutine &routine) { if (routine.reelPointer() == 214 || routine.reelPointer() == 258) { // Combat over 2 showGameReel(&routine); diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp index d82d0f19fc..cfa204ec23 100644 --- a/engines/dreamweb/sprite.cpp +++ b/engines/dreamweb/sprite.cpp @@ -29,7 +29,7 @@ Sprite *DreamBase::spriteTable() { return sprite; } -void DreamGenContext::printSprites() { +void DreamBase::printSprites() { for (size_t priority = 0; priority < 7; ++priority) { Sprite *sprites = spriteTable(); 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; if (sprite->y >= 220) { 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); } -void DreamGenContext::clearSprites() { +void DreamBase::clearSprites() { 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(); while (sprite->frameNumber != 0xff) { // NB: No boundchecking in the original code either ++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->priority = 4; sprite->speed = 0; sprite->walkFrame = 0; } -void DreamGenContext::mainMan() { - assert(false); -} - void DreamGenContext::mainMan(Sprite *sprite) { push(es); push(ds); @@ -186,7 +182,7 @@ void DreamGenContext::mainMan(Sprite *sprite) { es = pop(); } -void DreamGenContext::walking(Sprite *sprite) { +void DreamBase::walking(Sprite *sprite) { uint8 comp; if (data.byte(kLinedirection) != 0) { --data.byte(kLinepointer); @@ -208,14 +204,10 @@ void DreamGenContext::walking(Sprite *sprite) { return; } data.byte(kDestination) = data.byte(kFinaldest); - push(es); - push(bx); autoSetWalk(); - bx = pop(); - es = pop(); } -void DreamGenContext::aboutTurn(Sprite *sprite) { +void DreamBase::aboutTurn(Sprite *sprite) { bool incdir = true; if (data.byte(kTurndirection) == 1) @@ -249,11 +241,7 @@ void DreamGenContext::aboutTurn(Sprite *sprite) { } } -void DreamGenContext::backObject() { - assert(false); -} - -void DreamGenContext::backObject(Sprite *sprite) { +void DreamBase::backObject(Sprite *sprite) { SetObject *objData = (SetObject *)getSegment(data.word(kSetdat)).ptr(sprite->objData(), 0); if (sprite->delay != 0) { @@ -278,7 +266,7 @@ void DreamGenContext::backObject(Sprite *sprite) { steady(sprite, objData); } -void DreamGenContext::constant(Sprite *sprite, SetObject *objData) { +void DreamBase::constant(Sprite *sprite, SetObject *objData) { ++sprite->animFrame; if (objData->frames[sprite->animFrame] == 255) { sprite->animFrame = 0; @@ -288,22 +276,22 @@ void DreamGenContext::constant(Sprite *sprite, SetObject *objData) { sprite->frameNumber = frame; } -void DreamGenContext::randomSprite(Sprite *sprite, SetObject *objData) { +void DreamBase::randomSprite(Sprite *sprite, SetObject *objData) { uint8 r = engine->randomNumber(); 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); 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); 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 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]; objData->index = frame; sprite->frameNumber = frame; } -void DreamGenContext::lockedDoorway(Sprite *sprite, SetObject *objData) { +void DreamBase::lockedDoorway(Sprite *sprite, SetObject *objData) { int ryanx = data.byte(kRyanx); 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); if (liftFlag == 0) { //liftclosed turnPathOff(data.byte(kLiftpath)); if (data.byte(kCounttoopen) != 0) { - _dec(data.byte(kCounttoopen)); + data.byte(kCounttoopen)--; if (data.byte(kCounttoopen) == 0) data.byte(kLiftflag) = 3; } @@ -426,7 +414,7 @@ void DreamGenContext::liftSprite(Sprite *sprite, SetObject *objData) { turnPathOn(data.byte(kLiftpath)); if (data.byte(kCounttoclose) != 0) { - _dec(data.byte(kCounttoclose)); + data.byte(kCounttoclose)--; if (data.byte(kCounttoclose) == 0) data.byte(kLiftflag) = 2; } @@ -486,7 +474,7 @@ void DreamBase::showReelFrame(Reel *reel) { showFrame(base, x, y, frame, 8); } -void DreamGenContext::showGameReel(ReelRoutine *routine) { +void DreamBase::showGameReel(ReelRoutine *routine) { uint16 reelPointer = routine->reelPointer(); if (reelPointer >= 512) return; @@ -545,7 +533,7 @@ void DreamGenContext::showRain() { playChannel1(soundIndex); } -void DreamGenContext::moveMap(uint8 param) { +void DreamBase::moveMap(uint8 param) { switch (param) { case 32: data.byte(kMapy) -= 20; @@ -586,11 +574,7 @@ void DreamBase::checkOne(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uint8 *ty *type = tileData[2]; } -void DreamGenContext::getBlockOfPixel() { - al = getBlockOfPixel(cl, ch); -} - -uint8 DreamGenContext::getBlockOfPixel(uint8 x, uint8 y) { +uint8 DreamBase::getBlockOfPixel(uint8 x, uint8 y) { uint8 flag, flagEx, type, flagX, flagY; checkOne(x + data.word(kMapxstart), y + data.word(kMapystart), &flag, &flagEx, &type, &flagX, &flagY); if (flag & 1) @@ -599,7 +583,7 @@ uint8 DreamGenContext::getBlockOfPixel(uint8 x, uint8 y) { return type; } -Rain *DreamGenContext::splitIntoLines(uint8 x, uint8 y, Rain *rain) { +Rain *DreamBase::splitIntoLines(uint8 x, uint8 y, Rain *rain) { do { // Look for line start while (!getBlockOfPixel(x, y)) { @@ -670,7 +654,7 @@ static const RainLocation rainLocationList[] = { { 255,0,0,0 } }; -void DreamGenContext::initRain() { +void DreamBase::initRain() { const RainLocation *r = rainLocationList; Rain *rainList = (Rain *)getSegment(data.word(kBuffers)).ptr(kRainlist, 0); Rain *rain = rainList; @@ -725,7 +709,7 @@ void DreamGenContext::initRain() { rain->x = 0xff; } -void DreamGenContext::intro1Text() { +void DreamBase::intro1Text() { if (data.byte(kIntrocount) != 2 && data.byte(kIntrocount) != 4 && data.byte(kIntrocount) != 6) return; @@ -741,17 +725,17 @@ void DreamGenContext::intro1Text() { } } -void DreamGenContext::intro2Text() { - if (ax == 5) +void DreamBase::intro2Text(uint16 nextReelPointer) { + if (nextReelPointer == 5) setupTimedTemp(43, 82, 34, 40, 90, 1); - else if (ax == 15) + else if (nextReelPointer == 15) setupTimedTemp(44, 82, 34, 40, 90, 1); } -void DreamGenContext::intro3Text() { - if (ax == 107) +void DreamBase::intro3Text(uint16 nextReelPointer) { + if (nextReelPointer == 107) setupTimedTemp(45, 82, 36, 56, 100, 1); - else if (ax == (isCD() ? 108 : 109)) + else if (nextReelPointer == (isCD() ? 108 : 109)) setupTimedTemp(46, 82, 36, 56, 100, 1); } @@ -799,7 +783,7 @@ void DreamBase::rollEndCredits() { } -void DreamGenContext::monks2text() { +void DreamBase::monks2text() { bool isGermanCD = isCD() && engine->getLanguage() == Common::DE_DEU; if (data.byte(kIntrocount) == 1) @@ -836,7 +820,7 @@ void DreamGenContext::monks2text() { setupTimedTemp(18, 82, 36, 160, 120, 1); } -void DreamGenContext::textForEnd() { +void DreamBase::textForEnd() { if (data.byte(kIntrocount) == 20) setupTimedTemp(0, 83, 34, 20, 60, 1); else if (data.byte(kIntrocount) == (isCD() ? 50 : 65)) @@ -845,14 +829,14 @@ void DreamGenContext::textForEnd() { 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) data.byte(kIntrocount)--; else setupTimedTemp(textIndex, voiceIndex, x, y, countToTimed, timeCount); } -void DreamGenContext::textForMonk() { +void DreamBase::textForMonk() { if (data.byte(kIntrocount) == 1) textForMonkHelper(19, 82, 68, 154, 120, 1); else if (data.byte(kIntrocount) == 5) diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index c353948abb..3a9785e586 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -732,11 +732,11 @@ void DreamGenContext::startup1() { fadeScreenUp(); } -void DreamGenContext::switchRyanOn() { +void DreamBase::switchRyanOn() { data.byte(kRyanon) = 255; } -void DreamGenContext::switchRyanOff() { +void DreamBase::switchRyanOff() { data.byte(kRyanon) = 1; } @@ -801,10 +801,6 @@ void DreamGenContext::seeCommandTail() { data.byte(kBrightness) = 1; } -void DreamGenContext::randomNumber() { - al = engine->randomNumber(); -} - void DreamGenContext::quickQuit() { engine->quit(); } @@ -829,7 +825,7 @@ uint16 DreamBase::readMouseState() { return state; } -void DreamGenContext::dumpTextLine() { +void DreamBase::dumpTextLine() { if (data.byte(kNewtextline) != 1) return; data.byte(kNewtextline) = 0; @@ -840,22 +836,18 @@ void DreamGenContext::dumpTextLine() { multiDump(x, y, 228, 13); } -void DreamGenContext::getUnderTimed() { +void DreamBase::getUnderTimed() { uint16 y = data.byte(kTimedy); if (data.byte(kForeignrelease)) y -= 3; - ds = data.word(kBuffers); - si = kUndertimedtext; - multiGet(ds.ptr(si, 0), data.byte(kTimedx), y, 240, kUndertimedysize); + multiGet(getSegment(data.word(kBuffers)).ptr(kUndertimedtext, 0), data.byte(kTimedx), y, 240, kUndertimedysize); } -void DreamGenContext::putUnderTimed() { +void DreamBase::putUnderTimed() { uint16 y = data.byte(kTimedy); if (data.byte(kForeignrelease)) y -= 3; - ds = data.word(kBuffers); - si = kUndertimedtext; - multiPut(ds.ptr(si, 0), data.byte(kTimedx), y, 240, kUndertimedysize); + multiPut(getSegment(data.word(kBuffers)).ptr(kUndertimedtext, 0), data.byte(kTimedx), y, 240, kUndertimedysize); } void DreamBase::getUnderCentre() { @@ -893,7 +885,7 @@ void DreamGenContext::processTrigger() { } } -void DreamGenContext::useTimedText() { +void DreamBase::useTimedText() { if (data.word(kTimecount) == 0) return; --data.word(kTimecount); @@ -908,15 +900,13 @@ void DreamGenContext::useTimedText() { else if (data.word(kTimecount) > data.word(kCounttotimed)) return; - es = data.word(kTimedseg); - si = data.word(kTimedoffset); - const uint8 *string = es.ptr(si, 0); + const uint8 *string = getSegment(data.word(kTimedseg)).ptr(data.word(kTimedoffset), 0); uint16 y = data.byte(kTimedy); printDirect(&string, data.byte(kTimedx), &y, 237, true); 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 (voiceIndex != 0) { if (loadSpeech('T', voiceIndex, 'T', textIndex)) { @@ -943,7 +933,7 @@ void DreamGenContext::setupTimedTemp(uint8 textIndex, uint8 voiceIndex, uint8 x, debug(1, "setupTimedTemp: (%d, %d) => '%s'", textIndex, voiceIndex, string); } -void DreamGenContext::dumpTimedText() { +void DreamBase::dumpTimedText() { if (data.byte(kNeedtodumptimed) != 1) return; uint8 y = data.byte(kTimedy); @@ -954,16 +944,13 @@ void DreamGenContext::dumpTimedText() { data.byte(kNeedtodumptimed) = 0; } -void DreamGenContext::getTime() { +void DreamBase::getTime() { TimeDate t; g_system->getTimeAndDate(t); debug(1, "\tgettime: %02d:%02d:%02d", t.tm_hour, t.tm_min, t.tm_sec); - ch = t.tm_hour; - cl = t.tm_min; - dh = t.tm_sec; - data.byte(kSecondcount) = dh; - data.byte(kMinutecount) = cl; - data.byte(kHourcount) = ch; + data.byte(kSecondcount) = t.tm_sec; + data.byte(kMinutecount) = t.tm_min; + data.byte(kHourcount) = t.tm_hour; } uint16 DreamBase::allocateMem(uint16 paragraphs) { @@ -979,12 +966,6 @@ void DreamBase::deallocateMem(uint16 segment) { debug(1, "deallocating segment %04x", segment); deallocateSegment(segment); - - // FIXME: The following line used to be enabled with the comment: "fixing - // invalid entries in the sprite table" - // So if there are regressions with sprites, we may want to investigate this - // closer. -// es = data; uint tsize = 16 * 32; uint16 bseg = data.word(kBuffers); if (!bseg) @@ -1110,7 +1091,6 @@ void DreamGenContext::startLoading(const Room &room) { data.byte(kLiftpath) = room.liftPath; data.byte(kDoorpath) = room.doorPath; data.byte(kLastweapon) = (uint8)-1; - ah = data.byte(kReallocation); data.byte(kReallocation) = room.realLocation; loadRoomData(room, false); @@ -1120,10 +1100,6 @@ void DreamGenContext::startLoading(const Room &room) { setAllChanges(); autoAppear(); // const Room &newRoom = g_roomData[data.byte(kNewlocation)]; - bx = 0x7fff; // TODO: bx used to be set to the offset of newRoom - // It seems to be unused (like newRoom itself), but set it - // to an invalid value to catch any missed use of it. - // (The push/pop of bx below is likely also unnecessary) data.byte(kLastweapon) = (uint8)-1; data.byte(kMandead) = 0; data.word(kLookcounter) = 160; @@ -1131,14 +1107,12 @@ void DreamGenContext::startLoading(const Room &room) { data.byte(kLinepointer) = 254; if (room.b27 != 255) { data.byte(kManspath) = room.b27; - push(bx); autoSetWalk(); - bx = pop(); } findXYFromPath(); } -void DreamGenContext::dealWithSpecial(uint8 firstParam, uint8 secondParam) { +void DreamBase::dealWithSpecial(uint8 firstParam, uint8 secondParam) { uint8 type = firstParam - 220; if (type == 0) { placeSetObject(secondParam); @@ -1165,7 +1139,7 @@ void DreamGenContext::dealWithSpecial(uint8 firstParam, uint8 secondParam) { } } -void DreamGenContext::plotReel(uint16 &reelPointer) { +void DreamBase::plotReel(uint16 &reelPointer) { Reel *reel = getReelStart(reelPointer); while (reel->x >= 220 && reel->x != 255) { dealWithSpecial(reel->x, reel->y); @@ -1298,10 +1272,6 @@ const uint8 *DreamGenContext::findObName(uint8 type, uint8 index) { } } -void DreamGenContext::copyName() { - copyName(ah, al, data.ptr(di, 0)); -} - void DreamGenContext::copyName(uint8 type, uint8 index, uint8 *dst) { const uint8 *src = findObName(type, index); size_t i; @@ -1422,7 +1392,7 @@ SetObject *DreamBase::getSetAd(uint8 index) { return (SetObject *)getSegment(data.word(kSetdat)).ptr(0, 0) + index; } -void DreamGenContext::doChange(uint8 index, uint8 value, uint8 type) { +void DreamBase::doChange(uint8 index, uint8 value, uint8 type) { if (type == 0) { //object getSetAd(index)->mapad[0] = value; } else if (type == 1) { //freeObject @@ -1430,9 +1400,9 @@ void DreamGenContext::doChange(uint8 index, uint8 value, uint8 type) { if (freeObject->mapad[0] == 0xff) freeObject->mapad[0] = value; } else { //path - bx = kPathdata + (type - 100) * 144 + index * 8; - es = data.word(kReels); - es.byte(bx+6) = value; +// getSegment(data.word(kReels)).byte(kPathdata + (type - 100) * 144 + index * 8 + 6) = value; + PathNode *paths = (PathNode *)getSegment(data.word(kReels)).ptr(kPathdata + 144 * (type - 100), 0); + paths[index].on = value; } } @@ -1462,20 +1432,12 @@ void DreamGenContext::getExPos() { di = kExdata + kNumexobjects * sizeof(DynObject); } -void DreamGenContext::placeSetObject() { - placeSetObject(al); -} - -void DreamGenContext::placeSetObject(uint8 index) { +void DreamBase::placeSetObject(uint8 index) { findOrMake(index, 0, 0); getSetAd(index)->mapad[0] = 0; } -void DreamGenContext::removeSetObject() { - removeSetObject(al); -} - -void DreamGenContext::removeSetObject(uint8 index) { +void DreamBase::removeSetObject(uint8 index) { findOrMake(index, 0xff, 0); getSetAd(index)->mapad[0] = 0xff; } @@ -1818,7 +1780,7 @@ bool DreamBase::isItDescribed(const ObjPos *pos) { return result != 0; } -bool DreamGenContext::isCD() { +bool DreamBase::isCD() { // 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 // we managed to load the speech. At least it is isolated in this function and can be changed. @@ -2216,7 +2178,7 @@ Frame * DreamBase::tempGraphics3() { return (Frame *)getSegment(data.word(kTempgraphics3)).ptr(0, 0); } -void DreamGenContext::findRoomInLoc() { +void DreamBase::findRoomInLoc() { uint8 x = data.byte(kMapx) / 11; uint8 y = data.byte(kMapy) / 10; uint8 roomNum = y * 6 + x; @@ -2522,10 +2484,6 @@ void DreamBase::setLocation(uint8 index) { data.byte(kRoomscango + index) = 1; } -void DreamGenContext::setLocation() { - DreamBase::setLocation(al); -} - const uint8 *DreamBase::getTextInFile1(uint16 index) { SegmentRef text = getSegment(data.word(kTextfile1)); uint16 offset = text.word(index * 2) + kTextstart; @@ -2631,7 +2589,7 @@ void DreamGenContext::drawFloor() { data.byte(kNewobs) = 0; } -void DreamGenContext::allocateBuffers() { +void DreamBase::allocateBuffers() { data.word(kExtras) = allocateMem(kLengthofextra/16); data.word(kMapdata) = allocateMem(kLengthofmap/16); data.word(kBuffers) = allocateMem(kLengthofbuffer/16); @@ -2651,19 +2609,19 @@ void DreamBase::workToScreenM() { delPointer(); } -void DreamGenContext::loadMenu() { +void DreamBase::loadMenu() { loadIntoTemp("DREAMWEB.S02"); // sprite name 3 loadIntoTemp2("DREAMWEB.G07"); // mon. graphics 2 } -void DreamGenContext::showMenu() { +void DreamBase::showMenu() { ++data.byte(kMenucount); if (data.byte(kMenucount) == 37*2) data.byte(kMenucount) = 0; showFrame(tempGraphics(), kMenux, kMenuy, data.byte(kMenucount) / 2, 0); } -void DreamGenContext::dumpMenu() { +void DreamBase::dumpMenu() { multiDump(kMenux, kMenuy, 48, 48); } @@ -3591,15 +3549,11 @@ void DreamGenContext::moreTalk() { doSomeTalk(); } -bool DreamGenContext::isSetObOnMap(uint8 index) { +bool DreamBase::isSetObOnMap(uint8 index) { return (getSetAd(index)->mapad[0] == 0); } -void DreamGenContext::isSetObOnMap() { - flags._z = isSetObOnMap(al); -} - -void DreamGenContext::dumpZoom() { +void DreamBase::dumpZoom() { if (data.byte(kZoomon) == 1) multiDump(kZoomx + 5, kZoomy + 4, 46, 40); } @@ -3647,7 +3601,7 @@ void DreamGenContext::selectLocation() { { 104,124,4,44,&DreamGenContext::lastDest }, { 280,308,4,44,&DreamGenContext::lookAtPlace }, { 104,216,138,192,&DreamGenContext::destSelect }, - { 273,320,157,198,&DreamGenContext::getBack1 }, + { 273,320,157,198,&DreamBase::getBack1 }, { 0,320,0,200,&DreamBase::blank }, { 0xFFFF,0,0,0,0 } }; @@ -3921,7 +3875,7 @@ void DreamGenContext::talk() { workToScreenCPP(); RectWithCallback talkList[] = { - { 273,320,157,198,&DreamGenContext::getBack1 }, + { 273,320,157,198,&DreamBase::getBack1 }, { 240,290,2,44,&DreamGenContext::moreTalk }, { 0,320,0,200,&DreamBase::blank }, { 0xFFFF,0,0,0,0 } @@ -3941,11 +3895,8 @@ void DreamGenContext::talk() { break; } while (!data.byte(kGetback)); - bx = data.word(kPersondata); - es = cs; - if (data.byte(kTalkpos) >= 4) - es.byte(bx+7) |= 128; + data.byte(data.word(kPersondata)+7) |= 128; redrawMainScrn(); workToScreenM(); @@ -4000,7 +3951,7 @@ void DreamGenContext::hangOnPQ() { data.byte(kGetback) = 0; RectWithCallback quitList[] = { - { 273,320,157,198,&DreamGenContext::getBack1 }, + { 273,320,157,198,&DreamBase::getBack1 }, { 0,320,0,200,&DreamBase::blank }, { 0xFFFF,0,0,0,0 } }; @@ -4084,7 +4035,7 @@ void DreamGenContext::showGun() { getRidOfTempText(); } -void DreamGenContext::diaryKeyP() { +void DreamBase::diaryKeyP() { if (data.byte(kCommandtype) != 214) { data.byte(kCommandtype) = 214; commandOnly(23); @@ -4104,7 +4055,7 @@ void DreamGenContext::diaryKeyP() { data.byte(kDiarypage) = 11; } -void DreamGenContext::diaryKeyN() { +void DreamBase::diaryKeyN() { if (data.byte(kCommandtype) != 213) { data.byte(kCommandtype) = 213; commandOnly(23); diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index b50b1bccd7..ddaa66fa47 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -25,8 +25,6 @@ void screenUpdate(); void startup(); void startup1(); - void switchRyanOn(); - void switchRyanOff(); void saveLoad(); void hangOnCurs(uint16 frameCount); void hangOnCurs(); @@ -43,13 +41,11 @@ void multiDump(uint16 x, uint16 y, uint8 width, uint8 height) { DreamBase::multiDump(x, y, width, height); } - void printSprites(); void quickQuit(); void readOneBlock(); void readCityPic(); void readDestIcon(); void seeCommandTail(); - void randomNumber(); void quickQuit2(); void printDirect(); uint8 printDirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered) { @@ -58,12 +54,6 @@ uint8 printDirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered) { return DreamBase::printDirect(string, x, y, maxWidth, centered); } - 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 startLoading(const Room &room); void showFrame(); void showFrame(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height) { @@ -72,37 +62,10 @@ void showFrame(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag) { DreamBase::showFrame(frameData, x, y, frameNumber, effectsFlag); } - void printASprite(const Sprite *sprite); void width160(); - void clearSprites(); - Sprite *makeSprite(uint8 x, uint8 y, uint16 updateCallback, uint16 frameData, uint16 somethingInDi); void spriteUpdate(); - void initMan(); 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 turnPathOn(uint8 param); - void turnPathOff(uint8 param); - void turnPathOn(); - void turnPathOff(); - void turnAnyPathOn(uint8 param, uint8 room); - void turnAnyPathOff(uint8 param, uint8 room); - void turnAnyPathOn(); - void turnAnyPathOff(); void makeBackOb(SetObject *objData); - void dealWithSpecial(uint8 firstParam, uint8 secondParam); void zoom(); void showRain(); void commandOnly(); @@ -117,15 +80,10 @@ void checkIfEx(); bool checkIfEx(uint8 x, uint8 y); const uint8 *findObName(uint8 type, uint8 index); - void copyName(); void copyName(uint8 type, uint8 index, uint8 *dst); void commandWithOb(); void commandWithOb(uint8 command, uint8 type, uint8 index); void updatePeople(); - void madman(ReelRoutine &routine); - void madmanText(); - void madMode(); - void moveMap(uint8 param); bool addAlong(const uint8 *mapFlags); bool addLength(const uint8 *mapFlags); void getDimension(); @@ -156,13 +114,7 @@ return DreamBase::getSetAd(index); } void setAllChanges(); - void doChange(uint8 index, uint8 value, uint8 type); void deleteTaken(); - bool isCD(); - void placeSetObject(); - void placeSetObject(uint8 index); - void removeSetObject(); - void removeSetObject(uint8 index); void showAllFree(); void showAllEx(); bool finishedWalkingCPP(); @@ -175,7 +127,6 @@ void obName(); void obName(uint8 command, uint8 commandType); void checkCoords(const RectWithCallback *rectWithCallbacks); - void addToPeopleList(ReelRoutine *routine); void getExPos(); void compare(); bool compare(uint8 index, uint8 flag, const char id[4]) { @@ -184,8 +135,6 @@ bool pixelCheckSet(const ObjPos *pos, uint8 x, uint8 y); void checkIfSet(); bool checkIfSet(uint8 x, uint8 y); - void checkIfPathIsOn(); - bool checkIfPathIsOn(uint8 index); void isItWorn(); bool isItWorn(const DynObject *object) { return DreamBase::isItWorn(object); @@ -213,8 +162,6 @@ const uint8 *getObTextStartCPP(); void useText(const uint8 *string); void useText(); - void getBlockOfPixel(); - uint8 getBlockOfPixel(uint8 x, uint8 y); void examineObText(); void showCity(); uint16 getPersFrame(uint8 index); @@ -222,23 +169,11 @@ void examineOb(bool examineAgain = true); void dumpWatch(); void transferText(); - void initRain(); - Rain *splitIntoLines(uint8 x, uint8 y, Rain *rain); void watchCount(); 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 intro2Text(); - void intro3Text(); void readSetData(); void fadeupYellows(); void fadeupMonFirst(); - void loadMenu(); - void showMenu(); - void dumpMenu(); void useMenu(); void useMon(); void makeCaps(); @@ -261,7 +196,6 @@ void playChannel1(uint8 index) { DreamBase::playChannel1(index); } - void findRoomInLoc(); void reelsOnScreen(); void reconstruct(); void look(); @@ -329,61 +263,8 @@ void checkFolderCoords(); void nextFolder(); void lastFolder(); - void setLocation(); - void setLocation(uint8 index) { - DreamBase::setLocation(index); - } void drawFloor(); - void allocateBuffers(); - bool checkSpeed(ReelRoutine &routine); - void checkSpeed(); - void sparkyDrip(ReelRoutine &routine); - void genericPerson(ReelRoutine &routine); - void gamer(ReelRoutine &routine); - void eden(ReelRoutine &routine); - void sparky(ReelRoutine &routine); - void rockstar(ReelRoutine &routine); - void madmansTelly(ReelRoutine &routine); - void smokeBloke(ReelRoutine &routine); - void manAsleep(ReelRoutine &routine); - void drunk(ReelRoutine &routine); - void introMagic1(ReelRoutine &routine); - void introMagic2(ReelRoutine &routine); - void introMagic3(ReelRoutine &routine); - void introMusic(ReelRoutine &routine); - void candles(ReelRoutine &routine); - void candles1(ReelRoutine &routine); - void candles2(ReelRoutine &routine); - void smallCandle(ReelRoutine &routine); - void gates(ReelRoutine &routine); - void security(ReelRoutine &routine); - void edenInBath(ReelRoutine &routine); - void louis(ReelRoutine &routine); - void handClap(ReelRoutine &routine); - void carParkDrip(ReelRoutine &routine); - void foghornSound(ReelRoutine &routine); - void train(ReelRoutine &routine); - void attendant(ReelRoutine &routine); - void keeper(ReelRoutine &routine); - void interviewer(ReelRoutine &routine); - void drinker(ReelRoutine &routine); - void alleyBarkSound(ReelRoutine &routine); - void louisChair(ReelRoutine &routine); - void bossMan(ReelRoutine &routine); - void priest(ReelRoutine &routine); - void monkAndRyan(ReelRoutine &routine); - void copper(ReelRoutine &routine); - void introMonks1(ReelRoutine &routine); - void introMonks2(ReelRoutine &routine); - void soldier1(ReelRoutine &routine); - void receptionist(ReelRoutine &routine); - void bartender(ReelRoutine &routine); - void heavy(ReelRoutine &routine); - void helicopter(ReelRoutine &routine); void mugger(ReelRoutine &routine); - void businessMan(ReelRoutine &routine); - void endGameSeq(ReelRoutine &routine); - void poolGuard(ReelRoutine &routine); void singleKey(uint8 key, uint16 x, uint16 y); void loadSaveBox(); uint8 nextSymbol(uint8 symbol); @@ -445,7 +326,6 @@ void obsThatDoThings(); void makeMainScreen(); void delEverything(); - void clearPalette(); void errorMessage1(); void errorMessage2(); void errorMessage3(); @@ -456,25 +336,17 @@ void putBackObStuff(); void moreTalk(); void redes(); - void isSetObOnMap(); - bool isSetObOnMap(uint8 index); - void dumpZoom(); void selectLocation(); void showGroup(); void loadSpeech(); bool loadSpeech(byte type1, int idx1, byte type2, int idx2) { return DreamBase::loadSpeech(type1, idx1, type2, idx2); } - void getTime(); void set16ColPalette(); void showSaveOps(); void showLoadOps(); void watchReel(); void showWatchReel(); - void plotReel(uint16 &reelPointer); - void removeFreeObject(uint8 index) { - DreamBase::removeFreeObject(index); - } void afterNewRoom(); void madmanRun(); void showDecisions(); @@ -486,8 +358,6 @@ void hangOnPQ(); void showGun(); void endGame(); - void diaryKeyP(); - void diaryKeyN(); void checkInput(); void dropError(); void cantDrop(); @@ -519,5 +389,6 @@ void openOb(); void withWhat(); void notHeldError(); + void useGun(); #endif diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 08b96cf33a..4e956cd016 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -764,6 +764,118 @@ void DreamGenContext::useChurchGate() { turnPathOn(2); // Open church } +void DreamGenContext::useGun() { + + if (data.byte(kObjecttype) != 4) { + // gun is not taken + showSecondUse(); + putBackObStuff(); + + } else if (data.byte(kReallocation) == 22) { + // in pool room + showPuzText(34, 300); + data.byte(kLastweapon) = 1; + data.byte(kCombatcount) = 39; + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 25) { + // helicopter + showPuzText(34, 300); + data.byte(kLastweapon) = 1; + data.byte(kCombatcount) = 19; + data.byte(kGetback) = 1; + data.byte(kDreamnumber) = 2; + data.byte(kRoomafterdream) = 38; + data.byte(kSartaindead) = 1; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 27) { + // in rock room + showPuzText(46, 300); + data.byte(kPointermode) = 2; + data.byte(kRockstardead) = 1; + data.byte(kLastweapon) = 1; + data.byte(kNewsitem) = 1; + data.byte(kGetback) = 1; + data.byte(kRoomafterdream) = 32; + data.byte(kDreamnumber) = 0; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 8 && data.byte(kMapx) == 22 && data.byte(kMapy) == 40 + && !isSetObOnMap(92) && data.byte(kManspath) != 9) { + // by studio + data.byte(kDestination) = 9; + data.byte(kFinaldest) = 9; + autoSetWalk(); + data.byte(kLastweapon) = 1; + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 6 && data.byte(kMapx) == 11 && data.byte(kMapy) == 20 + && isSetObOnMap(5)) { + // sarters + data.byte(kDestination) = 1; + data.byte(kFinaldest) = 1; + autoSetWalk(); + removeSetObject(5); + placeSetObject(6); + turnAnyPathOn(1, data.byte(kRoomnum) - 1); + data.byte(kLiftflag) = 1; + data.word(kWatchingtime) = 40*2; + data.word(kReeltowatch) = 4; + data.word(kEndwatchreel) = 43; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 29) { + // aide + data.byte(kGetback) = 1; + al = 13; + resetLocation(); + setLocation(12); + data.byte(kDestpos) = 12; + data.byte(kDestination) = 2; + data.byte(kFinaldest) = 2; + autoSetWalk(); + data.word(kWatchingtime) = 164*2; + data.word(kReeltowatch) = 3; + data.word(kEndwatchreel) = 164; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kAidedead) = 1; + data.byte(kDreamnumber) = 3; + data.byte(kRoomafterdream) = 33; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 23 && data.byte(kMapx) == 0 && data.byte(kMapy) == 50) { + // with boss + if (data.byte(kManspath) != 5) { + data.byte(kDestination) = 5; + data.byte(kFinaldest) = 5; + autoSetWalk(); + } + data.byte(kLastweapon) = 1; + data.byte(kGetback) = 1; + + } else if (data.byte(kReallocation) == 8 && data.byte(kMapx) == 11 && data.byte(kMapy) == 10) { + // tv soldier + if (data.byte(kManspath) != 2) { + data.byte(kDestination) = 2; + data.byte(kFinaldest) = 2; + autoSetWalk(); + } + data.byte(kLastweapon) = 1; + data.byte(kGetback) = 1; + + } else { + showFirstUse(); + putBackObStuff(); + } +} + void DreamGenContext::useFullCart() { data.byte(kProgresspoints)++; turnAnyPathOn(2, data.byte(kRoomnum) + 6); @@ -863,7 +975,7 @@ void DreamGenContext::useElvDoor() { // Axe on door showPuzText(15, 300); - _inc(data.byte(kProgresspoints)); + data.byte(kProgresspoints)++; data.word(kWatchingtime) = 46 * 2; data.word(kReeltowatch) = 31; data.word(kEndwatchreel) = 77; @@ -1176,10 +1288,10 @@ void DreamGenContext::useDiary() { data.byte(kGetback) = 0; RectWithCallback diaryList[] = { - { kDiaryx+94,kDiaryx+110,kDiaryy+97,kDiaryy+113,&DreamGenContext::diaryKeyN }, - { kDiaryx+151,kDiaryx+167,kDiaryy+71,kDiaryy+87,&DreamGenContext::diaryKeyP }, - { kDiaryx+176,kDiaryx+192,kDiaryy+108,kDiaryy+124,&DreamGenContext::quitKey }, - { 0,320,0,200,&DreamGenContext::blank }, + { kDiaryx+94,kDiaryx+110,kDiaryy+97,kDiaryy+113,&DreamBase::diaryKeyN }, + { kDiaryx+151,kDiaryx+167,kDiaryy+71,kDiaryy+87,&DreamBase::diaryKeyP }, + { kDiaryx+176,kDiaryx+192,kDiaryy+108,kDiaryy+124,&DreamBase::quitKey }, + { 0,320,0,200,&DreamBase::blank }, { 0xFFFF,0,0,0,0 } }; diff --git a/engines/dreamweb/vgafades.cpp b/engines/dreamweb/vgafades.cpp index ca63b7308c..6766d56424 100644 --- a/engines/dreamweb/vgafades.cpp +++ b/engines/dreamweb/vgafades.cpp @@ -184,7 +184,28 @@ void DreamBase::fadeScreenDowns() { data.byte(kNumtofade) = 64; } -void DreamGenContext::clearPalette() { +void DreamBase::fadeScreenDownHalf() { + palToStartPal(); + palToEndPal(); + + const uint8 *startPal = startPalette(); + uint8 *endPal = endPalette(); + for (int i = 0; i < 256 * 3; ++i) { + *endPal >>= 1; + endPal++; + } + + memcpy(endPal + (56*3), startPal + (56*3), 3*5); + memcpy(endPal + (77*3), startPal + (77*3), 3*2); + + data.byte(kFadedirection) = 1; + data.byte(kFadecount) = 31; + data.byte(kColourpos) = 0; + data.byte(kNumtofade) = 32; +} + + +void DreamBase::clearPalette() { data.byte(kFadedirection) = 0; clearStartPal(); dumpCurrent(); |