diff options
Diffstat (limited to 'engines/dreamweb')
27 files changed, 11203 insertions, 17441 deletions
diff --git a/engines/dreamweb/backdrop.cpp b/engines/dreamweb/backdrop.cpp index ffcad5b6bf..3e005fdec9 100644 --- a/engines/dreamweb/backdrop.cpp +++ b/engines/dreamweb/backdrop.cpp @@ -24,15 +24,12 @@ namespace DreamGen { -void DreamGenContext::doblocks() { +void DreamGenContext::doBlocks() { uint16 dstOffset = data.word(kMapady) * 320 + data.word(kMapadx); uint16 mapOffset = kMap + data.byte(kMapy) * kMapwidth + data.byte(kMapx); - ds = data.word(kMapdata); - const uint8 *mapData = ds.ptr(mapOffset, 0); - ds = data.word(kBackdrop); - const uint8 *blocks = ds.ptr(kBlocks, 0); - es = data.word(kWorkspace); - uint8 *dstBuffer = es.ptr(dstOffset, 0); + const uint8 *mapData = getSegment(data.word(kMapdata)).ptr(mapOffset, 0); + const uint8 *blocks = getSegment(data.word(kBackdrop)).ptr(kBlocks, 0); + uint8 *dstBuffer = workspace() + dstOffset; for (size_t i = 0; i < 10; ++i) { for (size_t j = 0; j < 11; ++j) { @@ -66,7 +63,7 @@ void DreamGenContext::doblocks() { } } -uint8 DreamGenContext::getxad(const uint8 *setData, uint8 *result) { +uint8 DreamGenContext::getXAd(const uint8 *setData, uint8 *result) { uint8 v0 = setData[0]; uint8 v1 = setData[1]; uint8 v2 = setData[2]; @@ -81,7 +78,7 @@ uint8 DreamGenContext::getxad(const uint8 *setData, uint8 *result) { return 1; } -uint8 DreamGenContext::getyad(const uint8 *setData, uint8 *result) { +uint8 DreamGenContext::getYAd(const uint8 *setData, uint8 *result) { uint8 v0 = setData[3]; uint8 v1 = setData[4]; if (v0 < data.byte(kMapy)) @@ -93,30 +90,30 @@ uint8 DreamGenContext::getyad(const uint8 *setData, uint8 *result) { return 1; } -void DreamGenContext::getmapad() { - ch = getmapad((const uint8 *)es.ptr(si, 5)); +void DreamGenContext::getMapAd() { + ch = getMapAd((const uint8 *)es.ptr(si, 5)); } -uint8 DreamGenContext::getmapad(const uint8 *setData) { +uint8 DreamGenContext::getMapAd(const uint8 *setData) { uint8 xad, yad; - if (getxad(setData, &xad) == 0) + if (getXAd(setData, &xad) == 0) return 0; data.word(kObjectx) = xad; - if (getyad(setData, &yad) == 0) + if (getYAd(setData, &yad) == 0) return 0; data.word(kObjecty) = yad; return 1; } -void DreamGenContext::calcfrframe() { +void DreamGenContext::calcFrFrame(uint16 frame) { uint8 width, height; - calcfrframe(&width, &height); + calcFrFrame(frame, &width, &height); cl = width; ch = height; } -void DreamGenContext::calcfrframe(uint8* width, uint8* height) { - const Frame *frame = (const Frame *)segRef(data.word(kFrsegment)).ptr(data.word(kCurrentframe) * sizeof(Frame), sizeof(Frame)); +void DreamGenContext::calcFrFrame(uint16 frameNum, uint8* width, uint8* height) { + const Frame *frame = (const Frame *)getSegment(data.word(kFrsegment)).ptr(frameNum * sizeof(Frame), sizeof(Frame)); data.word(kSavesource) = data.word(kFramesad) + frame->ptr(); data.byte(kSavesize+0) = frame->width; data.byte(kSavesize+1) = frame->height; @@ -126,49 +123,48 @@ void DreamGenContext::calcfrframe(uint8* width, uint8* height) { *height = frame->height; } -void DreamGenContext::finalframe() { +void DreamGenContext::finalFrame() { uint16 x, y; - finalframe(&x, &y); + finalFrame(&x, &y); di = x; bx = y; } -void DreamGenContext::finalframe(uint16 *x, uint16 *y) { +void DreamGenContext::finalFrame(uint16 *x, uint16 *y) { data.byte(kSavex) = (data.word(kObjectx) + data.word(kOffsetx)) & 0xff; data.byte(kSavey) = (data.word(kObjecty) + data.word(kOffsety)) & 0xff; *x = data.word(kObjectx); *y = data.word(kObjecty); } -void DreamGenContext::showallobs() { +void DreamGenContext::showAllObs() { data.word(kListpos) = kSetlist; - memset(segRef(data.word(kBuffers)).ptr(kSetlist, 0), 0xff, 128 * 5); + memset(getSegment(data.word(kBuffers)).ptr(kSetlist, 0), 0xff, 128 * 5); data.word(kFrsegment) = data.word(kSetframes); data.word(kDataad) = kFramedata; data.word(kFramesad) = kFrames; - const Frame *frames = (const Frame *)segRef(data.word(kFrsegment)).ptr(0, 0); - SetObject *setEntries = (SetObject *)segRef(data.word(kSetdat)).ptr(0, 128 * sizeof(SetObject)); + const Frame *frames = (const Frame *)getSegment(data.word(kFrsegment)).ptr(0, 0); + SetObject *setEntries = (SetObject *)getSegment(data.word(kSetdat)).ptr(0, 128 * sizeof(SetObject)); for (size_t i = 0; i < 128; ++i) { SetObject *setEntry = setEntries + i; - if (getmapad(setEntry->mapad) == 0) + if (getMapAd(setEntry->mapad) == 0) continue; - uint8 currentFrame = setEntry->b18[0]; - data.word(kCurrentframe) = currentFrame; + uint8 currentFrame = setEntry->frames[0]; if (currentFrame == 0xff) continue; - calcfrframe(); + calcFrFrame(currentFrame); uint16 x, y; - finalframe(&x, &y); - setEntry->index = setEntry->b18[0]; + finalFrame(&x, &y); + setEntry->index = setEntry->frames[0]; if ((setEntry->type == 0) && (setEntry->priority != 5) && (setEntry->priority != 6)) { x += data.word(kMapadx); y += data.word(kMapady); - showframe(frames, x, y, data.word(kCurrentframe), 0); + showFrame(frames, x, y, currentFrame, 0); } else - makebackob(setEntry); + makeBackOb(setEntry); - ObjPos *objPos = (ObjPos *)segRef(data.word(kBuffers)).ptr(data.word(kListpos), sizeof(ObjPos)); + ObjPos *objPos = (ObjPos *)getSegment(data.word(kBuffers)).ptr(data.word(kListpos), sizeof(ObjPos)); objPos->xMin = data.byte(kSavex); objPos->yMin = data.byte(kSavey); objPos->xMax = data.byte(kSavex) + data.byte(kSavesize+0); @@ -178,18 +174,17 @@ void DreamGenContext::showallobs() { } } -void DreamGenContext::getdimension() -{ +void DreamGenContext::getDimension() { uint8 mapXstart, mapYstart; uint8 mapXsize, mapYsize; - getdimension(&mapXstart, &mapYstart, &mapXsize, &mapYsize); + getDimension(&mapXstart, &mapYstart, &mapXsize, &mapYsize); cl = mapXstart; ch = mapYstart; dl = mapXsize; dh = mapYsize; } -bool DreamGenContext::addalong(const uint8 *mapFlags) { +bool DreamGenContext::addAlong(const uint8 *mapFlags) { for (size_t i = 0; i < 11; ++i) { if (mapFlags[3 * i] != 0) return true; @@ -197,7 +192,7 @@ bool DreamGenContext::addalong(const uint8 *mapFlags) { return false; } -bool DreamGenContext::addlength(const uint8 *mapFlags) { +bool DreamGenContext::addLength(const uint8 *mapFlags) { for (size_t i = 0; i < 10; ++i) { if (mapFlags[3 * 11 * i] != 0) return true; @@ -205,23 +200,23 @@ bool DreamGenContext::addlength(const uint8 *mapFlags) { return false; } -void DreamGenContext::getdimension(uint8 *mapXstart, uint8 *mapYstart, uint8 *mapXsize, uint8 *mapYsize) { - const uint8 *mapFlags = segRef(data.word(kBuffers)).ptr(kMapflags, 0); +void DreamGenContext::getDimension(uint8 *mapXstart, uint8 *mapYstart, uint8 *mapXsize, uint8 *mapYsize) { + const uint8 *mapFlags = getSegment(data.word(kBuffers)).ptr(kMapflags, 0); uint8 yStart = 0; - while (! addalong(mapFlags + 3 * 11 * yStart)) + while (! addAlong(mapFlags + 3 * 11 * yStart)) ++yStart; uint8 xStart = 0; - while (! addlength(mapFlags + 3 * xStart)) + while (! addLength(mapFlags + 3 * xStart)) ++xStart; uint8 yEnd = 10; - while (! addalong(mapFlags + 3 * 11 * (yEnd - 1))) + while (! addAlong(mapFlags + 3 * 11 * (yEnd - 1))) --yEnd; uint8 xEnd = 11; - while (! addlength(mapFlags + 3 * (xEnd - 1))) + while (! addLength(mapFlags + 3 * (xEnd - 1))) --xEnd; *mapXstart = xStart; @@ -234,37 +229,38 @@ void DreamGenContext::getdimension(uint8 *mapXstart, uint8 *mapYstart, uint8 *ma data.byte(kMapysize) = *mapYsize << 4; } -void DreamGenContext::calcmapad() { +void DreamGenContext::calcMapAd() { uint8 mapXstart, mapYstart; uint8 mapXsize, mapYsize; - getdimension(&mapXstart, &mapYstart, &mapXsize, &mapYsize); + getDimension(&mapXstart, &mapYstart, &mapXsize, &mapYsize); data.word(kMapadx) = data.word(kMapoffsetx) - 8 * (mapXsize + 2 * mapXstart - 11); data.word(kMapady) = data.word(kMapoffsety) - 8 * (mapYsize + 2 * mapYstart - 10); } -void DreamGenContext::showallfree() { +void DreamGenContext::showAllFree() { data.word(kListpos) = kFreelist; - ObjPos *listPos = (ObjPos *)segRef(data.word(kBuffers)).ptr(kFreelist, 80 * sizeof(ObjPos)); + ObjPos *listPos = (ObjPos *)getSegment(data.word(kBuffers)).ptr(kFreelist, 80 * sizeof(ObjPos)); memset(listPos, 0xff, 80 * sizeof(ObjPos)); data.word(kFrsegment) = data.word(kFreeframes); data.word(kDataad) = kFrframedata; data.word(kFramesad) = kFrframes; data.byte(kCurrentfree) = 0; - const DynObject *freeObjects = (const DynObject *)segRef(data.word(kFreedat)).ptr(0, 0); - for(size_t i = 0; i < 80; ++i) { - uint8 mapad = getmapad(freeObjects[i].mapad); - if (mapad != 0) { - data.word(kCurrentframe) = 3 * data.byte(kCurrentfree); + const DynObject *freeObjects = (const DynObject *)getSegment(data.word(kFreedat)).ptr(0, 0); + for (size_t i = 0; i < 80; ++i) { + uint8 mapAd = getMapAd(freeObjects[i].mapad); + if (mapAd != 0) { uint8 width, height; - calcfrframe(&width, &height); + uint16 currentFrame = 3 * data.byte(kCurrentfree); + calcFrFrame(currentFrame, &width, &height); uint16 x, y; - finalframe(&x, &y); + finalFrame(&x, &y); if ((width != 0) || (height != 0)) { x += data.word(kMapadx); y += data.word(kMapady); - showframe((Frame *)segRef(data.word(kFrsegment)).ptr(0, 0), x, y, data.word(kCurrentframe) & 0xff, 0); - ObjPos *objPos = (ObjPos *)segRef(data.word(kBuffers)).ptr(data.word(kListpos), sizeof(ObjPos)); + assert(currentFrame < 256); + showFrame((Frame *)getSegment(data.word(kFrsegment)).ptr(0, 0), x, y, currentFrame, 0); + ObjPos *objPos = (ObjPos *)getSegment(data.word(kBuffers)).ptr(data.word(kListpos), sizeof(ObjPos)); objPos->xMin = data.byte(kSavex); objPos->yMin = data.byte(kSavey); objPos->xMax = data.byte(kSavex) + data.byte(kSavesize+0); @@ -278,10 +274,10 @@ void DreamGenContext::showallfree() { } } -void DreamGenContext::drawflags() { - uint8 *mapFlags = segRef(data.word(kBuffers)).ptr(kMapflags, 0); - const uint8 *mapData = segRef(data.word(kMapdata)).ptr(kMap + data.byte(kMapy) * kMapwidth + data.byte(kMapx), 0); - const uint8 *backdropFlags = segRef(data.word(kBackdrop)).ptr(kFlags, 0); +void DreamGenContext::drawFlags() { + uint8 *mapFlags = getSegment(data.word(kBuffers)).ptr(kMapflags, 0); + const uint8 *mapData = getSegment(data.word(kMapdata)).ptr(kMap + data.byte(kMapy) * kMapwidth + data.byte(kMapx), 0); + const uint8 *backdropFlags = getSegment(data.word(kBackdrop)).ptr(kFlags, 0); for (size_t i = 0; i < 10; ++i) { for (size_t j = 0; j < 11; ++j) { @@ -294,31 +290,32 @@ void DreamGenContext::drawflags() { } } -void DreamGenContext::showallex() { +void DreamGenContext::showAllEx() { data.word(kListpos) = kExlist; - memset(segRef(data.word(kBuffers)).ptr(kExlist, 100 * 5), 0xff, 100 * 5); + memset(getSegment(data.word(kBuffers)).ptr(kExlist, 100 * 5), 0xff, 100 * 5); data.word(kFrsegment) = data.word(kExtras); data.word(kDataad) = kExframedata; data.word(kFramesad) = kExframes; data.byte(kCurrentex) = 0; - DynObject *objects = (DynObject *)segRef(data.word(kExtras)).ptr(kExdata, sizeof(DynObject)); + DynObject *objects = (DynObject *)getSegment(data.word(kExtras)).ptr(kExdata, sizeof(DynObject)); for (size_t i = 0; i < 100; ++i, ++data.byte(kCurrentex)) { DynObject *object = objects + i; if (object->mapad[0] == 0xff) continue; if (object->currentLocation != data.byte(kReallocation)) continue; - if (getmapad(object->mapad) == 0) + if (getMapAd(object->mapad) == 0) continue; - data.word(kCurrentframe) = 3 * data.byte(kCurrentex); uint8 width, height; - calcfrframe(&width, &height); + uint16 currentFrame = 3 * data.byte(kCurrentex); + calcFrFrame(currentFrame, &width, &height); uint16 x, y; - finalframe(&x, &y); + finalFrame(&x, &y); if ((width != 0) || (height != 0)) { - showframe((Frame *)segRef(data.word(kFrsegment)).ptr(0, 0), x + data.word(kMapadx), y + data.word(kMapady), data.word(kCurrentframe) & 0xff, 0); - ObjPos *objPos = (ObjPos *)segRef(data.word(kBuffers)).ptr(data.word(kListpos), sizeof(ObjPos)); + assert(currentFrame < 256); + showFrame((Frame *)getSegment(data.word(kFrsegment)).ptr(0, 0), x + data.word(kMapadx), y + data.word(kMapady), currentFrame, 0); + ObjPos *objPos = (ObjPos *)getSegment(data.word(kBuffers)).ptr(data.word(kListpos), sizeof(ObjPos)); objPos->xMin = data.byte(kSavex); objPos->yMin = data.byte(kSavey); objPos->xMax = data.byte(kSavesize + 0) + data.byte(kSavex); @@ -329,5 +326,4 @@ void DreamGenContext::showallex() { } } -} /*namespace dreamgen */ - +} // End of namespace DreamGen diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp index 0ac61a3ac2..ba7152beb5 100644 --- a/engines/dreamweb/detection.cpp +++ b/engines/dreamweb/detection.cpp @@ -40,7 +40,7 @@ public: AdvancedMetaEngine(DreamWeb::gameDescriptions, sizeof(DreamWeb::DreamWebGameDescription), dreamWebGames) { _singleid = "dreamweb"; - _guioptions = Common::GUIO_NOMIDI; + _guioptions = GUIO1(GUIO_NOMIDI); } virtual const char *getName() const { @@ -95,7 +95,7 @@ SaveStateList DreamWebMetaEngine::listSaves(const char *target) const { Common::sort(files.begin(), files.end()); SaveStateList saveList; - for(uint i = 0; i < files.size(); ++i) { + for (uint i = 0; i < files.size(); ++i) { const Common::String &file = files[i]; Common::InSaveFile *stream = saveFileMan->openForLoading(file); if (!stream) diff --git a/engines/dreamweb/detection_tables.h b/engines/dreamweb/detection_tables.h index 82fb6102e4..75f5786268 100644 --- a/engines/dreamweb/detection_tables.h +++ b/engines/dreamweb/detection_tables.h @@ -25,8 +25,6 @@ namespace DreamWeb { -using Common::GUIO_NONE; - static const DreamWebGameDescription gameDescriptions[] = { // International floppy release { @@ -41,7 +39,7 @@ static const DreamWebGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, - GUIO_NONE + GUIO0() }, }, @@ -58,7 +56,7 @@ static const DreamWebGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, - GUIO_NONE + GUIO0() }, }, @@ -75,7 +73,7 @@ static const DreamWebGameDescription gameDescriptions[] = { Common::EN_USA, Common::kPlatformPC, ADGF_CD, - GUIO_NONE + GUIO0() }, }, @@ -92,7 +90,7 @@ static const DreamWebGameDescription gameDescriptions[] = { Common::FR_FRA, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, - GUIO_NONE + GUIO0() }, }, @@ -109,7 +107,7 @@ static const DreamWebGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformPC, ADGF_UNSTABLE, - GUIO_NONE + GUIO0() }, }, @@ -126,7 +124,7 @@ static const DreamWebGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, - GUIO_NONE + GUIO0() }, }, @@ -143,7 +141,7 @@ static const DreamWebGameDescription gameDescriptions[] = { Common::ES_ESP, Common::kPlatformPC, ADGF_UNSTABLE, - GUIO_NONE + GUIO0() }, }, @@ -160,7 +158,7 @@ static const DreamWebGameDescription gameDescriptions[] = { Common::ES_ESP, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, - GUIO_NONE + GUIO0() }, }, @@ -177,7 +175,7 @@ static const DreamWebGameDescription gameDescriptions[] = { Common::IT_ITA, Common::kPlatformPC, ADGF_UNSTABLE, - GUIO_NONE + GUIO0() }, }, diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h new file mode 100644 index 0000000000..3d5c9ce88b --- /dev/null +++ b/engines/dreamweb/dreambase.h @@ -0,0 +1,217 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef DREAMBASE_H +#define DREAMBASE_H + +#include "common/scummsys.h" + +#include "dreamweb/segment.h" + +namespace DreamWeb { + class DreamWebEngine; +} + + +namespace DreamGen { + +/** + * This class is one of the parent classes of DreamGenContext. Its sole purpose + * is to allow us to incrementally move things out of DreamGenContext into this + * base class, as soon as they don't modify any context registers (ax, bx, cx, ...) + * anymore. + * Ultimately, DreamGenContext should be empty, at which point it can be removed + * together with class Context. When that happens, we can probably merge + * DreamBase into DreamWebEngine. + */ +class DreamBase : public SegmentManager { +protected: + DreamWeb::DreamWebEngine *engine; + +public: + DreamBase(DreamWeb::DreamWebEngine *en) : engine(en) { } + +public: + // from monitor.cpp + void printOuterMon(); + void showCurrentFile(); + void accessLightOn(); + void accessLightOff(); + void turnOnPower(); + void powerLightOn(); + void powerLightOff(); + void printLogo(); + void scrollMonitor(); + const char *monPrint(const char *string); + void lockLightOn(); + void lockLightOff(); + + // from object.cpp + void obIcons(); + + // from pathfind.cpp + Common::Point _lineData[200]; // Output of Bresenham + void checkDest(const RoomPaths *roomsPaths); + RoomPaths *getRoomsPaths(); + void faceRightWay(); + void setWalk(); + void autoSetWalk(); + void findXYFromPath(); + void bresenhams(); + void workoutFrames(); + + // 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); + void printChar(const Frame* charSet, uint16 x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height); + void printBoth(const Frame* charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar); + uint8 printDirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered); + uint8 printDirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered); + uint8 getNumber(const Frame *charSet, const uint8 *string, uint16 maxWidth, bool centered, uint16 *offset); + uint8 kernChars(uint8 firstChar, uint8 secondChar, uint8 width); + uint8 printSlow(const uint8 *string, uint16 x, uint16 y, uint8 maxWidth, bool centered); + uint16 waitFrames(); + void printCurs(); + void delCurs(); + + // from saveload.cpp + char _saveNames[17*7]; + char _saveNamesOld[17*7]; + void showNames(); + + // from sound.cpp + bool loadSpeech(byte type1, int idx1, byte type2, int idx2); + void volumeAdjust(); + void cancelCh0(); + void cancelCh1(); + void loadRoomsSample(); + void playChannel0(uint8 index, uint8 repeat); + void playChannel1(uint8 index); + + // from sprite.cpp + Sprite *spriteTable(); + Reel *getReelStart(uint16 reelPointer); + const Frame *findSource(uint16 &frame); + void showReelFrame(Reel *reel); + const Frame *getReelFrameAX(uint16 frame); + void soundOnReels(uint16 reelPointer); + void rollEndCredits(); + + // from stubs.cpp + void crosshair(); + void showBlink(); + void dumpBlink(); + void dumpPointer(); + void showPointer(); + void delPointer(); + void showRyanPage(); + Frame *tempGraphics(); + Frame *tempGraphics2(); + Frame *tempGraphics3(); + void showArrows(); + void showOpBox(); + void middlePanel(); + void showDiary(); + void readMouse(); + uint16 readMouseState(); + void hangOn(uint16 frameCount); + bool quitRequested(); + void lockMon(); + uint8 *textUnder(); + void readKey(); + void findOrMake(uint8 index, uint8 value, uint8 type); + DynObject *getFreeAd(uint8 index); + DynObject *getExAd(uint8 index); + DynObject *getEitherAdCPP(); + void showWatch(); + void showTime(); + void showExit(); + void showMan(); + void panelIcons1(); + SetObject *getSetAd(uint8 index); + void *getAnyAd(uint8 *value1, uint8 *value2); + const uint8 *getTextInFile1(uint16 index); + + // from use.cpp + void placeFreeObject(uint8 index); + void removeFreeObject(uint8 index); + + // from vgafades.cpp + uint8 *mainPalette(); + uint8 *startPalette(); + uint8 *endPalette(); + void clearStartPal(); + void clearEndPal(); + void palToStartPal(); + void endPalToStart(); + void startPalToEnd(); + void palToEndPal(); + void fadeDOS(); + void doFade(); + void fadeCalculation(); + void fadeScreenUp(); + void fadeScreenUps(); + void fadeScreenUpHalf(); + void fadeScreenDown(); + void fadeScreenDowns(); + void greyscaleSum(); + void allPalette(); + void dumpCurrent(); + + // from vgagrafx.cpp + uint8 _workspace[(0x1000 + 2) * 16]; + inline uint8 *workspace() { return _workspace; } + void clearWork(); + + uint8 *mapStore(); + void panelToMap(); + void mapToPanel(); + void dumpMap(); + + void transferInv(); + + void multiGet(uint8 *dst, uint16 x, uint16 y, uint8 width, uint8 height); + void multiPut(const uint8 *src, uint16 x, uint16 y, uint8 width, uint8 height); + void multiDump(uint16 x, uint16 y, uint8 width, uint8 height); + void workToScreenCPP(); + void printUnderMon(); + void cls(); + void frameOutV(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, int16 x, int16 y); + void frameOutNm(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y); + void frameOutBh(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y); + void frameOutFx(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y); + void doShake(); + void vSync(); + void setMode(); + void showPCX(const Common::String &name); + void showFrame(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height); + void showFrame(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag); + void loadPalFromIFF(); + void createPanel(); + void createPanel2(); + void showPanel(); +}; + + +} // End of namespace DreamGen + +#endif diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index a76a2697e3..6d3da6d0f2 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -22,47 +22,13 @@ * */ - - #include "dreamgen.h" namespace DreamGen { -void DreamGenContext::alleybarksound() { - STACK_CHECK; - ax = es.word(bx+3); - _dec(ax); - _cmp(ax, 0); - if (!flags.z()) - goto nobark; - push(bx); - push(es); - al = 14; - playchannel1(); - es = pop(); - bx = pop(); - ax = 1000; -nobark: - es.word(bx+3) = ax; -} - -void DreamGenContext::intromusic() { - STACK_CHECK; -} - -void DreamGenContext::foghornsound() { - STACK_CHECK; - randomnumber(); - _cmp(al, 198); - if (!flags.z()) - return /* (nofog) */; - al = 13; - playchannel1(); -} - void DreamGenContext::receptionist() { STACK_CHECK; - checkspeed(); + checkSpeed(); if (!flags.z()) goto gotrecep; _cmp(data.byte(kCardpassflag), 1); @@ -75,7 +41,7 @@ notsetcard: _cmp(es.word(bx+3), 58); if (!flags.z()) goto notdes1; - randomnumber(); + randomNumber(); _cmp(al, 30); if (flags.c()) goto notdes2; @@ -85,7 +51,7 @@ notdes1: _cmp(es.word(bx+3), 60); if (!flags.z()) goto notdes2; - randomnumber(); + randomNumber(); _cmp(al, 240); if (flags.c()) goto gotrecep; @@ -100,8 +66,8 @@ notdes2: notendcard: _inc(es.word(bx+3)); gotrecep: - showgamereel(); - addtopeoplelist(); + showGameReel(); + addToPeopleList(); al = es.byte(bx+7); _and(al, 128); if (flags.z()) @@ -109,196 +75,15 @@ gotrecep: data.byte(kTalkedtorecep) = 1; } -void DreamGenContext::smokebloke() { - STACK_CHECK; - _cmp(data.byte(kRockstardead), 0); - if (!flags.z()) - goto notspokento; - al = es.byte(bx+7); - _and(al, 128); - if (flags.z()) - goto notspokento; - push(es); - push(bx); - al = 5; - setlocation(); - bx = pop(); - es = pop(); -notspokento: - checkspeed(); - if (!flags.z()) - goto gotsmokeb; - _cmp(es.word(bx+3), 100); - if (!flags.z()) - goto notsmokeb1; - randomnumber(); - _cmp(al, 30); - if (flags.c()) - goto notsmokeb2; - es.word(bx+3) = 96; - goto gotsmokeb; -notsmokeb1: - _cmp(es.word(bx+3), 117); - if (!flags.z()) - goto notsmokeb2; - es.word(bx+3) = 96; - goto gotsmokeb; -notsmokeb2: - _inc(es.word(bx+3)); -gotsmokeb: - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::attendant() { - STACK_CHECK; - showgamereel(); - addtopeoplelist(); - al = es.byte(bx+7); - _and(al, 128); - if (flags.z()) - return /* (nottalked) */; - data.byte(kTalkedtoattendant) = 1; -} - -void DreamGenContext::manasleep() { - STACK_CHECK; - al = es.byte(bx+7); - _and(al, 127); - es.byte(bx+7) = al; - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::eden() { - STACK_CHECK; - _cmp(data.byte(kGeneraldead), 0); - if (!flags.z()) - return /* (notinbed) */; - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::edeninbath() { - STACK_CHECK; - _cmp(data.byte(kGeneraldead), 0); - if (flags.z()) - return /* (notinbath) */; - _cmp(data.byte(kSartaindead), 0); - if (!flags.z()) - return /* (notinbath) */; - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::malefan() { - STACK_CHECK; - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::femalefan() { - STACK_CHECK; - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::louis() { - STACK_CHECK; - _cmp(data.byte(kRockstardead), 0); - if (!flags.z()) - return /* (notlouis1) */; - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::louischair() { - STACK_CHECK; - _cmp(data.byte(kRockstardead), 0); - if (flags.z()) - return /* (notlouis2) */; - checkspeed(); - if (!flags.z()) - goto notlouisanim; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 191); - if (flags.z()) - goto restartlouis; - _cmp(ax, 185); - if (flags.z()) - goto randomlouis; - es.word(bx+3) = ax; - goto notlouisanim; -randomlouis: - es.word(bx+3) = ax; - randomnumber(); - _cmp(al, 245); - if (!flags.c()) - goto notlouisanim; -restartlouis: - ax = 182; - es.word(bx+3) = ax; -notlouisanim: - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::manasleep2() { - STACK_CHECK; - al = es.byte(bx+7); - _and(al, 127); - es.byte(bx+7) = al; - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::mansatstill() { - STACK_CHECK; - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::tattooman() { - STACK_CHECK; - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::drinker() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - goto gotdrinker; - _inc(es.word(bx+3)); - _cmp(es.word(bx+3), 115); - if (!flags.z()) - goto notdrinker1; - es.word(bx+3) = 105; - goto gotdrinker; -notdrinker1: - _cmp(es.word(bx+3), 106); - if (!flags.z()) - goto gotdrinker; - randomnumber(); - _cmp(al, 3); - if (flags.c()) - goto gotdrinker; - es.word(bx+3) = 105; -gotdrinker: - showgamereel(); - addtopeoplelist(); -} - void DreamGenContext::bartender() { STACK_CHECK; - checkspeed(); + checkSpeed(); if (!flags.z()) goto gotsmoket; _cmp(es.word(bx+3), 86); if (!flags.z()) goto notsmoket1; - randomnumber(); + randomNumber(); _cmp(al, 18); if (flags.c()) goto notsmoket2; @@ -313,145 +98,13 @@ notsmoket1: notsmoket2: _inc(es.word(bx+3)); gotsmoket: - showgamereel(); + showGameReel(); _cmp(data.byte(kGunpassflag), 1); if (!flags.z()) goto notgotgun; es.byte(bx+7) = 9; notgotgun: - addtopeoplelist(); -} - -void DreamGenContext::othersmoker() { - STACK_CHECK; - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::barwoman() { - STACK_CHECK; - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::interviewer() { - STACK_CHECK; - _cmp(data.word(kReeltowatch), 68); - if (!flags.z()) - goto notgeneralstart; - _inc(es.word(bx+3)); -notgeneralstart: - _cmp(es.word(bx+3), 250); - if (flags.z()) - goto talking; - checkspeed(); - if (!flags.z()) - goto talking; - _cmp(es.word(bx+3), 259); - if (flags.z()) - goto talking; - _inc(es.word(bx+3)); -talking: - showgamereel(); -} - -void DreamGenContext::soldier1() { - STACK_CHECK; - _cmp(es.word(bx+3), 0); - if (flags.z()) - goto soldierwait; - data.word(kWatchingtime) = 10; - _cmp(es.word(bx+3), 30); - if (!flags.z()) - goto notaftersshot; - _inc(data.byte(kCombatcount)); - _cmp(data.byte(kCombatcount), 40); - if (!flags.z()) - goto gotsoldframe; - data.byte(kMandead) = 2; - goto gotsoldframe; -notaftersshot: - checkspeed(); - if (!flags.z()) - goto gotsoldframe; - _inc(es.word(bx+3)); - goto gotsoldframe; -soldierwait: - _cmp(data.byte(kLastweapon), 1); - if (!flags.z()) - goto gotsoldframe; - data.word(kWatchingtime) = 10; - _cmp(data.byte(kManspath), 2); - if (!flags.z()) - goto gotsoldframe; - _cmp(data.byte(kFacing), 4); - if (!flags.z()) - goto gotsoldframe; - _inc(es.word(bx+3)); - data.byte(kLastweapon) = -1; - data.byte(kCombatcount) = 0; -gotsoldframe: - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::rockstar() { - STACK_CHECK; - ax = es.word(bx+3); - _cmp(ax, 303); - if (flags.z()) - goto rockcombatend; - _cmp(ax, 118); - if (flags.z()) - goto rockcombatend; - checkspeed(); - if (!flags.z()) - goto rockspeed; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 118); - if (!flags.z()) - goto notbeforedead; - data.byte(kMandead) = 2; - goto gotrockframe; -notbeforedead: - _cmp(ax, 79); - if (!flags.z()) - goto gotrockframe; - _dec(ax); - _cmp(data.byte(kLastweapon), 1); - if (!flags.z()) - goto notgunonrock; - data.byte(kLastweapon) = -1; - ax = 123; - goto gotrockframe; -notgunonrock: - _inc(data.byte(kCombatcount)); - _cmp(data.byte(kCombatcount), 40); - if (!flags.z()) - goto gotrockframe; - data.byte(kCombatcount) = 0; - ax = 79; -gotrockframe: - es.word(bx+3) = ax; -rockspeed: - showgamereel(); - _cmp(es.word(bx+3), 78); - if (!flags.z()) - goto notalkrock; - addtopeoplelist(); - data.byte(kPointermode) = 2; - data.word(kWatchingtime) = 0; - return; -notalkrock: - data.word(kWatchingtime) = 2; - data.byte(kPointermode) = 0; - al = data.byte(kMapy); - es.byte(bx+2) = al; - return; -rockcombatend: - data.byte(kNewlocation) = 45; - showgamereel(); + addToPeopleList(); } void DreamGenContext::helicopter() { @@ -460,7 +113,7 @@ void DreamGenContext::helicopter() { _cmp(ax, 203); if (flags.z()) goto heliwon; - checkspeed(); + checkSpeed(); if (!flags.z()) goto helispeed; ax = es.word(bx+3); @@ -498,7 +151,7 @@ notgunonheli: gotheliframe: es.word(bx+3) = ax; helispeed: - showgamereel(); + showGameReel(); al = data.byte(kMapx); es.byte(bx+1) = al; ax = es.word(bx+3); @@ -533,30 +186,30 @@ void DreamGenContext::mugger() { goto havesetwatch; data.word(kWatchingtime) = 175*2; havesetwatch: - checkspeed(); + checkSpeed(); if (!flags.z()) goto notmugger; _inc(es.word(bx+3)); notmugger: - showgamereel(); + showGameReel(); al = data.byte(kMapx); es.byte(bx+1) = al; return; endmugger1: push(es); push(bx); - createpanel2(); - showicon(); + createPanel2(); + showIcon(); al = 41; - findpuztext(); + findPuzText(); di = 33+20; bx = 104; dl = 241; ah = 0; - printdirect(); - worktoscreen(); + printDirect(); + workToScreen(); cx = 300; - hangon(); + hangOn(); bx = pop(); es = pop(); push(es); @@ -564,43 +217,37 @@ endmugger1: es.word(bx+3) = 140; data.byte(kManspath) = 2; data.byte(kFinaldest) = 2; - findxyfrompath(); + findXYFromPath(); data.byte(kResetmanxy) = 1; al = 'W'; ah = 'E'; cl = 'T'; ch = 'A'; - findexobject(); + findExObject(); data.byte(kCommand) = al; data.byte(kObjecttype) = 4; - removeobfrominv(); + removeObFromInv(); al = 'W'; ah = 'E'; cl = 'T'; ch = 'B'; - findexobject(); + findExObject(); data.byte(kCommand) = al; data.byte(kObjecttype) = 4; - removeobfrominv(); - makemainscreen(); + removeObFromInv(); + makeMainScreen(); al = 48; bl = 68-32; bh = 54+64; cx = 70; dx = 10; - setuptimeduse(); + setupTimedUse(); data.byte(kBeenmugged) = 1; bx = pop(); es = pop(); } -void DreamGenContext::aide() { - STACK_CHECK; - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::businessman() { +void DreamGenContext::businessMan() { STACK_CHECK; data.byte(kPointermode) = 0; data.word(kWatchingtime) = 2; @@ -616,7 +263,7 @@ void DreamGenContext::businessman() { dx = 1; bl = 68; bh = 174; - setuptimeduse(); + setupTimedUse(); es = pop(); bx = pop(); ax = pop(); @@ -627,7 +274,7 @@ notfirstbiz: _cmp(ax, 49); if (flags.z()) return /* (buscombatend) */; - checkspeed(); + checkSpeed(); if (!flags.z()) goto busspeed; ax = es.word(bx+3); @@ -664,16 +311,16 @@ buscombatwon: push(bx); push(es); al = 0; - turnpathon(); + turnPathOn(); al = 1; - turnpathon(); + turnPathOn(); al = 2; - turnpathon(); + turnPathOn(); al = 3; - turnpathoff(); + turnPathOff(); data.byte(kManspath) = 5; data.byte(kFinaldest) = 5; - findxyfrompath(); + findXYFromPath(); data.byte(kResetmanxy) = 1; es = pop(); bx = pop(); @@ -682,7 +329,7 @@ buscombatwon: gotbusframe: es.word(bx+3) = ax; busspeed: - showgamereel(); + showGameReel(); al = data.byte(kMapy); es.byte(bx+2) = al; ax = es.word(bx+3); @@ -697,7 +344,7 @@ buscombatwonend: data.word(kWatchingtime) = 0; } -void DreamGenContext::poolguard() { +void DreamGenContext::poolGuard() { STACK_CHECK; ax = es.word(bx+3); _cmp(ax, 214); @@ -713,9 +360,9 @@ void DreamGenContext::poolguard() { if (!flags.z()) goto notfirstpool; al = 0; - turnpathon(); + turnPathOn(); notfirstpool: - checkspeed(); + checkSpeed(); if (!flags.z()) goto guardspeed; ax = es.word(bx+3); @@ -759,7 +406,7 @@ notgunonpool: gotguardframe: es.word(bx+3) = ax; guardspeed: - showgamereel(); + showGameReel(); ax = es.word(bx+3); _cmp(ax, 121); if (flags.z()) @@ -778,12 +425,12 @@ combatover1: data.word(kWatchingtime) = 0; data.byte(kPointermode) = 0; al = 0; - turnpathon(); + turnPathOn(); al = 1; - turnpathoff(); + turnPathOff(); return; combatover2: - showgamereel(); + showGameReel(); data.word(kWatchingtime) = 2; data.byte(kPointermode) = 0; _inc(data.byte(kCombatcount)); @@ -794,40 +441,6 @@ combatover2: data.byte(kMandead) = 2; } -void DreamGenContext::security() { - STACK_CHECK; - _cmp(es.word(bx+3), 32); - if (flags.z()) - goto securwait; - _cmp(es.word(bx+3), 69); - if (!flags.z()) - goto notaftersec; - return; -notaftersec: - data.word(kWatchingtime) = 10; - checkspeed(); - if (!flags.z()) - goto gotsecurframe; - _inc(es.word(bx+3)); - goto gotsecurframe; -securwait: - _cmp(data.byte(kLastweapon), 1); - if (!flags.z()) - goto gotsecurframe; - data.word(kWatchingtime) = 10; - _cmp(data.byte(kManspath), 9); - if (!flags.z()) - goto gotsecurframe; - _cmp(data.byte(kFacing), 0); - if (!flags.z()) - goto gotsecurframe; - data.byte(kLastweapon) = -1; - _inc(es.word(bx+3)); -gotsecurframe: - showgamereel(); - addtopeoplelist(); -} - void DreamGenContext::heavy() { STACK_CHECK; al = es.byte(bx+7); @@ -847,7 +460,7 @@ void DreamGenContext::heavy() { data.byte(kMandead) = 2; goto gotheavyframe; notafterhshot: - checkspeed(); + checkSpeed(); if (!flags.z()) goto gotheavyframe; _inc(es.word(bx+3)); @@ -866,650 +479,13 @@ heavywait: _inc(es.word(bx+3)); data.byte(kCombatcount) = 0; gotheavyframe: - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::bossman() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - goto notboss; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 4); - if (flags.z()) - goto firstdes; - _cmp(ax, 20); - if (flags.z()) - goto secdes; - _cmp(ax, 41); - if (!flags.z()) - goto gotallboss; - ax = 0; - _inc(data.byte(kGunpassflag)); - es.byte(bx+7) = 10; - goto gotallboss; -firstdes: - _cmp(data.byte(kGunpassflag), 1); - if (flags.z()) - goto gotallboss; - push(ax); - randomnumber(); - cl = al; - ax = pop(); - _cmp(cl, 10); - if (flags.c()) - goto gotallboss; - ax = 0; - goto gotallboss; -secdes: - _cmp(data.byte(kGunpassflag), 1); - if (flags.z()) - goto gotallboss; - ax = 0; -gotallboss: - es.word(bx+3) = ax; -notboss: - showgamereel(); - addtopeoplelist(); - al = es.byte(bx+7); - _and(al, 128); - if (flags.z()) - return /* (nottalkedboss) */; - data.byte(kTalkedtoboss) = 1; -} - -void DreamGenContext::gamer() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - goto gamerfin; -gameragain: - randomnum1(); - _and(al, 7); - _cmp(al, 5); - if (!flags.c()) - goto gameragain; - _add(al, 20); - _cmp(al, es.byte(bx+3)); - if (flags.z()) - goto gameragain; - ah = 0; - es.word(bx+3) = ax; -gamerfin: - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::sparkydrip() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - return /* (cantdrip) */; - al = 14; - ah = 0; - playchannel0(); -} - -void DreamGenContext::carparkdrip() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - return /* (cantdrip2) */; - al = 14; - playchannel1(); -} - -void DreamGenContext::keeper() { - STACK_CHECK; - _cmp(data.byte(kKeeperflag), 0); - if (!flags.z()) - goto notwaiting; - _cmp(data.word(kReeltowatch), 190); - if (flags.c()) - return /* (waiting) */; - _inc(data.byte(kKeeperflag)); - ah = es.byte(bx+7); - _and(ah, 127); - _cmp(ah, data.byte(kDreamnumber)); - if (flags.z()) - return /* (notdiff) */; - al = data.byte(kDreamnumber); - es.byte(bx+7) = al; - return; -notwaiting: - addtopeoplelist(); - showgamereel(); -} - -void DreamGenContext::candles1() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - goto candle1; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 44); - if (!flags.z()) - goto notendcandle1; - ax = 39; -notendcandle1: - es.word(bx+3) = ax; -candle1: - showgamereel(); -} - -void DreamGenContext::smallcandle() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - goto smallcandlef; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 37); - if (!flags.z()) - goto notendsmallcandle; - ax = 25; -notendsmallcandle: - es.word(bx+3) = ax; -smallcandlef: - showgamereel(); -} - -void DreamGenContext::intromagic1() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - goto introm1fin; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 145); - if (!flags.z()) - goto gotintrom1; - ax = 121; -gotintrom1: - es.word(bx+3) = ax; - _cmp(ax, 121); - if (!flags.z()) - goto introm1fin; - _inc(data.byte(kIntrocount)); - push(es); - push(bx); - intro1text(); - bx = pop(); - es = pop(); - _cmp(data.byte(kIntrocount), 8); - if (!flags.z()) - goto introm1fin; - _add(data.byte(kMapy), 10); - data.byte(kNowinnewroom) = 1; -introm1fin: - showgamereel(); -} - -void DreamGenContext::candles() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - goto candlesfin; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 167); - if (!flags.z()) - goto gotcandles; - ax = 162; -gotcandles: - es.word(bx+3) = ax; -candlesfin: - showgamereel(); -} - -void DreamGenContext::candles2() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - goto candles2fin; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 238); - if (!flags.z()) - goto gotcandles2; - ax = 233; -gotcandles2: - es.word(bx+3) = ax; -candles2fin: - showgamereel(); -} - -void DreamGenContext::gates() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - goto gatesfin; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 116); - if (!flags.z()) - goto notbang; - push(ax); - push(bx); - push(es); - al = 17; - playchannel1(); - es = pop(); - bx = pop(); - ax = pop(); -notbang: - _cmp(ax, 110); - if (flags.c()) - goto slowgates; - es.byte(bx+5) = 2; -slowgates: - _cmp(ax, 120); - if (!flags.z()) - goto gotgates; - data.byte(kGetback) = 1; - ax = 119; -gotgates: - es.word(bx+3) = ax; - push(es); - push(bx); - intro3text(); - bx = pop(); - es = pop(); -gatesfin: - showgamereel(); -} - -void DreamGenContext::intromagic2() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - goto introm2fin; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 216); - if (!flags.z()) - goto gotintrom2; - ax = 192; -gotintrom2: - es.word(bx+3) = ax; -introm2fin: - showgamereel(); -} - -void DreamGenContext::intromagic3() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - goto introm3fin; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 218); - if (!flags.z()) - goto gotintrom3; - data.byte(kGetback) = 1; -gotintrom3: - es.word(bx+3) = ax; -introm3fin: - showgamereel(); - al = data.byte(kMapx); - es.byte(bx+1) = al; -} - -void DreamGenContext::intromonks1() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - goto intromonk1fin; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 80); - if (!flags.z()) - goto notendmonk1; - _add(data.byte(kMapy), 10); - data.byte(kNowinnewroom) = 1; - showgamereel(); - return; -notendmonk1: - _cmp(ax, 30); - if (!flags.z()) - goto gotintromonk1; - _sub(data.byte(kMapy), 10); - data.byte(kNowinnewroom) = 1; - ax = 51; -gotintromonk1: - es.word(bx+3) = ax; - _cmp(ax, 5); - if (flags.z()) - goto waitstep; - _cmp(ax, 15); - if (flags.z()) - goto waitstep; - _cmp(ax, 25); - if (flags.z()) - goto waitstep; - _cmp(ax, 61); - if (flags.z()) - goto waitstep; - _cmp(ax, 71); - if (flags.z()) - goto waitstep; - goto intromonk1fin; -waitstep: - push(es); - push(bx); - intro2text(); - bx = pop(); - es = pop(); - es.byte(bx+6) = -20; -intromonk1fin: - showgamereel(); - al = data.byte(kMapy); - es.byte(bx+2) = al; -} - -void DreamGenContext::intromonks2() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - goto intromonk2fin; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 87); - if (!flags.z()) - goto nottalk1; - _inc(data.byte(kIntrocount)); - push(es); - push(bx); - monks2text(); - bx = pop(); - es = pop(); - _cmp(data.byte(kIntrocount), 19); - if (!flags.z()) - goto notlasttalk1; - ax = 87; - goto gotintromonk2; -notlasttalk1: - ax = 74; - goto gotintromonk2; -nottalk1: - _cmp(ax, 110); - if (!flags.z()) - goto notraisearm; - _inc(data.byte(kIntrocount)); - push(es); - push(bx); - monks2text(); - bx = pop(); - es = pop(); - _cmp(data.byte(kIntrocount), 35); - if (!flags.z()) - goto notlastraise; - ax = 111; - goto gotintromonk2; -notlastraise: - ax = 98; - goto gotintromonk2; -notraisearm: - _cmp(ax, 176); - if (!flags.z()) - goto notendmonk2; - data.byte(kGetback) = 1; - goto gotintromonk2; -notendmonk2: - _cmp(ax, 125); - if (!flags.z()) - goto gotintromonk2; - ax = 140; -gotintromonk2: - es.word(bx+3) = ax; -intromonk2fin: - showgamereel(); -} - -void DreamGenContext::handclap() { - STACK_CHECK; -} - -void DreamGenContext::monks2text() { - STACK_CHECK; - _cmp(data.byte(kIntrocount), 1); - if (!flags.z()) - goto notmonk2text1; - al = 8; - bl = 36; - bh = 160; - cx = 100; - goto gotmonks2text; -notmonk2text1: - _cmp(data.byte(kIntrocount), 4); - if (!flags.z()) - goto notmonk2text2; - al = 9; - bl = 36; - bh = 160; - cx = 100; - goto gotmonks2text; -notmonk2text2: - _cmp(data.byte(kIntrocount), 7); - if (!flags.z()) - goto notmonk2text3; - al = 10; - bl = 36; - bh = 160; - cx = 100; - goto gotmonks2text; -notmonk2text3: - _cmp(data.byte(kIntrocount), 10); - if (!flags.z()) - goto notmonk2text4; - data.byte(kIntrocount) = 12; - al = 11; - bl = 0; - bh = 105; - cx = 100; - goto gotmonks2text; -notmonk2text4: - _cmp(data.byte(kIntrocount), 13); - if (!flags.z()) - goto notmonk2text5; - data.byte(kIntrocount) = 17; - return; - al = 12; - bl = 0; - bh = 120; - cx = 100; - goto gotmonks2text; -notmonk2text5: - _cmp(data.byte(kIntrocount), 16); - if (!flags.z()) - goto notmonk2text6; - al = 13; - bl = 0; - bh = 135; - cx = 100; - goto gotmonks2text; -notmonk2text6: - _cmp(data.byte(kIntrocount), 19); - if (!flags.z()) - goto notmonk2text7; - al = 14; - bl = 36; - bh = 160; - cx = 100; - dx = 1; - ah = 82; - { setuptimedtemp(); return; }; -notmonk2text7: - _cmp(data.byte(kIntrocount), 22); - if (!flags.z()) - goto notmonk2text8; - al = 15; - bl = 36; - bh = 160; - cx = 100; - goto gotmonks2text; -notmonk2text8: - _cmp(data.byte(kIntrocount), 25); - if (!flags.z()) - goto notmonk2text9; - al = 16; - bl = 36; - bh = 160; - cx = 100; - goto gotmonks2text; -notmonk2text9: - _cmp(data.byte(kIntrocount), 27); - if (!flags.z()) - goto notmonk2text10; - al = 17; - bl = 36; - bh = 160; - cx = 100; - goto gotmonks2text; -notmonk2text10: - _cmp(data.byte(kIntrocount), 31); - if (!flags.z()) - return /* (notmonk2text11) */; - al = 18; - bl = 36; - bh = 160; - cx = 100; - goto gotmonks2text; - return; -gotmonks2text: - dx = 1; - cx = 120; - ah = 82; - setuptimedtemp(); -} - -void DreamGenContext::intro1text() { - STACK_CHECK; - _cmp(data.byte(kIntrocount), 2); - if (!flags.z()) - goto notintro1text1; - al = 40; - bl = 34; - bh = 130; - cx = 90; - goto gotintro1text; -notintro1text1: - _cmp(data.byte(kIntrocount), 4); - if (!flags.z()) - goto notintro1text2; - al = 41; - bl = 34; - bh = 130; - cx = 90; - goto gotintro1text; -notintro1text2: - _cmp(data.byte(kIntrocount), 6); - if (!flags.z()) - return /* (notintro1text3) */; - al = 42; - bl = 34; - bh = 130; - cx = 90; - goto gotintro1text; - return; -gotintro1text: - dx = 1; - ah = 82; - _cmp(data.byte(kCh1playing), 255); - if (flags.z()) - goto oktalk2; - _dec(data.byte(kIntrocount)); - return; -oktalk2: - setuptimedtemp(); -} - -void DreamGenContext::intro2text() { - STACK_CHECK; - _cmp(ax, 5); - if (!flags.z()) - goto notintro2text1; - al = 43; - bl = 34; - bh = 40; - cx = 90; - goto gotintro2text; -notintro2text1: - _cmp(ax, 15); - if (!flags.z()) - return /* (notintro2text2) */; - al = 44; - bl = 34; - bh = 40; - cx = 90; - goto gotintro2text; - return; -gotintro2text: - dx = 1; - ah = 82; - setuptimedtemp(); -} - -void DreamGenContext::intro3text() { - STACK_CHECK; - _cmp(ax, 107); - if (!flags.z()) - goto notintro3text1; - al = 45; - bl = 36; - bh = 56; - cx = 100; - goto gotintro3text; -notintro3text1: - _cmp(ax, 108); - if (!flags.z()) - return /* (notintro3text2) */; - al = 46; - bl = 36; - bh = 56; - cx = 100; - goto gotintro3text; - return; -gotintro3text: - dx = 1; - ah = 82; - setuptimedtemp(); -} - -void DreamGenContext::monkandryan() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - goto notmonkryan; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 83); - if (!flags.z()) - goto gotmonkryan; - _inc(data.byte(kIntrocount)); - push(es); - push(bx); - textformonk(); - bx = pop(); - es = pop(); - ax = 77; - _cmp(data.byte(kIntrocount), 57); - if (!flags.z()) - goto gotmonkryan; - data.byte(kGetback) = 1; - return; -gotmonkryan: - es.word(bx+3) = ax; -notmonkryan: - showgamereel(); + showGameReel(); + addToPeopleList(); } -void DreamGenContext::endgameseq() { +void DreamGenContext::endGameSeq() { STACK_CHECK; - checkspeed(); + checkSpeed(); if (!flags.z()) goto notendseq; ax = es.word(bx+3); @@ -1523,7 +499,7 @@ void DreamGenContext::endgameseq() { _inc(data.byte(kIntrocount)); push(es); push(bx); - textforend(); + textForEnd(); bx = pop(); es = pop(); ax = 50; @@ -1535,7 +511,7 @@ gotendseq: push(es); push(bx); push(ax); - fadescreendownhalf(); + fadeScreenDownHalf(); ax = pop(); bx = pop(); es = pop(); @@ -1547,7 +523,7 @@ notfadedown: push(es); push(bx); push(ax); - fadescreendowns(); + fadeScreenDowns(); data.byte(kVolumeto) = 7; data.byte(kVolumedirection) = 1; ax = pop(); @@ -1559,7 +535,7 @@ notfadeend: goto notendseq; data.byte(kGetback) = 1; notendseq: - showgamereel(); + showGameReel(); al = data.byte(kMapy); es.byte(bx+2) = al; ax = es.word(bx+3); @@ -1567,496 +543,16 @@ notendseq: if (!flags.z()) return /* (notendcreds) */; es.word(bx+3) = 146; - rollendcredits(); -} - -void DreamGenContext::rollendcredits() { - STACK_CHECK; - al = 16; - ah = 255; - playchannel0(); - data.byte(kVolume) = 7; - data.byte(kVolumeto) = 0; - data.byte(kVolumedirection) = -1; - cl = 160; - ch = 160; - di = 75; - bx = 20; - ds = data.word(kMapstore); - si = 0; - multiget(); - es = data.word(kTextfile1); - si = 3*2; - ax = es.word(si); - si = ax; - _add(si, (66*2)); - cx = 254; -endcredits1: - push(cx); - bx = 10; - cx = data.word(kLinespacing); -endcredits2: - push(cx); - push(si); - push(di); - push(es); - push(bx); - vsync(); - cl = 160; - ch = 160; - di = 75; - bx = 20; - ds = data.word(kMapstore); - si = 0; - multiput(); - vsync(); - bx = pop(); - es = pop(); - di = pop(); - si = pop(); - push(si); - push(di); - push(es); - push(bx); - cx = 18; -onelot: - push(cx); - di = 75; - dx = 161; - ax = 0; - printdirect(); - _add(bx, data.word(kLinespacing)); - cx = pop(); - if (--cx) - goto onelot; - vsync(); - cl = 160; - ch = 160; - di = 75; - bx = 20; - multidump(); - bx = pop(); - es = pop(); - di = pop(); - si = pop(); - cx = pop(); - _dec(bx); - if (--cx) - goto endcredits2; - cx = pop(); -looknext: - al = es.byte(si); - _inc(si); - _cmp(al, ':'); - if (flags.z()) - goto gotnext; - _cmp(al, 0); - if (flags.z()) - goto gotnext; - goto looknext; -gotnext: - if (--cx) - goto endcredits1; - cx = 100; - hangon(); - paneltomap(); - fadescreenuphalf(); -} - -void DreamGenContext::priest() { - STACK_CHECK; - _cmp(es.word(bx+3), 8); - if (flags.z()) - return /* (priestspoken) */; - data.byte(kPointermode) = 0; - data.word(kWatchingtime) = 2; - checkspeed(); - if (!flags.z()) - return /* (priestwait) */; - _inc(es.word(bx+3)); - push(es); - push(bx); - priesttext(); - bx = pop(); - es = pop(); -} - -void DreamGenContext::madmanstelly() { - STACK_CHECK; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 307); - if (!flags.z()) - goto notendtelly; - ax = 300; -notendtelly: - es.word(bx+3) = ax; - showgamereel(); -} - -void DreamGenContext::priesttext() { - STACK_CHECK; - _cmp(es.word(bx+3), 2); - if (flags.c()) - return /* (nopriesttext) */; - _cmp(es.word(bx+3), 7); - if (!flags.c()) - return /* (nopriesttext) */; - al = es.byte(bx+3); - _and(al, 1); - if (!flags.z()) - return /* (nopriesttext) */; - al = es.byte(bx+3); - _shr(al, 1); - _add(al, 50); - bl = 72; - bh = 80; - cx = 54; - dx = 1; - setuptimeduse(); -} - -void DreamGenContext::textforend() { - STACK_CHECK; - _cmp(data.byte(kIntrocount), 20); - if (!flags.z()) - goto notendtext1; - al = 0; - bl = 34; - bh = 20; - cx = 60; - goto gotendtext; -notendtext1: - _cmp(data.byte(kIntrocount), 50); - if (!flags.z()) - goto notendtext2; - al = 1; - bl = 34; - bh = 20; - cx = 60; - goto gotendtext; -notendtext2: - _cmp(data.byte(kIntrocount), 85); - if (!flags.z()) - return /* (notendtext3) */; - al = 2; - bl = 34; - bh = 20; - cx = 60; - goto gotendtext; - return; -gotendtext: - dx = 1; - ah = 83; - setuptimedtemp(); + rollEndCredits(); } -void DreamGenContext::textformonk() { - STACK_CHECK; - _cmp(data.byte(kIntrocount), 1); - if (!flags.z()) - goto notmonktext1; - al = 19; - bl = 68; - bh = 154; - cx = 120; - goto gotmonktext; -notmonktext1: - _cmp(data.byte(kIntrocount), 5); - if (!flags.z()) - goto notmonktext2; - al = 20; - bl = 68; - bh = 38; - cx = 120; - goto gotmonktext; -notmonktext2: - _cmp(data.byte(kIntrocount), 9); - if (!flags.z()) - goto notmonktext3; - al = 21; - bl = 48; - bh = 154; - cx = 120; - goto gotmonktext; -notmonktext3: - _cmp(data.byte(kIntrocount), 13); - if (!flags.z()) - goto notmonktext4; - al = 22; - bl = 68; - bh = 38; - cx = 120; - goto gotmonktext; -notmonktext4: - _cmp(data.byte(kIntrocount), 15); - if (!flags.z()) - goto notmonktext5; - al = 23; - bl = 68; - bh = 154; - cx = 120; - goto gotmonktext; -notmonktext5: - _cmp(data.byte(kIntrocount), 21); - if (!flags.z()) - goto notmonktext6; - al = 24; - bl = 68; - bh = 38; - cx = 120; - goto gotmonktext; -notmonktext6: - _cmp(data.byte(kIntrocount), 25); - if (!flags.z()) - goto notmonktext7; - al = 25; - bl = 68; - bh = 154; - cx = 120; - goto gotmonktext; -notmonktext7: - _cmp(data.byte(kIntrocount), 29); - if (!flags.z()) - goto notmonktext8; - al = 26; - bl = 68; - bh = 38; - cx = 120; - goto gotmonktext; -notmonktext8: - _cmp(data.byte(kIntrocount), 33); - if (!flags.z()) - goto notmonktext9; - al = 27; - bl = 68; - bh = 154; - cx = 120; - goto gotmonktext; -notmonktext9: - _cmp(data.byte(kIntrocount), 37); - if (!flags.z()) - goto notmonktext10; - al = 28; - bl = 68; - bh = 154; - cx = 120; - goto gotmonktext; -notmonktext10: - _cmp(data.byte(kIntrocount), 41); - if (!flags.z()) - goto notmonktext11; - al = 29; - bl = 68; - bh = 38; - cx = 120; - goto gotmonktext; -notmonktext11: - _cmp(data.byte(kIntrocount), 45); - if (!flags.z()) - goto notmonktext12; - al = 30; - bl = 68; - bh = 154; - cx = 120; - goto gotmonktext; -notmonktext12: - _cmp(data.byte(kIntrocount), 52); - if (!flags.z()) - goto notmonktext13; - al = 31; - bl = 68; - bh = 154; - cx = 220; - goto gotmonktext; -notmonktext13: - _cmp(data.byte(kIntrocount), 53); - if (!flags.z()) - return /* (notendtitles) */; - fadescreendowns(); - data.byte(kVolumeto) = 7; - data.byte(kVolumedirection) = 1; - return; -gotmonktext: - dx = 1; - ah = 82; - _cmp(data.byte(kCh1playing), 255); - if (flags.z()) - goto oktalk; - _dec(data.byte(kIntrocount)); - return; -oktalk: - setuptimedtemp(); -} - -void DreamGenContext::drunk() { - STACK_CHECK; - _cmp(data.byte(kGeneraldead), 0); - if (!flags.z()) - return /* (trampgone) */; - al = es.byte(bx+7); - _and(al, 127); - es.byte(bx+7) = al; - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::advisor() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - goto noadvisor; - goto noadvisor; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 123); - if (!flags.z()) - goto notendadvis; - ax = 106; - goto gotadvframe; -notendadvis: - _cmp(ax, 108); - if (!flags.z()) - goto gotadvframe; - push(ax); - randomnumber(); - cl = al; - ax = pop(); - _cmp(cl, 3); - if (flags.c()) - goto gotadvframe; - ax = 106; -gotadvframe: - es.word(bx+3) = ax; -noadvisor: - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::copper() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - goto nocopper; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 94); - if (!flags.z()) - goto notendcopper; - ax = 64; - goto gotcopframe; -notendcopper: - _cmp(ax, 81); - if (flags.z()) - goto mightwait; - _cmp(ax, 66); - if (!flags.z()) - goto gotcopframe; -mightwait: - push(ax); - randomnumber(); - cl = al; - ax = pop(); - _cmp(cl, 7); - if (flags.c()) - goto gotcopframe; - _dec(ax); -gotcopframe: - es.word(bx+3) = ax; -nocopper: - showgamereel(); - addtopeoplelist(); -} - -void DreamGenContext::sparky() { - STACK_CHECK; - _cmp(data.word(kCard1money), 0); - if (flags.z()) - goto animsparky; - es.byte(bx+7) = 3; - goto animsparky; -animsparky: - checkspeed(); - if (!flags.z()) - goto finishsparky; - _cmp(es.word(bx+3), 34); - if (!flags.z()) - goto notsparky1; - randomnumber(); - _cmp(al, 30); - if (flags.c()) - goto dosparky; - es.word(bx+3) = 27; - goto finishsparky; -notsparky1: - _cmp(es.word(bx+3), 48); - if (!flags.z()) - goto dosparky; - es.word(bx+3) = 27; - goto finishsparky; -dosparky: - _inc(es.word(bx+3)); -finishsparky: - showgamereel(); - addtopeoplelist(); - al = es.byte(bx+7); - _and(al, 128); - if (flags.z()) - return /* (nottalkedsparky) */; - data.byte(kTalkedtosparky) = 1; -} - -void DreamGenContext::train() { - STACK_CHECK; - return; - ax = es.word(bx+3); - _cmp(ax, 21); - if (!flags.c()) - goto notrainyet; - _inc(ax); - goto gottrainframe; -notrainyet: - randomnumber(); - _cmp(al, 253); - if (flags.c()) - return /* (notrainatall) */; - _cmp(data.byte(kManspath), 5); - if (!flags.z()) - return /* (notrainatall) */; - _cmp(data.byte(kFinaldest), 5); - if (!flags.z()) - return /* (notrainatall) */; - ax = 5; -gottrainframe: - es.word(bx+3) = ax; - showgamereel(); -} - -void DreamGenContext::checkspeed() { - STACK_CHECK; - _cmp(data.byte(kLastweapon), -1); - if (!flags.z()) - goto forcenext; - _inc(es.byte(bx+6)); - al = es.byte(bx+6); - _cmp(al, es.byte(bx+5)); - if (!flags.z()) - return /* (notspeed) */; - al = 0; - es.byte(bx+6) = al; - _cmp(al, al); - return; -forcenext: - _cmp(al, al); -} - -void DreamGenContext::checkforexit() { +void DreamGenContext::checkForExit() { STACK_CHECK; cl = data.byte(kRyanx); _add(cl, 12); ch = data.byte(kRyany); _add(ch, 12); - checkone(); + checkOne(); data.byte(kLastflag) = cl; data.byte(kLastflagex) = ch; data.byte(kFlagx) = dl; @@ -2083,7 +579,7 @@ notnewdirect: ah = 'E'; cl = 'T'; ch = 'A'; - isryanholding(); + isRyanHolding(); bx = pop(); if (flags.z()) goto noshoe1; @@ -2094,7 +590,7 @@ noshoe1: ah = 'E'; cl = 'T'; ch = 'B'; - isryanholding(); + isRyanHolding(); bx = pop(); if (flags.z()) goto noshoe2; @@ -2113,7 +609,7 @@ notravmessage: dx = 10; bl = 68; bh = 64; - setuptimeduse(); + setupTimedUse(); al = data.byte(kFacing); _add(al, 4); _and(al, 7); @@ -2130,28 +626,28 @@ notleave: _test(al, 4); if (flags.z()) goto notaleft; - adjustleft(); + adjustLeft(); return; notaleft: _test(al, 2); if (flags.z()) goto notaright; - adjustright(); + adjustRight(); return; notaright: _test(al, 8); if (flags.z()) goto notadown; - adjustdown(); + adjustDown(); return; notadown: _test(al, 16); if (flags.z()) return /* (notanup) */; - adjustup(); + adjustUp(); } -void DreamGenContext::adjustdown() { +void DreamGenContext::adjustDown() { STACK_CHECK; push(es); push(bx); @@ -2165,7 +661,7 @@ void DreamGenContext::adjustdown() { es = pop(); } -void DreamGenContext::adjustup() { +void DreamGenContext::adjustUp() { STACK_CHECK; push(es); push(bx); @@ -2179,7 +675,7 @@ void DreamGenContext::adjustup() { es = pop(); } -void DreamGenContext::adjustleft() { +void DreamGenContext::adjustLeft() { STACK_CHECK; push(es); push(bx); @@ -2194,7 +690,7 @@ void DreamGenContext::adjustleft() { es = pop(); } -void DreamGenContext::adjustright() { +void DreamGenContext::adjustRight() { STACK_CHECK; push(es); push(bx); @@ -2224,14 +720,14 @@ void DreamGenContext::reminders() { ah = 'K'; cl = 'E'; ch = 'Y'; - isryanholding(); + isRyanHolding(); if (flags.z()) goto forgotone; al = 'C'; ah = 'S'; cl = 'H'; ch = 'R'; - findexobject(); + findExObject(); _cmp(al, (114)); if (flags.z()) goto forgotone; @@ -2259,360 +755,10 @@ forgotone: bh = 70; cx = 48; dx = 8; - setuptimeduse(); -} - -void DreamGenContext::initrain() { - STACK_CHECK; - es = data.word(kBuffers); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)); - bx = offset_rainlocations; -checkmorerain: - al = cs.byte(bx); - _cmp(al, 255); - if (flags.z()) - goto finishinitrain; - _cmp(al, data.byte(kReallocation)); - if (!flags.z()) - goto checkrain; - al = cs.byte(bx+1); - _cmp(al, data.byte(kMapx)); - if (!flags.z()) - goto checkrain; - al = cs.byte(bx+2); - _cmp(al, data.byte(kMapy)); - if (!flags.z()) - goto checkrain; - al = cs.byte(bx+3); - data.byte(kRainspace) = al; - goto dorain; -checkrain: - _add(bx, 4); - goto checkmorerain; -dorain: - cx = 4; -initraintop: - randomnumber(); - _and(al, 31); - _add(al, 3); - _cmp(al, data.byte(kRainspace)); - if (!flags.c()) - goto initraintop; - _add(cl, al); - _cmp(cl, data.byte(kMapxsize)); - if (!flags.c()) - goto initrainside; - push(cx); - splitintolines(); - cx = pop(); - goto initraintop; -initrainside: - cl = data.byte(kMapxsize); - _dec(cl); -initrainside2: - randomnumber(); - _and(al, 31); - _add(al, 3); - _cmp(al, data.byte(kRainspace)); - if (!flags.c()) - goto initrainside2; - _add(ch, al); - _cmp(ch, data.byte(kMapysize)); - if (!flags.c()) - goto finishinitrain; - push(cx); - splitintolines(); - cx = pop(); - goto initrainside2; -finishinitrain: - al = 255; - _stosb(); -} - -void DreamGenContext::splitintolines() { - STACK_CHECK; -lookforlinestart: - getblockofpixel(); - _cmp(al, 0); - if (!flags.z()) - goto foundlinestart; - _dec(cl); - _inc(ch); - _cmp(cl, 0); - if (flags.z()) - return /* (endofthisline) */; - _cmp(ch, data.byte(kMapysize)); - if (!flags.c()) - return /* (endofthisline) */; - goto lookforlinestart; -foundlinestart: - es.word(di) = cx; - bh = 1; -lookforlineend: - getblockofpixel(); - _cmp(al, 0); - if (flags.z()) - goto foundlineend; - _dec(cl); - _inc(ch); - _cmp(cl, 0); - if (flags.z()) - goto foundlineend; - _cmp(ch, data.byte(kMapysize)); - if (!flags.c()) - goto foundlineend; - _inc(bh); - goto lookforlineend; -foundlineend: - push(cx); - es.byte(di+2) = bh; - randomnumber(); - es.byte(di+3) = al; - randomnumber(); - es.byte(di+4) = al; - randomnumber(); - _and(al, 3); - _add(al, 4); - es.byte(di+5) = al; - _add(di, 6); - cx = pop(); - _cmp(cl, 0); - if (flags.z()) - return /* (endofthisline) */; - _cmp(ch, data.byte(kMapysize)); - if (!flags.c()) - return /* (endofthisline) */; - goto lookforlinestart; -} - -void DreamGenContext::liftnoise() { - STACK_CHECK; - _cmp(data.byte(kReallocation), 5); - if (flags.z()) - goto hissnoise; - _cmp(data.byte(kReallocation), 21); - if (flags.z()) - goto hissnoise; - playchannel1(); - return; -hissnoise: - al = 13; - playchannel1(); -} - -void DreamGenContext::random() { - STACK_CHECK; - randomnum1(); - push(di); - _and(ax, 7); - _add(di, 18); - _add(di, ax); - al = ds.byte(di); - di = pop(); - es.byte(bx+15) = al; -} - -void DreamGenContext::steady() { - STACK_CHECK; - al = ds.byte(di+18); - ds.byte(di+17) = al; - es.byte(bx+15) = al; -} - -void DreamGenContext::constant() { - STACK_CHECK; - _inc(es.byte(bx+19)); - cl = es.byte(bx+19); - ch = 0; - _add(di, cx); - _cmp(ds.byte(di+18), 255); - if (!flags.z()) - goto gotconst; - _sub(di, cx); - cx = 0; - es.byte(bx+19) = cl; -gotconst: - al = ds.byte(di+18); - _sub(di, cx); - es.byte(bx+15) = al; - ds.byte(di+17) = al; -} - -void DreamGenContext::reelsonscreen() { - STACK_CHECK; - reconstruct(); - updatepeople(); - watchreel(); - showrain(); - usetimedtext(); -} - -void DreamGenContext::soundonreels() { - STACK_CHECK; - bl = data.byte(kReallocation); - _add(bl, bl); - _xor(bh, bh); - _add(bx, 1214); - si = cs.word(bx); -reelsoundloop: - al = cs.byte(si); - _cmp(al, 255); - if (flags.z()) - goto endreelsound; - ax = cs.word(si+1); - _cmp(ax, data.word(kReelpointer)); - if (!flags.z()) - goto skipreelsound; - _cmp(ax, data.word(kLastsoundreel)); - if (flags.z()) - goto skipreelsound; - data.word(kLastsoundreel) = ax; - al = cs.byte(si); - _cmp(al, 64); - if (flags.c()) - { playchannel1(); return; }; - _cmp(al, 128); - if (flags.c()) - goto channel0once; - _and(al, 63); - ah = 255; - { playchannel0(); return; }; -channel0once: - _and(al, 63); - ah = 0; - { playchannel0(); return; }; -skipreelsound: - _add(si, 3); - goto reelsoundloop; -endreelsound: - ax = data.word(kLastsoundreel); - _cmp(ax, data.word(kReelpointer)); - if (flags.z()) - return /* (nochange2) */; - data.word(kLastsoundreel) = -1; -} - -void DreamGenContext::reconstruct() { - STACK_CHECK; - _cmp(data.byte(kHavedoneobs), 0); - if (flags.z()) - return /* (noneedtorecon) */; - data.byte(kNewobs) = 1; - drawfloor(); - spriteupdate(); - printsprites(); - _cmp(data.byte(kForeignrelease), 0); - if (flags.z()) - goto notfudge; - _cmp(data.byte(kReallocation), 20); - if (!flags.z()) - goto notfudge; - undertextline(); -notfudge: - data.byte(kHavedoneobs) = 0; -} - -void DreamGenContext::deleverything() { - STACK_CHECK; - al = data.byte(kMapysize); - ah = 0; - _add(ax, data.word(kMapoffsety)); - _cmp(ax, 182); - if (!flags.c()) - goto bigroom; - maptopanel(); - return; -bigroom: - _sub(data.byte(kMapysize), 8); - maptopanel(); - _add(data.byte(kMapysize), 8); -} - -void DreamGenContext::loadpalfromiff() { - STACK_CHECK; - dx = 2481; - openfile(); - cx = 2000; - ds = data.word(kMapstore); - dx = 0; - readfromfile(); - closefile(); - es = data.word(kBuffers); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); - ds = data.word(kMapstore); - si = 0x30; - cx = 768; -palloop: - _lodsb(); - _shr(al, 1); - _shr(al, 1); - _cmp(data.byte(kBrightness), 1); - if (!flags.z()) - goto nought; - _cmp(al, 0); - if (flags.z()) - goto nought; - ah = al; - _shr(ah, 1); - _add(al, ah); - _shr(ah, 1); - _add(al, ah); - _cmp(al, 64); - if (flags.c()) - goto nought; - al = 63; -nought: - _stosb(); - if (--cx) - goto palloop; -} - -void DreamGenContext::createpanel() { - STACK_CHECK; - di = 0; - bx = 8; - ds = data.word(kIcons2); - al = 0; - ah = 2; - showframe(); - di = 160; - bx = 8; - ds = data.word(kIcons2); - al = 0; - ah = 2; - showframe(); - di = 0; - bx = 104; - ds = data.word(kIcons2); - al = 0; - ah = 2; - showframe(); - di = 160; - bx = 104; - ds = data.word(kIcons2); - al = 0; - ah = 2; - showframe(); -} - -void DreamGenContext::createpanel2() { - STACK_CHECK; - createpanel(); - di = 0; - bx = 0; - ds = data.word(kIcons2); - al = 5; - ah = 2; - showframe(); - di = 160; - bx = 0; - ds = data.word(kIcons2); - al = 5; - ah = 2; - showframe(); + setupTimedUse(); } -void DreamGenContext::transfermap() { +void DreamGenContext::transferMap() { STACK_CHECK; di = data.word(kExframepos); push(di); @@ -2659,104 +805,10 @@ void DreamGenContext::transfermap() { _add(data.word(kExframepos), cx); } -void DreamGenContext::dofade() { - STACK_CHECK; - _cmp(data.byte(kFadedirection), 0); - if (flags.z()) - return /* (finishfade) */; - cl = data.byte(kNumtofade); - ch = 0; - al = data.byte(kColourpos); - ah = 0; - ds = data.word(kBuffers); - si = (0+(228*13)+32+60+(32*32)+(11*10*3)); - _add(si, ax); - _add(si, ax); - _add(si, ax); - showgroup(); - al = data.byte(kNumtofade); - _add(al, data.byte(kColourpos)); - data.byte(kColourpos) = al; - _cmp(al, 0); - if (!flags.z()) - return /* (finishfade) */; - fadecalculation(); -} - -void DreamGenContext::clearendpal() { +void DreamGenContext::fadeScreenDownHalf() { STACK_CHECK; - es = data.word(kBuffers); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); - cx = 768; - al = 0; - _stosb(cx, true); -} - -void DreamGenContext::clearpalette() { - STACK_CHECK; - data.byte(kFadedirection) = 0; - clearstartpal(); - dumpcurrent(); -} - -void DreamGenContext::fadescreenup() { - STACK_CHECK; - clearstartpal(); - paltoendpal(); - data.byte(kFadedirection) = 1; - data.byte(kFadecount) = 63; - data.byte(kColourpos) = 0; - data.byte(kNumtofade) = 128; -} - -void DreamGenContext::fadetowhite() { - STACK_CHECK; - es = data.word(kBuffers); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); - cx = 768; - al = 63; - _stosb(cx, true); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); - al = 0; - _stosb(3); - paltostartpal(); - data.byte(kFadedirection) = 1; - data.byte(kFadecount) = 63; - data.byte(kColourpos) = 0; - data.byte(kNumtofade) = 128; -} - -void DreamGenContext::fadefromwhite() { - STACK_CHECK; - es = data.word(kBuffers); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)); - cx = 768; - al = 63; - _stosb(cx, true); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)); - al = 0; - _stosb(3); - paltoendpal(); - data.byte(kFadedirection) = 1; - data.byte(kFadecount) = 63; - data.byte(kColourpos) = 0; - data.byte(kNumtofade) = 128; -} - -void DreamGenContext::fadescreenups() { - STACK_CHECK; - clearstartpal(); - paltoendpal(); - data.byte(kFadedirection) = 1; - data.byte(kFadecount) = 63; - data.byte(kColourpos) = 0; - data.byte(kNumtofade) = 64; -} - -void DreamGenContext::fadescreendownhalf() { - STACK_CHECK; - paltostartpal(); - paltoendpal(); + palToStartPal(); + palToEndPal(); cx = 768; es = data.word(kBuffers); bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); @@ -2783,110 +835,7 @@ halfend: data.byte(kNumtofade) = 32; } -void DreamGenContext::fadescreenuphalf() { - STACK_CHECK; - endpaltostart(); - paltoendpal(); - data.byte(kFadedirection) = 1; - data.byte(kFadecount) = 31; - data.byte(kColourpos) = 0; - data.byte(kNumtofade) = 32; -} - -void DreamGenContext::fadescreendown() { - STACK_CHECK; - paltostartpal(); - clearendpal(); - data.byte(kFadedirection) = 1; - data.byte(kFadecount) = 63; - data.byte(kColourpos) = 0; - data.byte(kNumtofade) = 128; -} - -void DreamGenContext::fadescreendowns() { - STACK_CHECK; - paltostartpal(); - clearendpal(); - data.byte(kFadedirection) = 1; - data.byte(kFadecount) = 63; - data.byte(kColourpos) = 0; - data.byte(kNumtofade) = 64; -} - -void DreamGenContext::clearstartpal() { - STACK_CHECK; - es = data.word(kBuffers); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)); - cx = 256; -wholeloop1: - ax = 0; - _stosw(); - al = 0; - _stosb(); - if (--cx) - goto wholeloop1; -} - -void DreamGenContext::showgun() { - STACK_CHECK; - data.byte(kAddtored) = 0; - data.byte(kAddtogreen) = 0; - data.byte(kAddtoblue) = 0; - paltostartpal(); - paltoendpal(); - greyscalesum(); - data.byte(kFadedirection) = 1; - data.byte(kFadecount) = 63; - data.byte(kColourpos) = 0; - data.byte(kNumtofade) = 128; - cx = 130; - hangon(); - endpaltostart(); - clearendpal(); - data.byte(kFadedirection) = 1; - data.byte(kFadecount) = 63; - data.byte(kColourpos) = 0; - data.byte(kNumtofade) = 128; - cx = 200; - hangon(); - data.byte(kRoomssample) = 34; - loadroomssample(); - data.byte(kVolume) = 0; - dx = 2351; - loadintotemp(); - createpanel2(); - ds = data.word(kTempgraphics); - al = 0; - ah = 0; - di = 100; - bx = 4; - showframe(); - ds = data.word(kTempgraphics); - al = 1; - ah = 0; - di = 158; - bx = 106; - showframe(); - worktoscreen(); - getridoftemp(); - fadescreenup(); - cx = 160; - hangon(); - al = 12; - ah = 0; - playchannel0(); - dx = 2260; - loadtemptext(); - rollendcredits2(); - getridoftemptext(); -} - -void DreamGenContext::rollendcredits2() { - STACK_CHECK; - rollem(); -} - -void DreamGenContext::rollem() { +void DreamGenContext::rollEm() { STACK_CHECK; cl = 160; ch = 160; @@ -2894,7 +843,7 @@ void DreamGenContext::rollem() { bx = 20; ds = data.word(kMapstore); si = 0; - multiget(); + multiGet(); es = data.word(kTextfile1); si = 49*2; ax = es.word(si); @@ -2911,15 +860,15 @@ endcredits22: push(di); push(es); push(bx); - vsync(); + vSync(); cl = 160; ch = 160; di = 25; bx = 20; ds = data.word(kMapstore); si = 0; - multiput(); - vsync(); + multiPut(); + vSync(); bx = pop(); es = pop(); di = pop(); @@ -2934,17 +883,17 @@ onelot2: di = 25; dx = 161; ax = 0; - printdirect(); + printDirect(); _add(bx, data.word(kLinespacing)); cx = pop(); if (--cx) goto onelot2; - vsync(); + vSync(); cl = 160; ch = 160; di = 25; bx = 20; - multidump(); + multiDump(); bx = pop(); es = pop(); di = pop(); @@ -2974,178 +923,16 @@ gotnext2: if (--cx) goto endcredits21; cx = 120; - hangone(); + hangOne(); return; endearly2: cx = pop(); } -void DreamGenContext::fadecalculation() { - STACK_CHECK; - _cmp(data.byte(kFadecount), 0); - if (flags.z()) - goto nomorefading; - bl = data.byte(kFadecount); - es = data.word(kBuffers); - si = (0+(228*13)+32+60+(32*32)+(11*10*3)); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); - cx = 768; -fadecolloop: - al = es.byte(si); - ah = es.byte(di); - _cmp(al, ah); - if (flags.z()) - goto gotthere; - if (flags.c()) - goto lesscolour; - _dec(es.byte(si)); - goto gotthere; -lesscolour: - _cmp(bl, ah); - if (flags.z()) - goto withit; - if (!flags.c()) - goto gotthere; -withit: - _inc(es.byte(si)); -gotthere: - _inc(si); - _inc(di); - if (--cx) - goto fadecolloop; - _dec(data.byte(kFadecount)); - return; -nomorefading: - data.byte(kFadedirection) = 0; -} - -void DreamGenContext::greyscalesum() { - STACK_CHECK; - es = data.word(kBuffers); - si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); - cx = 256; -greysumloop1: - push(cx); - bx = 0; - al = es.byte(si); - ah = 0; - cx = 20; - _mul(cx); - _add(bx, ax); - al = es.byte(si+1); - ah = 0; - cx = 59; - _mul(cx); - _add(bx, ax); - al = es.byte(si+2); - ah = 0; - cx = 11; - _mul(cx); - _add(bx, ax); - al = -1; -greysumloop2: - _inc(al); - _sub(bx, 100); - if (!flags.c()) - goto greysumloop2; - bl = al; - al = bl; - ah = data.byte(kAddtored); - _cmp(al, 0); - _add(al, ah); - _stosb(); - ah = data.byte(kAddtogreen); - al = bl; - _cmp(al, 0); - if (flags.z()) - goto noaddg; - _add(al, ah); -noaddg: - _stosb(); - ah = data.byte(kAddtoblue); - al = bl; - _cmp(al, 0); - if (flags.z()) - goto noaddb; - _add(al, ah); -noaddb: - _stosb(); - _add(si, 3); - cx = pop(); - if (--cx) - goto greysumloop1; -} - -void DreamGenContext::paltostartpal() { +void DreamGenContext::fadeDownMon() { STACK_CHECK; - es = data.word(kBuffers); - ds = data.word(kBuffers); - si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)); - cx = 768/2; - _movsw(cx, true); -} - -void DreamGenContext::endpaltostart() { - STACK_CHECK; - es = data.word(kBuffers); - ds = data.word(kBuffers); - si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)); - cx = 768/2; - _movsw(cx, true); -} - -void DreamGenContext::startpaltoend() { - STACK_CHECK; - es = data.word(kBuffers); - ds = data.word(kBuffers); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); - si = (0+(228*13)+32+60+(32*32)+(11*10*3)); - cx = 768/2; - _movsw(cx, true); -} - -void DreamGenContext::paltoendpal() { - STACK_CHECK; - es = data.word(kBuffers); - ds = data.word(kBuffers); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); - si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); - cx = 768/2; - _movsw(cx, true); -} - -void DreamGenContext::allpalette() { - STACK_CHECK; - es = data.word(kBuffers); - ds = data.word(kBuffers); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)); - si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); - cx = 768/2; - _movsw(cx, true); - dumpcurrent(); -} - -void DreamGenContext::dumpcurrent() { - STACK_CHECK; - si = (0+(228*13)+32+60+(32*32)+(11*10*3)); - ds = data.word(kBuffers); - vsync(); - al = 0; - cx = 128; - showgroup(); - vsync(); - al = 128; - cx = 128; - showgroup(); -} - -void DreamGenContext::fadedownmon() { - STACK_CHECK; - paltostartpal(); - paltoendpal(); + palToStartPal(); + palToEndPal(); es = data.word(kBuffers); di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(231*3); cx = 3*8; @@ -3159,33 +946,13 @@ void DreamGenContext::fadedownmon() { data.byte(kColourpos) = 0; data.byte(kNumtofade) = 128; cx = 64; - hangon(); -} - -void DreamGenContext::fadeupmon() { - STACK_CHECK; - paltostartpal(); - paltoendpal(); - es = data.word(kBuffers); - di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(231*3); - cx = 3*8; - ax = 0; - _stosb(cx, true); - di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(246*3); - _stosb(); - _stosw(); - data.byte(kFadedirection) = 1; - data.byte(kFadecount) = 63; - data.byte(kColourpos) = 0; - data.byte(kNumtofade) = 128; - cx = 128; - hangon(); + hangOn(); } -void DreamGenContext::fadeupmonfirst() { +void DreamGenContext::fadeUpMon() { STACK_CHECK; - paltostartpal(); - paltoendpal(); + palToStartPal(); + palToEndPal(); es = data.word(kBuffers); di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(231*3); cx = 3*8; @@ -3198,36 +965,13 @@ void DreamGenContext::fadeupmonfirst() { data.byte(kFadecount) = 63; data.byte(kColourpos) = 0; data.byte(kNumtofade) = 128; - cx = 64; - hangon(); - al = 26; - playchannel1(); - cx = 64; - hangon(); -} - -void DreamGenContext::fadeupyellows() { - STACK_CHECK; - paltoendpal(); - es = data.word(kBuffers); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(231*3); - cx = 3*8; - ax = 0; - _stosb(cx, true); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(246*3); - _stosb(); - _stosw(); - data.byte(kFadedirection) = 1; - data.byte(kFadecount) = 63; - data.byte(kColourpos) = 0; - data.byte(kNumtofade) = 128; cx = 128; - hangon(); + hangOn(); } -void DreamGenContext::initialmoncols() { +void DreamGenContext::initialMonCols() { STACK_CHECK; - paltostartpal(); + palToStartPal(); es = data.word(kBuffers); di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(230*3); cx = 3*9; @@ -3240,504 +984,35 @@ void DreamGenContext::initialmoncols() { si = (0+(228*13)+32+60+(32*32)+(11*10*3))+(230*3); al = 230; cx = 18; - showgroup(); -} - -void DreamGenContext::titles() { - STACK_CHECK; - clearpalette(); - biblequote(); - _cmp(data.byte(kQuitrequested), 0); - if (!flags.z()) - return /* (titlesearly) */; - intro(); -} - -void DreamGenContext::endgame() { - STACK_CHECK; - dx = 2260; - loadtemptext(); - monkspeaking(); - gettingshot(); - getridoftemptext(); - data.byte(kVolumeto) = 7; - data.byte(kVolumedirection) = 1; - cx = 200; - hangon(); -} - -void DreamGenContext::monkspeaking() { - STACK_CHECK; - data.byte(kRoomssample) = 35; - loadroomssample(); - dx = 2364; - loadintotemp(); - clearwork(); - showmonk(); - worktoscreen(); - data.byte(kVolume) = 7; - data.byte(kVolumedirection) = -1; - data.byte(kVolumeto) = 5; - al = 12; - ah = 255; - playchannel0(); - fadescreenups(); - cx = 300; - hangon(); - al = 40; -loadspeech2: - push(ax); - dl = 'T'; - dh = 83; - cl = 'T'; - ah = 0; - loadspeech(); - al = 50+12; - playchannel1(); -notloadspeech2: - vsync(); - _cmp(data.byte(kCh1playing), 255); - if (!flags.z()) - goto notloadspeech2; - ax = pop(); - _inc(al); - _cmp(al, 48); - if (!flags.z()) - goto loadspeech2; - data.byte(kVolumedirection) = 1; - data.byte(kVolumeto) = 7; - fadescreendowns(); - cx = 300; - hangon(); - getridoftemp(); -} - -void DreamGenContext::showmonk() { - STACK_CHECK; - al = 0; - ah = 128; - di = 160; - bx = 72; - ds = data.word(kTempgraphics); - showframe(); -} - -void DreamGenContext::gettingshot() { - STACK_CHECK; - data.byte(kNewlocation) = 55; - clearpalette(); - loadintroroom(); - fadescreenups(); - data.byte(kVolumeto) = 0; - data.byte(kVolumedirection) = -1; - runendseq(); - clearbeforeload(); -} - -void DreamGenContext::credits() { - STACK_CHECK; - clearpalette(); - realcredits(); -} - -void DreamGenContext::biblequote() { - STACK_CHECK; - mode640x480(); - dx = 2377; - showpcx(); - fadescreenups(); - cx = 80; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto biblequotearly; - cx = 560; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto biblequotearly; - fadescreendowns(); - cx = 200; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto biblequotearly; - cancelch0(); -biblequotearly: - data.byte(kLasthardkey) = 0; -} - -void DreamGenContext::hangone() { - STACK_CHECK; -hangonloope: - push(cx); - vsync(); - cx = pop(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - return /* (hangonearly) */; - if (--cx) - goto hangonloope; -} - -void DreamGenContext::intro() { - STACK_CHECK; - dx = 2247; - loadtemptext(); - loadpalfromiff(); - setmode(); - data.byte(kNewlocation) = 50; - clearpalette(); - loadintroroom(); - data.byte(kVolume) = 7; - data.byte(kVolumedirection) = -1; - data.byte(kVolumeto) = 4; - al = 12; - ah = 255; - playchannel0(); - fadescreenups(); - runintroseq(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto introearly; - clearbeforeload(); - data.byte(kNewlocation) = 52; - loadintroroom(); - runintroseq(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto introearly; - clearbeforeload(); - data.byte(kNewlocation) = 53; - loadintroroom(); - runintroseq(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto introearly; - clearbeforeload(); - allpalette(); - data.byte(kNewlocation) = 54; - loadintroroom(); - runintroseq(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto introearly; - getridoftemptext(); - clearbeforeload(); -introearly: - data.byte(kLasthardkey) = 0; -} - -void DreamGenContext::runintroseq() { - STACK_CHECK; - data.byte(kGetback) = 0; -moreintroseq: - vsync(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto earlyendrun; - spriteupdate(); - vsync(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto earlyendrun; - deleverything(); - printsprites(); - reelsonscreen(); - afterintroroom(); - usetimedtext(); - vsync(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto earlyendrun; - dumpmap(); - dumptimedtext(); - vsync(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto earlyendrun; - _cmp(data.byte(kGetback), 1); - if (!flags.z()) - goto moreintroseq; - return; -earlyendrun: - getridoftemptext(); - clearbeforeload(); + showGroup(); } -void DreamGenContext::runendseq() { +void DreamGenContext::runEndSeq() { STACK_CHECK; atmospheres(); data.byte(kGetback) = 0; moreendseq: - vsync(); - spriteupdate(); - vsync(); - deleverything(); - printsprites(); - reelsonscreen(); - afterintroroom(); - usetimedtext(); - vsync(); - dumpmap(); - dumptimedtext(); - vsync(); + vSync(); + spriteUpdate(); + vSync(); + delEverything(); + printSprites(); + reelsOnScreen(); + afterIntroRoom(); + useTimedText(); + vSync(); + dumpMap(); + dumpTimedText(); + vSync(); _cmp(data.byte(kGetback), 1); if (!flags.z()) goto moreendseq; } -void DreamGenContext::loadintroroom() { - STACK_CHECK; - data.byte(kIntrocount) = 0; - data.byte(kLocation) = 255; - loadroom(); - data.word(kMapoffsetx) = 72; - data.word(kMapoffsety) = 16; - clearsprites(); - data.byte(kThroughdoor) = 0; - data.byte(kCurrentkey) = '0'; - data.byte(kMainmode) = 0; - clearwork(); - data.byte(kNewobs) = 1; - drawfloor(); - reelsonscreen(); - spriteupdate(); - printsprites(); - worktoscreen(); -} - -void DreamGenContext::realcredits() { - STACK_CHECK; - data.byte(kRoomssample) = 33; - loadroomssample(); - data.byte(kVolume) = 0; - mode640x480(); - cx = 35; - hangon(); - dx = 2390; - showpcx(); - al = 12; - ah = 0; - playchannel0(); - cx = 2; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto realcreditsearly; - allpalette(); - cx = 80; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto realcreditsearly; - fadescreendowns(); - cx = 256; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto realcreditsearly; - dx = 2403; - showpcx(); - al = 12; - ah = 0; - playchannel0(); - cx = 2; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto realcreditsearly; - allpalette(); - cx = 80; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto realcreditsearly; - fadescreendowns(); - cx = 256; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto realcreditsearly; - dx = 2416; - showpcx(); - al = 12; - ah = 0; - playchannel0(); - cx = 2; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto realcreditsearly; - allpalette(); - cx = 80; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto realcreditsearly; - fadescreendowns(); - cx = 256; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto realcreditsearly; - dx = 2429; - showpcx(); - al = 12; - ah = 0; - playchannel0(); - cx = 2; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto realcreditsearly; - allpalette(); - cx = 80; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto realcreditsearly; - fadescreendowns(); - cx = 256; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto realcreditsearly; - dx = 2442; - showpcx(); - al = 12; - ah = 0; - playchannel0(); - cx = 2; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto realcreditsearly; - allpalette(); - cx = 80; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto realcreditsearly; - fadescreendowns(); - cx = 256; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto realcreditsearly; - dx = 2455; - showpcx(); - fadescreenups(); - cx = 60; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto realcreditsearly; - al = 13; - ah = 0; - playchannel0(); - cx = 350; - hangone(); - _cmp(data.byte(kLasthardkey), 1); - if (flags.z()) - goto realcreditsearly; - fadescreendowns(); - cx = 256; - hangone(); -realcreditsearly: - data.byte(kLasthardkey) = 0; -} - -void DreamGenContext::monprint() { - STACK_CHECK; - data.byte(kKerning) = 1; - si = bx; - dl = 166; - di = data.word(kMonadx); - bx = data.word(kMonady); - ds = data.word(kTempcharset); -printloop8: - push(bx); - push(di); - push(dx); - getnumber(); - ch = 0; -printloop7: - al = es.byte(si); - _inc(si); - _cmp(al, ':'); - if (flags.z()) - goto finishmon2; - _cmp(al, 0); - if (flags.z()) - goto finishmon; - _cmp(al, 34); - if (flags.z()) - goto finishmon; - _cmp(al, '='); - if (flags.z()) - goto finishmon; - _cmp(al, '%'); - if (!flags.z()) - goto nottrigger; - ah = es.byte(si); - _inc(si); - _inc(si); - goto finishmon; -nottrigger: - push(cx); - push(es); - modifychar(); - printchar(); - data.word(kCurslocx) = di; - data.word(kCurslocy) = bx; - data.word(kMaintimer) = 1; - printcurs(); - vsync(); - push(si); - push(dx); - push(ds); - push(es); - push(bx); - push(di); - lockmon(); - di = pop(); - bx = pop(); - es = pop(); - ds = pop(); - dx = pop(); - si = pop(); - delcurs(); - es = pop(); - cx = pop(); - if (--cx) - goto printloop7; -finishmon2: - dx = pop(); - di = pop(); - bx = pop(); - scrollmonitor(); - data.word(kCurslocx) = di; - goto printloop8; -finishmon: - dx = pop(); - di = pop(); - bx = pop(); - _cmp(al, '%'); - if (!flags.z()) - goto nottrigger2; - data.byte(kLasttrigger) = ah; -nottrigger2: - data.word(kCurslocx) = di; - scrollmonitor(); - bx = si; - data.byte(kKerning) = 0; -} - -void DreamGenContext::fillopen() { +void DreamGenContext::fillOpen() { STACK_CHECK; - deltextline(); - getopenedsize(); + delTextLine(); + getOpenedSize(); _cmp(ah, 4); if (flags.c()) goto lessthanapage; @@ -3747,7 +1022,7 @@ lessthanapage: push(ax); es = data.word(kBuffers); di = (0+(228*13)); - findallopen(); + findAllOpen(); si = (0+(228*13)); di = (80); bx = (58)+96; @@ -3763,7 +1038,7 @@ openloop1: _cmp(ch, cl); if (flags.c()) goto nextopenslot; - obtoinv(); + obToInv(); nextopenslot: es = pop(); si = pop(); @@ -3775,10 +1050,10 @@ nextopenslot: _cmp(cl, 5); if (!flags.z()) goto openloop1; - undertextline(); + underTextLine(); } -void DreamGenContext::findallopen() { +void DreamGenContext::findAllOpen() { STACK_CHECK; push(di); cx = 16; @@ -3851,118 +1126,14 @@ findopen2a: goto findopen1a; } -void DreamGenContext::examineob() { - STACK_CHECK; - data.byte(kPointermode) = 0; - data.word(kTimecount) = 0; -examineagain: - data.byte(kInmaparea) = 0; - data.byte(kExamagain) = 0; - data.byte(kOpenedob) = 255; - data.byte(kOpenedtype) = 255; - data.byte(kInvopen) = 0; - al = data.byte(kCommandtype); - data.byte(kObjecttype) = al; - data.byte(kItemframe) = 0; - data.byte(kPointerframe) = 0; - createpanel(); - showpanel(); - showman(); - showexit(); - obicons(); - obpicture(); - describeob(); - undertextline(); - data.byte(kCommandtype) = 255; - readmouse(); - showpointer(); - worktoscreen(); - delpointer(); -waitexam: - readmouse(); - showpointer(); - vsync(); - dumppointer(); - dumptextline(); - delpointer(); - data.byte(kGetback) = 0; - bx = offset_examlist; - _cmp(data.byte(kInvopen), 0); - if (flags.z()) - goto notuseinv; - bx = offset_invlist1; - _cmp(data.byte(kInvopen), 1); - if (flags.z()) - goto notuseinv; - bx = offset_withlist1; -notuseinv: - checkcoords(); - _cmp(data.byte(kQuitrequested), 0); - if (!flags.z()) - goto stopwaiting; - _cmp(data.byte(kExamagain), 0); - if (flags.z()) - goto norex; - goto examineagain; -norex: - _cmp(data.byte(kGetback), 0); - if (flags.z()) - goto waitexam; -stopwaiting: - data.byte(kPickup) = 0; - _cmp(data.word(kWatchingtime), 0); - if (!flags.z()) - goto iswatching; - _cmp(data.byte(kNewlocation), 255); - if (!flags.z()) - goto justgetback; -iswatching: - makemainscreen(); - data.byte(kInvopen) = 0; - data.byte(kOpenedob) = 255; - return; -justgetback: - data.byte(kInvopen) = 0; - data.byte(kOpenedob) = 255; -} - -void DreamGenContext::makemainscreen() { - STACK_CHECK; - createpanel(); - data.byte(kNewobs) = 1; - drawfloor(); - spriteupdate(); - printsprites(); - reelsonscreen(); - showicon(); - getunderzoom(); - undertextline(); - data.byte(kCommandtype) = 255; - animpointer(); - worktoscreenm(); - data.byte(kCommandtype) = 200; - data.byte(kManisoffscreen) = 0; -} - -void DreamGenContext::getbackfromob() { - STACK_CHECK; - _cmp(data.byte(kPickup), 1); - if (!flags.z()) - goto notheldob; - blank(); - return; -notheldob: - getback1(); -} - -void DreamGenContext::incryanpage() { +void DreamGenContext::incRyanPage() { STACK_CHECK; _cmp(data.byte(kCommandtype), 222); if (flags.z()) goto alreadyincryan; data.byte(kCommandtype) = 222; al = 31; - commandonly(); + commandOnly(); alreadyincryan: ax = data.word(kMousebutton); _cmp(ax, data.word(kOldbutton)); @@ -3981,37 +1152,25 @@ findnewpage: _sub(ax, 18); if (!flags.c()) goto findnewpage; - delpointer(); - fillryan(); - readmouse(); - showpointer(); - worktoscreen(); - delpointer(); + delPointer(); + fillRyan(); + readMouse(); + showPointer(); + workToScreen(); + delPointer(); } -void DreamGenContext::openinv() { - STACK_CHECK; - data.byte(kInvopen) = 1; - al = 61; - di = (80); - bx = (58)-10; - dl = 240; - printmessage(); - fillryan(); - data.byte(kCommandtype) = 255; -} - -void DreamGenContext::openob() { +void DreamGenContext::openOb() { STACK_CHECK; al = data.byte(kOpenedob); ah = data.byte(kOpenedtype); di = offset_commandline; - copyname(); + copyName(); di = (80); bx = (58)+86; al = 62; dl = 240; - printmessage(); + printMessage(); di = data.word(kLastxpos); _add(di, 5); bx = (58)+86; @@ -4020,9 +1179,9 @@ void DreamGenContext::openob() { dl = 220; al = 0; ah = 0; - printdirect(); - fillopen(); - getopenedsize(); + printDirect(); + fillOpen(); + getOpenedSize(); al = ah; ah = 0; cx = (44); @@ -4032,19 +1191,9 @@ void DreamGenContext::openob() { cs.word(bx) = ax; } -void DreamGenContext::examicon() { - STACK_CHECK; - ds = data.word(kIcons2); - di = 254; - bx = 5; - al = 3; - ah = 0; - showframe(); -} - -void DreamGenContext::describeob() { +void DreamGenContext::describeOb() { STACK_CHECK; - getobtextstart(); + getObTextStart(); di = 33; bx = 92; _cmp(data.byte(kForeignrelease), 0); @@ -4058,7 +1207,7 @@ notsetd: dl = 241; ah = 16; data.word(kCharshift) = 91+91; - printdirect(); + printDirect(); data.word(kCharshift) = 0; di = 36; bx = 104; @@ -4072,14 +1221,14 @@ notsetd: notsetd2: dl = 241; ah = 0; - printdirect(); + printDirect(); push(bx); - obsthatdothings(); + obsThatDoThings(); bx = pop(); - additionaltext(); + additionalText(); } -void DreamGenContext::additionaltext() { +void DreamGenContext::additionalText() { STACK_CHECK; _add(bx, 10); push(bx); @@ -4105,45 +1254,24 @@ void DreamGenContext::additionaltext() { return; emptycup: al = 40; - findpuztext(); + findPuzText(); bx = pop(); di = 36; dl = 241; ah = 0; - printdirect(); + printDirect(); return; fullcup: al = 39; - findpuztext(); + findPuzText(); bx = pop(); di = 36; dl = 241; ah = 0; - printdirect(); -} - -void DreamGenContext::obsthatdothings() { - STACK_CHECK; - al = data.byte(kCommand); - ah = data.byte(kObjecttype); - cl = 'M'; - ch = 'E'; - dl = 'M'; - dh = 'B'; - compare(); - if (!flags.z()) - return /* (notlouiscard) */; - al = 4; - getlocation(); - _cmp(al, 1); - if (flags.z()) - return /* (seencard) */; - al = 4; - setlocation(); - lookatcard(); + printDirect(); } -void DreamGenContext::getobtextstart() { +void DreamGenContext::getObTextStart() { STACK_CHECK; es = data.word(kFreedesc); si = (0); @@ -4171,7 +1299,7 @@ describe: bx = ax; tryagain: push(si); - findnextcolon(); + findNextColon(); al = es.byte(si); cx = si; si = pop(); @@ -4186,11 +1314,11 @@ tryagain: goto findsometext; return; findsometext: - searchforsame(); + searchForSame(); goto tryagain; } -void DreamGenContext::searchforsame() { +void DreamGenContext::searchForSame() { STACK_CHECK; si = cx; searchagain: @@ -4233,127 +1361,7 @@ foundmatch: bx = pop(); } -void DreamGenContext::inventory() { - STACK_CHECK; - _cmp(data.byte(kMandead), 1); - if (flags.z()) - goto iswatchinv; - _cmp(data.word(kWatchingtime), 0); - if (flags.z()) - goto notwatchinv; -iswatchinv: - blank(); - return; -notwatchinv: - _cmp(data.byte(kCommandtype), 239); - if (flags.z()) - goto alreadyopinv; - data.byte(kCommandtype) = 239; - al = 32; - commandonly(); -alreadyopinv: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (cantopinv) */; - _and(ax, 1); - if (!flags.z()) - goto doopeninv; - return; -doopeninv: - data.word(kTimecount) = 0; - data.byte(kPointermode) = 0; - data.byte(kInmaparea) = 0; - animpointer(); - createpanel(); - showpanel(); - examicon(); - showman(); - showexit(); - undertextline(); - data.byte(kPickup) = 0; - data.byte(kInvopen) = 2; - openinv(); - readmouse(); - showpointer(); - worktoscreen(); - delpointer(); - data.byte(kOpenedob) = 255; - goto waitexam; - return; -/*continuing to unbounded code: examineagain from examineob:3-69*/ -examineagain: - data.byte(kInmaparea) = 0; - data.byte(kExamagain) = 0; - data.byte(kOpenedob) = 255; - data.byte(kOpenedtype) = 255; - data.byte(kInvopen) = 0; - al = data.byte(kCommandtype); - data.byte(kObjecttype) = al; - data.byte(kItemframe) = 0; - data.byte(kPointerframe) = 0; - createpanel(); - showpanel(); - showman(); - showexit(); - obicons(); - obpicture(); - describeob(); - undertextline(); - data.byte(kCommandtype) = 255; - readmouse(); - showpointer(); - worktoscreen(); - delpointer(); -waitexam: - readmouse(); - showpointer(); - vsync(); - dumppointer(); - dumptextline(); - delpointer(); - data.byte(kGetback) = 0; - bx = offset_examlist; - _cmp(data.byte(kInvopen), 0); - if (flags.z()) - goto notuseinv; - bx = offset_invlist1; - _cmp(data.byte(kInvopen), 1); - if (flags.z()) - goto notuseinv; - bx = offset_withlist1; -notuseinv: - checkcoords(); - _cmp(data.byte(kQuitrequested), 0); - if (!flags.z()) - goto stopwaiting; - _cmp(data.byte(kExamagain), 0); - if (flags.z()) - goto norex; - goto examineagain; -norex: - _cmp(data.byte(kGetback), 0); - if (flags.z()) - goto waitexam; -stopwaiting: - data.byte(kPickup) = 0; - _cmp(data.word(kWatchingtime), 0); - if (!flags.z()) - goto iswatching; - _cmp(data.byte(kNewlocation), 255); - if (!flags.z()) - goto justgetback; -iswatching: - makemainscreen(); - data.byte(kInvopen) = 0; - data.byte(kOpenedob) = 255; - return; -justgetback: - data.byte(kInvopen) = 0; - data.byte(kOpenedob) = 255; -} - -void DreamGenContext::setpickup() { +void DreamGenContext::setPickup() { STACK_CHECK; _cmp(data.byte(kObjecttype), 1); if (flags.z()) @@ -4361,7 +1369,7 @@ void DreamGenContext::setpickup() { _cmp(data.byte(kObjecttype), 3); if (flags.z()) goto cantpick; - getanyad(); + getAnyAd(); al = es.byte(bx+2); _cmp(al, 4); if (!flags.z()) @@ -4377,7 +1385,7 @@ canpick: bl = data.byte(kCommand); bh = data.byte(kObjecttype); al = 33; - commandwithob(); + commandWithOb(); alreadysp: ax = data.word(kMousebutton); _cmp(ax, 1); @@ -4388,11 +1396,11 @@ alreadysp: goto dosetpick; return; dosetpick: - createpanel(); - showpanel(); - showman(); - showexit(); - examicon(); + createPanel(); + showPanel(); + showMan(); + showExit(); + examIcon(); data.byte(kPickup) = 1; data.byte(kInvopen) = 2; _cmp(data.byte(kObjecttype), 4); @@ -4401,63 +1409,26 @@ dosetpick: al = data.byte(kCommand); data.byte(kItemframe) = al; data.byte(kOpenedob) = 255; - transfertoex(); + transferToEx(); data.byte(kItemframe) = al; data.byte(kObjecttype) = 4; - geteitherad(); + getEitherAd(); es.byte(bx+2) = 20; es.byte(bx+3) = 255; - openinv(); - worktoscreenm(); + openInv(); + workToScreenM(); return; pickupexob: al = data.byte(kCommand); data.byte(kItemframe) = al; data.byte(kOpenedob) = 255; - openinv(); - worktoscreenm(); -} - -void DreamGenContext::examinventory() { - STACK_CHECK; - _cmp(data.byte(kCommandtype), 249); - if (flags.z()) - goto alreadyexinv; - data.byte(kCommandtype) = 249; - al = 32; - commandonly(); -alreadyexinv: - ax = data.word(kMousebutton); - _and(ax, 1); - if (!flags.z()) - goto doexinv; - return; -doexinv: - createpanel(); - showpanel(); - showman(); - showexit(); - examicon(); - data.byte(kPickup) = 0; - data.byte(kInvopen) = 2; - openinv(); - worktoscreenm(); -} - -void DreamGenContext::reexfrominv() { - STACK_CHECK; - findinvpos(); - ax = es.word(bx); - data.byte(kCommandtype) = ah; - data.byte(kCommand) = al; - data.byte(kExamagain) = 1; - data.byte(kPointermode) = 0; + openInv(); + workToScreenM(); } -void DreamGenContext::reexfromopen() { +void DreamGenContext::reExFromInv() { STACK_CHECK; - return; - findopenpos(); + findInvPos(); ax = es.word(bx); data.byte(kCommandtype) = ah; data.byte(kCommand) = al; @@ -4465,7 +1436,7 @@ void DreamGenContext::reexfromopen() { data.byte(kPointermode) = 0; } -void DreamGenContext::swapwithinv() { +void DreamGenContext::swapWithInv() { STACK_CHECK; al = data.byte(kItemframe); ah = data.byte(kObjecttype); @@ -4480,7 +1451,7 @@ difsub7: data.word(kOldsubject) = ax; bx = ax; al = 34; - commandwithob(); + commandWithOb(); alreadyswap1: ax = data.word(kMousebutton); _cmp(ax, data.word(kOldbutton)); @@ -4494,11 +1465,11 @@ doswap1: ah = data.byte(kObjecttype); al = data.byte(kItemframe); push(ax); - findinvpos(); + findInvPos(); ax = es.word(bx); data.byte(kItemframe) = al; data.byte(kObjecttype) = ah; - geteitherad(); + getEitherAd(); es.byte(bx+2) = 20; es.byte(bx+3) = 255; bl = data.byte(kItemframe); @@ -4507,10 +1478,10 @@ doswap1: data.byte(kObjecttype) = ah; data.byte(kItemframe) = al; push(bx); - findinvpos(); - delpointer(); + findInvPos(); + delPointer(); al = data.byte(kItemframe); - geteitherad(); + getEitherAd(); es.byte(bx+2) = 4; es.byte(bx+3) = 255; al = data.byte(kLastinvpos); @@ -4518,14 +1489,14 @@ doswap1: ax = pop(); data.byte(kObjecttype) = ah; data.byte(kItemframe) = al; - fillryan(); - readmouse(); - showpointer(); - worktoscreen(); - delpointer(); + fillRyan(); + readMouse(); + showPointer(); + workToScreen(); + delPointer(); } -void DreamGenContext::swapwithopen() { +void DreamGenContext::swapWithOpen() { STACK_CHECK; al = data.byte(kItemframe); ah = data.byte(kObjecttype); @@ -4540,7 +1511,7 @@ difsub8: data.word(kOldsubject) = ax; bx = ax; al = 34; - commandwithob(); + commandWithOb(); alreadyswap2: ax = data.word(kMousebutton); _cmp(ax, data.word(kOldbutton)); @@ -4551,14 +1522,14 @@ alreadyswap2: goto doswap2; return; doswap2: - geteitherad(); - isitworn(); + getEitherAd(); + isItWorn(); if (!flags.z()) goto notwornswap; - wornerror(); + wornError(); return; notwornswap: - delpointer(); + delPointer(); al = data.byte(kItemframe); _cmp(al, data.byte(kOpenedob)); if (!flags.z()) @@ -4567,10 +1538,10 @@ notwornswap: _cmp(al, data.byte(kOpenedtype)); if (!flags.z()) goto isntsame2; - errormessage1(); + errorMessage1(); return; isntsame2: - checkobjectsize(); + checkObjectSize(); _cmp(al, 0); if (flags.z()) goto sizeok2; @@ -4579,22 +1550,22 @@ sizeok2: ah = data.byte(kObjecttype); al = data.byte(kItemframe); push(ax); - findopenpos(); + findOpenPos(); ax = es.word(bx); data.byte(kItemframe) = al; data.byte(kObjecttype) = ah; _cmp(ah, 4); if (!flags.z()) goto makeswapex; - geteitherad(); + getEitherAd(); es.byte(bx+2) = 20; es.byte(bx+3) = 255; goto actuallyswap; makeswapex: - transfertoex(); + transferToEx(); data.byte(kItemframe) = al; data.byte(kObjecttype) = 4; - geteitherad(); + getEitherAd(); es.byte(bx+2) = 20; es.byte(bx+3) = 255; actuallyswap: @@ -4604,8 +1575,8 @@ actuallyswap: data.byte(kObjecttype) = ah; data.byte(kItemframe) = al; push(bx); - findopenpos(); - geteitherad(); + findOpenPos(); + getEitherAd(); al = data.byte(kOpenedtype); es.byte(bx+2) = al; al = data.byte(kOpenedob); @@ -4617,30 +1588,30 @@ actuallyswap: ax = pop(); data.byte(kObjecttype) = ah; data.byte(kItemframe) = al; - fillopen(); - fillryan(); - undertextline(); - readmouse(); - useopened(); - showpointer(); - worktoscreen(); - delpointer(); + fillOpen(); + fillRyan(); + underTextLine(); + readMouse(); + useOpened(); + showPointer(); + workToScreen(); + delPointer(); } -void DreamGenContext::intoinv() { +void DreamGenContext::inToInv() { STACK_CHECK; _cmp(data.byte(kPickup), 0); if (!flags.z()) goto notout; - outofinv(); + outOfInv(); return; notout: - findinvpos(); + findInvPos(); ax = es.word(bx); _cmp(al, 255); if (flags.z()) goto canplace1; - swapwithinv(); + swapWithInv(); return; canplace1: al = data.byte(kItemframe); @@ -4656,7 +1627,7 @@ difsub1: data.word(kOldsubject) = ax; bx = ax; al = 35; - commandwithob(); + commandWithOb(); alreadyplce: ax = data.word(kMousebutton); _cmp(ax, data.word(kOldbutton)); @@ -4667,25 +1638,25 @@ alreadyplce: goto doplace; return; doplace: - delpointer(); + delPointer(); al = data.byte(kItemframe); - getexad(); + getExAd(); es.byte(bx+2) = 4; es.byte(bx+3) = 255; al = data.byte(kLastinvpos); es.byte(bx+4) = al; data.byte(kPickup) = 0; - fillryan(); - readmouse(); - showpointer(); - outofinv(); - worktoscreen(); - delpointer(); + fillRyan(); + readMouse(); + showPointer(); + outOfInv(); + workToScreen(); + delPointer(); } -void DreamGenContext::outofinv() { +void DreamGenContext::outOfInv() { STACK_CHECK; - findinvpos(); + findInvPos(); ax = es.word(bx); _cmp(al, 255); if (!flags.z()) @@ -4697,7 +1668,7 @@ canpick2: _cmp(bx, 2); if (!flags.z()) goto canpick2a; - reexfrominv(); + reExFromInv(); return; canpick2a: _cmp(ax, data.word(kOldsubject)); @@ -4711,7 +1682,7 @@ difsub3: data.word(kOldsubject) = ax; bx = ax; al = 36; - commandwithob(); + commandWithOb(); alreadygrab: ax = data.word(kMousebutton); _cmp(ax, data.word(kOldbutton)); @@ -4722,24 +1693,24 @@ alreadygrab: goto dograb; return; dograb: - delpointer(); + delPointer(); data.byte(kPickup) = 1; - findinvpos(); + findInvPos(); ax = es.word(bx); data.byte(kItemframe) = al; data.byte(kObjecttype) = ah; - getexad(); + getExAd(); es.byte(bx+2) = 20; es.byte(bx+3) = 255; - fillryan(); - readmouse(); - showpointer(); - intoinv(); - worktoscreen(); - delpointer(); + fillRyan(); + readMouse(); + showPointer(); + inToInv(); + workToScreen(); + delPointer(); } -void DreamGenContext::getfreead() { +void DreamGenContext::getFreeAd() { STACK_CHECK; ah = 0; cl = 4; @@ -4748,7 +1719,7 @@ void DreamGenContext::getfreead() { es = data.word(kFreedat); } -void DreamGenContext::getexad() { +void DreamGenContext::getExAd() { STACK_CHECK; ah = 0; bx = 16; @@ -4758,20 +1729,20 @@ void DreamGenContext::getexad() { _add(bx, (0+2080+30000)); } -void DreamGenContext::geteitherad() { +void DreamGenContext::getEitherAd() { STACK_CHECK; _cmp(data.byte(kObjecttype), 4); if (flags.z()) goto isinexlist; al = data.byte(kItemframe); - getfreead(); + getFreeAd(); return; isinexlist: al = data.byte(kItemframe); - getexad(); + getExAd(); } -void DreamGenContext::getanyad() { +void DreamGenContext::getAnyAd() { STACK_CHECK; _cmp(data.byte(kObjecttype), 4); if (flags.z()) @@ -4780,38 +1751,21 @@ void DreamGenContext::getanyad() { if (flags.z()) goto isfree; al = data.byte(kCommand); - getsetad(); + getSetAd(); ax = es.word(bx+4); return; isfree: al = data.byte(kCommand); - getfreead(); + getFreeAd(); ax = es.word(bx+7); return; isex: al = data.byte(kCommand); - getexad(); + getExAd(); ax = es.word(bx+7); } -void DreamGenContext::getanyaddir() { - STACK_CHECK; - _cmp(ah, 4); - if (flags.z()) - goto isex3; - _cmp(ah, 2); - if (flags.z()) - goto isfree3; - getsetad(); - return; -isfree3: - getfreead(); - return; -isex3: - getexad(); -} - -void DreamGenContext::getopenedsize() { +void DreamGenContext::getOpenedSize() { STACK_CHECK; _cmp(data.byte(kOpenedtype), 4); if (flags.z()) @@ -4820,21 +1774,21 @@ void DreamGenContext::getopenedsize() { if (flags.z()) goto isfree2; al = data.byte(kOpenedob); - getsetad(); + getSetAd(); ax = es.word(bx+3); return; isfree2: al = data.byte(kOpenedob); - getfreead(); + getFreeAd(); ax = es.word(bx+7); return; isex2: al = data.byte(kOpenedob); - getexad(); + getExAd(); ax = es.word(bx+7); } -void DreamGenContext::getsetad() { +void DreamGenContext::getSetAd() { STACK_CHECK; ah = 0; bx = 64; @@ -4843,7 +1797,7 @@ void DreamGenContext::getsetad() { es = data.word(kSetdat); } -void DreamGenContext::findinvpos() { +void DreamGenContext::findInvPos() { STACK_CHECK; cx = data.word(kMousex); _sub(cx, (80)); @@ -4873,7 +1827,7 @@ findinv2: _add(bx, (0+(228*13)+32)); } -void DreamGenContext::findopenpos() { +void DreamGenContext::findOpenPos() { STACK_CHECK; cx = data.word(kMousex); _sub(cx, (80)); @@ -4890,7 +1844,7 @@ findopenp1: _add(bx, (0+(228*13))); } -void DreamGenContext::dropobject() { +void DreamGenContext::dropObject() { STACK_CHECK; _cmp(data.byte(kCommandtype), 223); if (flags.z()) @@ -4902,7 +1856,7 @@ void DreamGenContext::dropobject() { bl = data.byte(kItemframe); bh = data.byte(kObjecttype); al = 37; - commandwithob(); + commandWithOb(); alreadydrop: ax = data.word(kMousebutton); _cmp(ax, data.word(kOldbutton)); @@ -4913,11 +1867,11 @@ alreadydrop: goto dodrop; return; dodrop: - geteitherad(); - isitworn(); + getEitherAd(); + isItWorn(); if (!flags.z()) goto nowornerror; - wornerror(); + wornError(); return; nowornerror: _cmp(data.byte(kReallocation), 47); @@ -4927,12 +1881,12 @@ nowornerror: _add(cl, 12); ch = data.byte(kRyany); _add(ch, 12); - checkone(); + checkOne(); _cmp(cl, 2); if (flags.c()) goto nodroperror; nodrop2: - droperror(); + dropError(); return; nodroperror: _cmp(data.byte(kMapxsize), 64); @@ -4941,7 +1895,7 @@ nodroperror: _cmp(data.byte(kMapysize), 64); if (!flags.z()) goto notinlift; - droperror(); + dropError(); return; notinlift: al = data.byte(kItemframe); @@ -4952,7 +1906,7 @@ notinlift: dh = 'A'; compare(); if (flags.z()) - { cantdrop(); return; }; + { cantDrop(); return; }; al = data.byte(kItemframe); ah = 4; cl = 'S'; @@ -4961,10 +1915,10 @@ notinlift: dh = 'D'; compare(); if (flags.z()) - { cantdrop(); return; }; + { cantDrop(); return; }; data.byte(kObjecttype) = 4; al = data.byte(kItemframe); - getexad(); + getExAd(); es.byte(bx+2) = 0; al = data.byte(kRyanx); _add(al, 4); @@ -4991,79 +1945,22 @@ notinlift: es.byte(bx) = al; } -void DreamGenContext::droperror() { - STACK_CHECK; - data.byte(kCommandtype) = 255; - delpointer(); - di = 76; - bx = 21; - al = 56; - dl = 240; - printmessage(); - worktoscreenm(); - cx = 50; - hangonp(); - showpanel(); - showman(); - examicon(); - data.byte(kCommandtype) = 255; - worktoscreenm(); -} - -void DreamGenContext::cantdrop() { - STACK_CHECK; - data.byte(kCommandtype) = 255; - delpointer(); - di = 76; - bx = 21; - al = 24; - dl = 240; - printmessage(); - worktoscreenm(); - cx = 50; - hangonp(); - showpanel(); - showman(); - examicon(); - data.byte(kCommandtype) = 255; - worktoscreenm(); -} - -void DreamGenContext::wornerror() { - STACK_CHECK; - data.byte(kCommandtype) = 255; - delpointer(); - di = 76; - bx = 21; - al = 57; - dl = 240; - printmessage(); - worktoscreenm(); - cx = 50; - hangonp(); - showpanel(); - showman(); - examicon(); - data.byte(kCommandtype) = 255; - worktoscreenm(); -} - -void DreamGenContext::removeobfrominv() { +void DreamGenContext::removeObFromInv() { STACK_CHECK; _cmp(data.byte(kCommand), 100); if (flags.z()) return /* (obnotexist) */; - getanyad(); + getAnyAd(); di = bx; cl = data.byte(kCommand); ch = 0; - deleteexobject(); + deleteExObject(); } -void DreamGenContext::selectopenob() { +void DreamGenContext::selectOpenOb() { STACK_CHECK; al = data.byte(kCommand); - getanyad(); + getAnyAd(); _cmp(al, 255); if (!flags.z()) goto canopenit1; @@ -5077,7 +1974,7 @@ canopenit1: bl = data.byte(kCommand); bh = data.byte(kObjecttype); al = 38; - commandwithob(); + commandWithOb(); alreadyopob: ax = data.word(kMousebutton); _cmp(ax, data.word(kOldbutton)); @@ -5092,21 +1989,21 @@ doopenob: data.byte(kOpenedob) = al; al = data.byte(kObjecttype); data.byte(kOpenedtype) = al; - createpanel(); - showpanel(); - showman(); - examicon(); - showexit(); - openinv(); - openob(); - undertextline(); - readmouse(); - showpointer(); - worktoscreen(); - delpointer(); -} - -void DreamGenContext::useopened() { + createPanel(); + showPanel(); + showMan(); + examIcon(); + showExit(); + openInv(); + openOb(); + underTextLine(); + readMouse(); + showPointer(); + workToScreen(); + delPointer(); +} + +void DreamGenContext::useOpened() { STACK_CHECK; _cmp(data.byte(kOpenedob), 255); if (flags.z()) @@ -5114,15 +2011,15 @@ void DreamGenContext::useopened() { _cmp(data.byte(kPickup), 0); if (!flags.z()) goto notout2; - outofopen(); + outOfOpen(); return; notout2: - findopenpos(); + findOpenPos(); ax = es.word(bx); _cmp(al, 255); if (flags.z()) goto canplace3; - swapwithopen(); + swapWithOpen(); return; canplace3: _cmp(data.byte(kPickup), 1); @@ -5144,7 +2041,7 @@ difsub2: data.word(kOldsubject) = ax; bx = ax; al = 35; - commandwithob(); + commandWithOb(); alreadyplc2: ax = data.word(kMousebutton); _cmp(ax, data.word(kOldbutton)); @@ -5155,14 +2052,14 @@ alreadyplc2: goto doplace2; return; doplace2: - geteitherad(); - isitworn(); + getEitherAd(); + isItWorn(); if (!flags.z()) goto notworntoopen; - wornerror(); + wornError(); return; notworntoopen: - delpointer(); + delPointer(); al = data.byte(kItemframe); _cmp(al, data.byte(kOpenedob)); if (!flags.z()) @@ -5171,10 +2068,10 @@ notworntoopen: _cmp(al, data.byte(kOpenedtype)); if (!flags.z()) goto isntsame; - errormessage1(); + errorMessage1(); return; isntsame: - checkobjectsize(); + checkObjectSize(); _cmp(al, 0); if (flags.z()) goto sizeok1; @@ -5182,7 +2079,7 @@ isntsame: sizeok1: data.byte(kPickup) = 0; al = data.byte(kItemframe); - geteitherad(); + getEitherAd(); al = data.byte(kOpenedtype); es.byte(bx+2) = al; al = data.byte(kOpenedob); @@ -5191,91 +2088,21 @@ sizeok1: es.byte(bx+4) = al; al = data.byte(kReallocation); es.byte(bx+5) = al; - fillopen(); - undertextline(); - readmouse(); - useopened(); - showpointer(); - worktoscreen(); - delpointer(); -} - -void DreamGenContext::errormessage1() { - STACK_CHECK; - delpointer(); - di = 76; - bx = 21; - al = 58; - dl = 240; - printmessage(); - readmouse(); - showpointer(); - worktoscreen(); - delpointer(); - cx = 50; - hangonp(); - showpanel(); - showman(); - examicon(); - readmouse(); - useopened(); - showpointer(); - worktoscreen(); - delpointer(); -} - -void DreamGenContext::errormessage2() { - STACK_CHECK; - data.byte(kCommandtype) = 255; - delpointer(); - di = 76; - bx = 21; - al = 59; - dl = 240; - printmessage(); - readmouse(); - showpointer(); - worktoscreen(); - delpointer(); - cx = 50; - hangonp(); - showpanel(); - showman(); - examicon(); - readmouse(); - useopened(); - showpointer(); - worktoscreen(); - delpointer(); + fillOpen(); + underTextLine(); + readMouse(); + useOpened(); + showPointer(); + workToScreen(); + delPointer(); } -void DreamGenContext::errormessage3() { +void DreamGenContext::checkObjectSize() { STACK_CHECK; - delpointer(); - di = 76; - bx = 21; - al = 60; - dl = 240; - printmessage(); - worktoscreenm(); - cx = 50; - hangonp(); - showpanel(); - showman(); - examicon(); - readmouse(); - useopened(); - showpointer(); - worktoscreen(); - delpointer(); -} - -void DreamGenContext::checkobjectsize() { - STACK_CHECK; - getopenedsize(); + getOpenedSize(); push(ax); al = data.byte(kItemframe); - geteitherad(); + getEitherAd(); al = es.byte(bx+9); cx = pop(); _cmp(al, 255); @@ -5289,7 +2116,7 @@ notunsized: _cmp(cl, 100); if (flags.c()) goto isntspecial; - errormessage3(); + errorMessage3(); goto sizewrong; isntspecial: _cmp(cl, al); @@ -5303,14 +2130,14 @@ specialcase: _cmp(cl, al); if (!flags.c()) goto sizeok; - errormessage2(); + errorMessage2(); goto sizewrong; bothspecial: _sub(cl, 100); _cmp(al, cl); if (flags.z()) goto sizeok; - errormessage3(); + errorMessage3(); sizewrong: al = 1; return; @@ -5318,12 +2145,12 @@ sizeok: al = 0; } -void DreamGenContext::outofopen() { +void DreamGenContext::outOfOpen() { STACK_CHECK; _cmp(data.byte(kOpenedob), 255); if (flags.z()) goto cantuseopen; - findopenpos(); + findOpenPos(); ax = es.word(bx); _cmp(al, 255); if (!flags.z()) @@ -5343,7 +2170,7 @@ difsub4: data.word(kOldsubject) = ax; bx = ax; al = 36; - commandwithob(); + commandWithOb(); alreadygrb: ax = data.word(kMousebutton); _cmp(ax, data.word(kOldbutton)); @@ -5355,43 +2182,43 @@ alreadygrb: _cmp(ax, 2); if (!flags.z()) return /* (notletgo4) */; - reexfromopen(); + reExFromOpen(); return; dogrb: - delpointer(); + delPointer(); data.byte(kPickup) = 1; - findopenpos(); + findOpenPos(); ax = es.word(bx); data.byte(kItemframe) = al; data.byte(kObjecttype) = ah; _cmp(ah, 4); if (!flags.z()) goto makeintoex; - geteitherad(); + getEitherAd(); es.byte(bx+2) = 20; es.byte(bx+3) = 255; goto actuallyout; makeintoex: - transfertoex(); + transferToEx(); data.byte(kItemframe) = al; data.byte(kObjecttype) = 4; - geteitherad(); + getEitherAd(); es.byte(bx+2) = 20; es.byte(bx+3) = 255; actuallyout: - fillopen(); - undertextline(); - readmouse(); - useopened(); - showpointer(); - worktoscreen(); - delpointer(); + fillOpen(); + underTextLine(); + readMouse(); + useOpened(); + showPointer(); + workToScreen(); + delPointer(); } -void DreamGenContext::transfertoex() { +void DreamGenContext::transferToEx() { STACK_CHECK; - emergencypurge(); - getexpos(); + emergencyPurge(); + getExPos(); al = data.byte(kExpos); push(ax); push(di); @@ -5415,9 +2242,9 @@ void DreamGenContext::transfertoex() { es.byte(di+4) = al; al = data.byte(kItemframe); data.byte(kItemtotran) = al; - transfermap(); - transferinv(); - transfertext(); + transferMap(); + transferInv(); + transferText(); al = data.byte(kItemframe); ah = 0; bx = 16; @@ -5425,11 +2252,11 @@ void DreamGenContext::transfertoex() { ds = data.word(kFreedat); si = ax; ds.byte(si+2) = 254; - pickupconts(); + pickupConts(); ax = pop(); } -void DreamGenContext::pickupconts() { +void DreamGenContext::pickupConts() { STACK_CHECK; al = ds.byte(si+7); _cmp(al, 255); @@ -5454,7 +2281,7 @@ pickupcontloop: if (!flags.z()) goto notinsidethis; data.byte(kItemtotran) = cl; - transfercontoex(); + transferConToEx(); notinsidethis: ax = pop(); dx = pop(); @@ -5468,14 +2295,14 @@ notinsidethis: goto pickupcontloop; } -void DreamGenContext::transfercontoex() { +void DreamGenContext::transferConToEx() { STACK_CHECK; push(es); push(bx); push(dx); push(es); push(bx); - getexpos(); + getExPos(); si = pop(); ds = pop(); push(di); @@ -5490,44 +2317,15 @@ void DreamGenContext::transfercontoex() { es.byte(di+1) = al; es.byte(di+3) = dl; es.byte(di+2) = 4; - transfermap(); - transferinv(); - transfertext(); + transferMap(); + transferInv(); + transferText(); si = pop(); ds = pop(); ds.byte(si+2) = 255; } -void DreamGenContext::transfertext() { - STACK_CHECK; - es = data.word(kExtras); - al = data.byte(kExpos); - ah = 0; - _add(ax, ax); - bx = (0+2080+30000+(16*114)); - _add(bx, ax); - di = data.word(kExtextpos); - es.word(bx) = di; - _add(di, (0+2080+30000+(16*114)+((114+2)*2))); - al = data.byte(kItemtotran); - ah = 0; - _add(ax, ax); - ds = data.word(kFreedesc); - bx = (0); - _add(bx, ax); - si = (0+(82*2)); - ax = ds.word(bx); - _add(si, ax); -moretext: - _lodsb(); - _stosb(); - _inc(data.word(kExtextpos)); - _cmp(al, 0); - if (!flags.z()) - goto moretext; -} - -void DreamGenContext::purgealocation() { +void DreamGenContext::purgeALocation() { STACK_CHECK; push(ax); es = data.word(kExtras); @@ -5545,7 +2343,7 @@ purgeloc: push(es); push(bx); push(cx); - deleteexobject(); + deleteExObject(); cx = pop(); bx = pop(); es = pop(); @@ -5558,7 +2356,7 @@ dontpurge: goto purgeloc; } -void DreamGenContext::emergencypurge() { +void DreamGenContext::emergencyPurge() { STACK_CHECK; checkpurgeagain: ax = data.word(kExframepos); @@ -5566,7 +2364,7 @@ checkpurgeagain: _cmp(ax, (30000)); if (flags.c()) goto notnearframeend; - purgeanitem(); + purgeAnItem(); goto checkpurgeagain; notnearframeend: ax = data.word(kExtextpos); @@ -5574,11 +2372,11 @@ notnearframeend: _cmp(ax, (18000)); if (flags.c()) return /* (notneartextend) */; - purgeanitem(); + purgeAnItem(); goto checkpurgeagain; } -void DreamGenContext::purgeanitem() { +void DreamGenContext::purgeAnItem() { STACK_CHECK; es = data.word(kExtras); di = (0+2080+30000); @@ -5599,7 +2397,7 @@ iscup: _cmp(es.byte(di+11), bl); if (flags.z()) goto cantpurge; - deleteexobject(); + deleteExObject(); return; cantpurge: _add(di, 16); @@ -5618,7 +2416,7 @@ lookforpurge2: _cmp(es.byte(di+12), 255); if (!flags.z()) goto cantpurge2; - deleteexobject(); + deleteExObject(); return; cantpurge2: _add(di, 16); @@ -5628,7 +2426,7 @@ cantpurge2: goto lookforpurge2; } -void DreamGenContext::deleteexobject() { +void DreamGenContext::deleteExObject() { STACK_CHECK; push(cx); push(cx); @@ -5641,15 +2439,15 @@ void DreamGenContext::deleteexobject() { cl = al; _add(al, al); _add(al, cl); - deleteexframe(); + deleteExFrame(); ax = pop(); cl = al; _add(al, al); _add(al, cl); _inc(al); - deleteexframe(); + deleteExFrame(); ax = pop(); - deleteextext(); + deleteExText(); bx = pop(); bh = bl; bl = 4; @@ -5662,7 +2460,7 @@ deleteconts: push(bx); push(cx); push(di); - deleteexobject(); + deleteExObject(); di = pop(); cx = pop(); bx = pop(); @@ -5674,7 +2472,7 @@ notinsideex: goto deleteconts; } -void DreamGenContext::deleteexframe() { +void DreamGenContext::deleteExFrame() { STACK_CHECK; di = (0); ah = 0; @@ -5715,7 +2513,7 @@ beforethisone: goto shuffleadsdown; } -void DreamGenContext::deleteextext() { +void DreamGenContext::deleteExText() { STACK_CHECK; di = (0+2080+30000+(16*114)); ah = 0; @@ -5759,261 +2557,26 @@ beforethistext: goto shuffletextads; } -void DreamGenContext::blockget() { - STACK_CHECK; - ah = al; - al = 0; - ds = data.word(kBackdrop); - si = (0+192); - _add(si, ax); -} - -void DreamGenContext::drawfloor() { - STACK_CHECK; - push(es); - push(bx); - eraseoldobs(); - drawflags(); - calcmapad(); - doblocks(); - showallobs(); - showallfree(); - showallex(); - paneltomap(); - initrain(); - data.byte(kNewobs) = 0; - bx = pop(); - es = pop(); -} - -void DreamGenContext::autolook() { - STACK_CHECK; - ax = data.word(kMousex); - _cmp(ax, data.word(kOldx)); - if (!flags.z()) - goto diffmouse; - ax = data.word(kMousey); - _cmp(ax, data.word(kOldy)); - if (!flags.z()) - goto diffmouse; - _dec(data.word(kLookcounter)); - _cmp(data.word(kLookcounter), 0); - if (!flags.z()) - return /* (noautolook) */; - _cmp(data.word(kWatchingtime), 0); - if (!flags.z()) - return /* (noautolook) */; - dolook(); - return; -diffmouse: - data.word(kLookcounter) = 1000; -} - -void DreamGenContext::look() { - STACK_CHECK; - _cmp(data.word(kWatchingtime), 0); - if (!flags.z()) - { blank(); return; }; - _cmp(data.byte(kPointermode), 2); - if (flags.z()) - { blank(); return; }; - _cmp(data.byte(kCommandtype), 241); - if (flags.z()) - goto alreadylook; - data.byte(kCommandtype) = 241; - al = 25; - commandonly(); -alreadylook: - _cmp(data.word(kMousebutton), 1); - if (!flags.z()) - return /* (nolook) */; - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (nolook) */; - dolook(); -} - -void DreamGenContext::dolook() { - STACK_CHECK; - createpanel(); - showicon(); - undertextline(); - worktoscreenm(); - data.byte(kCommandtype) = 255; - dumptextline(); - bl = data.byte(kRoomnum); - _and(bl, 31); - bh = 0; - _add(bx, bx); - es = data.word(kRoomdesc); - _add(bx, (0)); - si = es.word(bx); - _add(si, (0+(38*2))); - findnextcolon(); - di = 66; - _cmp(data.byte(kReallocation), 50); - if (flags.c()) - goto notdream3; - di = 40; -notdream3: - bx = 80; - dl = 241; - printslow(); - _cmp(al, 1); - if (flags.z()) - goto afterlook; - cx = 400; - hangonp(); -afterlook: - data.byte(kPointermode) = 0; - data.byte(kCommandtype) = 0; - redrawmainscrn(); - worktoscreenm(); -} - -void DreamGenContext::redrawmainscrn() { - STACK_CHECK; - data.word(kTimecount) = 0; - createpanel(); - data.byte(kNewobs) = 0; - drawfloor(); - printsprites(); - reelsonscreen(); - showicon(); - getunderzoom(); - undertextline(); - readmouse(); - data.byte(kCommandtype) = 255; -} - -void DreamGenContext::getback1() { - STACK_CHECK; - _cmp(data.byte(kPickup), 0); - if (flags.z()) - goto notgotobject; - blank(); - return; -notgotobject: - _cmp(data.byte(kCommandtype), 202); - if (flags.z()) - goto alreadyget; - data.byte(kCommandtype) = 202; - al = 26; - commandonly(); -alreadyget: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (nogetback) */; - _and(ax, 1); - if (!flags.z()) - goto dogetback; - return; -dogetback: - data.byte(kGetback) = 1; - data.byte(kPickup) = 0; -} - -void DreamGenContext::talk() { - STACK_CHECK; - data.byte(kTalkpos) = 0; - data.byte(kInmaparea) = 0; - al = data.byte(kCommand); - data.byte(kCharacter) = al; - createpanel(); - showpanel(); - showman(); - showexit(); - undertextline(); - convicons(); - starttalk(); - data.byte(kCommandtype) = 255; - readmouse(); - showpointer(); - worktoscreen(); -waittalk: - delpointer(); - readmouse(); - animpointer(); - showpointer(); - vsync(); - dumppointer(); - dumptextline(); - data.byte(kGetback) = 0; - bx = offset_talklist; - checkcoords(); - _cmp(data.byte(kQuitrequested), 0); - if (!flags.z()) - goto finishtalk; - _cmp(data.byte(kGetback), 0); - if (flags.z()) - goto waittalk; -finishtalk: - bx = data.word(kPersondata); - es = cs; - _cmp(data.byte(kTalkpos), 4); - if (flags.c()) - goto notnexttalk; - al = es.byte(bx+7); - _or(al, 128); - es.byte(bx+7) = al; -notnexttalk: - redrawmainscrn(); - worktoscreenm(); - _cmp(data.byte(kSpeechloaded), 1); - if (!flags.z()) - return /* (nospeech) */; - cancelch1(); - data.byte(kVolumedirection) = -1; - data.byte(kVolumeto) = 0; -} - -void DreamGenContext::convicons() { - STACK_CHECK; - al = data.byte(kCharacter); - _and(al, 127); - getpersframe(); - di = 234; - bx = 2; - data.word(kCurrentframe) = ax; - findsource(); - ax = data.word(kCurrentframe); - _sub(ax, data.word(kTakeoff)); - ah = 0; - showframe(); -} - -void DreamGenContext::getpersframe() { - STACK_CHECK; - ah = 0; - _add(ax, ax); - bx = ax; - es = data.word(kPeople); - _add(bx, (0)); - ax = es.word(bx); -} - -void DreamGenContext::starttalk() { +void DreamGenContext::startTalk() { STACK_CHECK; data.byte(kTalkmode) = 0; al = data.byte(kCharacter); _and(al, 127); - getpersontext(); + getPersonText(); data.word(kCharshift) = 91+91; di = 66; bx = 64; dl = 241; al = 0; ah = 79; - printdirect(); + printDirect(); data.word(kCharshift) = 0; di = 66; bx = 80; dl = 241; al = 0; ah = 0; - printdirect(); + printDirect(); data.byte(kSpeechloaded) = 0; al = data.byte(kCharacter); _and(al, 127); @@ -6023,17 +2586,17 @@ void DreamGenContext::starttalk() { cl = 'C'; dl = 'R'; dh = data.byte(kReallocation); - loadspeech(); + loadSpeech(); _cmp(data.byte(kSpeechloaded), 1); if (!flags.z()) return /* (nospeech1) */; data.byte(kVolumedirection) = 1; data.byte(kVolumeto) = 6; al = 50+12; - playchannel1(); + playChannel1(); } -void DreamGenContext::getpersontext() { +void DreamGenContext::getPersonText() { STACK_CHECK; ah = 0; cx = 64*2; @@ -6047,41 +2610,7 @@ void DreamGenContext::getpersontext() { si = ax; } -void DreamGenContext::moretalk() { - STACK_CHECK; - _cmp(data.byte(kTalkmode), 0); - if (flags.z()) - goto canmore; - redes(); - return; -canmore: - _cmp(data.byte(kCommandtype), 215); - if (flags.z()) - goto alreadymore; - data.byte(kCommandtype) = 215; - al = 49; - commandonly(); -alreadymore: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (nomore) */; - _and(ax, 1); - if (!flags.z()) - goto domoretalk; - return; -domoretalk: - data.byte(kTalkmode) = 2; - data.byte(kTalkpos) = 4; - _cmp(data.byte(kCharacter), 100); - if (flags.c()) - goto notsecondpart; - data.byte(kTalkpos) = 48; -notsecondpart: - dosometalk(); -} - -void DreamGenContext::dosometalk() { +void DreamGenContext::doSomeTalk() { STACK_CHECK; dospeech: al = data.byte(kTalkpos); @@ -6107,11 +2636,11 @@ dospeech: goto endheartalk; push(es); push(si); - createpanel(); - showpanel(); - showman(); - showexit(); - convicons(); + createPanel(); + showPanel(); + showMan(); + showExit(); + convIcons(); si = pop(); es = pop(); di = 164; @@ -6119,7 +2648,7 @@ dospeech: dl = 144; al = 0; ah = 0; - printdirect(); + printDirect(); al = data.byte(kCharacter); _and(al, 127); ah = 0; @@ -6131,17 +2660,17 @@ dospeech: cl = 'C'; dl = 'R'; dh = data.byte(kReallocation); - loadspeech(); + loadSpeech(); _cmp(data.byte(kSpeechloaded), 0); if (flags.z()) goto noplay1; al = 62; - playchannel1(); + playChannel1(); noplay1: data.byte(kPointermode) = 3; - worktoscreenm(); + workToScreenM(); cx = 180; - hangonpq(); + hangOnPQ(); if (!flags.c()) goto _tmp1; return; @@ -6176,11 +2705,11 @@ _tmp1: goto skiptalk2; push(es); push(si); - createpanel(); - showpanel(); - showman(); - showexit(); - convicons(); + createPanel(); + showPanel(); + showMan(); + showExit(); + convIcons(); si = pop(); es = pop(); di = 48; @@ -6188,7 +2717,7 @@ _tmp1: dl = 144; al = 0; ah = 0; - printdirect(); + printDirect(); al = data.byte(kCharacter); _and(al, 127); ah = 0; @@ -6200,17 +2729,17 @@ _tmp1: cl = 'C'; dl = 'R'; dh = data.byte(kReallocation); - loadspeech(); + loadSpeech(); _cmp(data.byte(kSpeechloaded), 0); if (flags.z()) goto noplay2; al = 62; - playchannel1(); + playChannel1(); noplay2: data.byte(kPointermode) = 3; - worktoscreenm(); + workToScreenM(); cx = 180; - hangonpq(); + hangOnPQ(); if (!flags.c()) goto skiptalk2; return; @@ -6221,206 +2750,14 @@ endheartalk: data.byte(kPointermode) = 0; } -void DreamGenContext::hangonpq() { - STACK_CHECK; - data.byte(kGetback) = 0; - bx = 0; -hangloopq: - push(cx); - push(bx); - delpointer(); - readmouse(); - animpointer(); - showpointer(); - vsync(); - dumppointer(); - dumptextline(); - bx = offset_quitlist; - checkcoords(); - bx = pop(); - cx = pop(); - _cmp(data.byte(kGetback), 1); - if (flags.z()) - goto quitconv; - _cmp(data.byte(kQuitrequested), 0); - if (!flags.z()) - goto quitconv; - _cmp(data.byte(kSpeechloaded), 1); - if (!flags.z()) - goto notspeaking; - _cmp(data.byte(kCh1playing), 255); - if (!flags.z()) - goto notspeaking; - _inc(bx); - _cmp(bx, 40); - if (flags.z()) - goto finishconv; -notspeaking: - _cmp(data.word(kMousebutton), 0); - if (flags.z()) - goto hangloopq; - _cmp(data.word(kOldbutton), 0); - if (!flags.z()) - goto hangloopq; -finishconv: - delpointer(); - data.byte(kPointermode) = 0; - flags._c = false; - return; -quitconv: - delpointer(); - data.byte(kPointermode) = 0; - cancelch1(); - flags._c = true; - } - -void DreamGenContext::redes() { - STACK_CHECK; - _cmp(data.byte(kCh1playing), 255); - if (!flags.z()) - goto cantredes; - _cmp(data.byte(kTalkmode), 2); - if (flags.z()) - goto canredes; -cantredes: - blank(); - return; -canredes: - _cmp(data.byte(kCommandtype), 217); - if (flags.z()) - goto alreadyreds; - data.byte(kCommandtype) = 217; - al = 50; - commandonly(); -alreadyreds: - ax = data.word(kMousebutton); - _and(ax, 1); - if (!flags.z()) - goto doredes; - return; -doredes: - delpointer(); - createpanel(); - showpanel(); - showman(); - showexit(); - convicons(); - starttalk(); - readmouse(); - showpointer(); - worktoscreen(); - delpointer(); -} - -void DreamGenContext::newplace() { - STACK_CHECK; - _cmp(data.byte(kNeedtotravel), 1); - if (flags.z()) - goto istravel; - _cmp(data.byte(kAutolocation), -1); - if (!flags.z()) - goto isautoloc; - return; -isautoloc: - al = data.byte(kAutolocation); - data.byte(kNewlocation) = al; - data.byte(kAutolocation) = -1; - return; -istravel: - data.byte(kNeedtotravel) = 0; - selectlocation(); -} - -void DreamGenContext::selectlocation() { - STACK_CHECK; - data.byte(kInmaparea) = 0; - clearbeforeload(); - data.byte(kGetback) = 0; - data.byte(kPointerframe) = 22; - readcitypic(); - showcity(); - getridoftemp(); - readdesticon(); - loadtraveltext(); - showpanel(); - showman(); - showarrows(); - showexit(); - locationpic(); - undertextline(); - data.byte(kCommandtype) = 255; - readmouse(); - data.byte(kPointerframe) = 0; - showpointer(); - worktoscreen(); - al = 9; - ah = 255; - playchannel0(); - data.byte(kNewlocation) = 255; -select: - _cmp(data.byte(kQuitrequested), 0); - if (!flags.z()) - goto quittravel; - delpointer(); - readmouse(); - showpointer(); - vsync(); - dumppointer(); - dumptextline(); - _cmp(data.byte(kGetback), 1); - if (flags.z()) - goto quittravel; - bx = offset_destlist; - checkcoords(); - _cmp(data.byte(kNewlocation), 255); - if (flags.z()) - goto select; - al = data.byte(kNewlocation); - _cmp(al, data.byte(kLocation)); - if (flags.z()) - goto quittravel; - getridoftemp(); - getridoftemp2(); - getridoftemp3(); - es = data.word(kTraveltext); - deallocatemem(); - return; -quittravel: - al = data.byte(kReallocation); - data.byte(kNewlocation) = al; - data.byte(kGetback) = 0; - getridoftemp(); - getridoftemp2(); - getridoftemp3(); - es = data.word(kTraveltext); - deallocatemem(); -} - -void DreamGenContext::showcity() { - STACK_CHECK; - clearwork(); - ds = data.word(kTempgraphics); - di = 57; - bx = 32; - al = 0; - ah = 0; - showframe(); - ds = data.word(kTempgraphics); - di = 120+57; - bx = 32; - al = 1; - ah = 0; - showframe(); -} - -void DreamGenContext::lookatplace() { +void DreamGenContext::lookAtPlace() { STACK_CHECK; _cmp(data.byte(kCommandtype), 224); if (flags.z()) goto alreadyinfo; data.byte(kCommandtype) = 224; al = 27; - commandonly(); + commandOnly(); alreadyinfo: ax = data.word(kMousebutton); _and(ax, 1); @@ -6434,20 +2771,20 @@ alreadyinfo: if (!flags.c()) return /* (noinfo) */; push(bx); - delpointer(); - deltextline(); - getundercentre(); + delPointer(); + delTextLine(); + getUnderCentre(); ds = data.word(kTempgraphics3); al = 0; ah = 0; di = 60; bx = 72; - showframe(); + showFrame(); al = 4; ah = 0; di = 60; bx = 72+55; - showframe(); + showFrame(); _cmp(data.byte(kForeignrelease), 0); if (flags.z()) goto _tmp1; @@ -6455,7 +2792,7 @@ alreadyinfo: ah = 0; di = 60; bx = 72+55+21; - showframe(); + showFrame(); _tmp1: bx = pop(); bh = 0; @@ -6463,7 +2800,7 @@ _tmp1: es = data.word(kTraveltext); si = es.word(bx); _add(si, (66*2)); - findnextcolon(); + findNextColon(); di = 63; bx = 84; _cmp(data.byte(kForeignrelease), 0); @@ -6474,17 +2811,17 @@ _tmp2: dl = 191; al = 0; ah = 0; - printdirect(); - worktoscreenm(); + printDirect(); + workToScreenM(); cx = 500; - hangonp(); + hangOnP(); data.byte(kPointermode) = 0; data.byte(kPointerframe) = 0; - putundercentre(); - worktoscreenm(); + putUnderCentre(); + workToScreenM(); } -void DreamGenContext::getundercentre() { +void DreamGenContext::getUnderCentre() { STACK_CHECK; di = 58; bx = 72; @@ -6492,10 +2829,10 @@ void DreamGenContext::getundercentre() { si = 0; cl = 254; ch = 110; - multiget(); + multiGet(); } -void DreamGenContext::putundercentre() { +void DreamGenContext::putUnderCentre() { STACK_CHECK; di = 58; bx = 72; @@ -6503,12 +2840,12 @@ void DreamGenContext::putundercentre() { si = 0; cl = 254; ch = 110; - multiput(); + multiPut(); } -void DreamGenContext::locationpic() { +void DreamGenContext::locationPic() { STACK_CHECK; - getdestinfo(); + getDestInfo(); al = es.byte(si); push(es); push(si); @@ -6526,7 +2863,7 @@ gotgraphic: _add(di, 104); bx = 138+14; ah = 0; - showframe(); + showFrame(); si = pop(); es = pop(); al = data.byte(kDestpos); @@ -6538,7 +2875,7 @@ gotgraphic: bx = 140+14; ds = data.word(kTempgraphics); ah = 0; - showframe(); + showFrame(); notinthisone: bl = data.byte(kDestpos); bh = 0; @@ -6551,212 +2888,67 @@ notinthisone: dl = 241; al = 0; ah = 0; - printdirect(); + printDirect(); } -void DreamGenContext::getdestinfo() { +void DreamGenContext::getDestInfo() { STACK_CHECK; al = data.byte(kDestpos); ah = 0; push(ax); dx = data; es = dx; - si = 8011; + si = 1249; _add(si, ax); cl = es.byte(si); ax = pop(); push(cx); dx = data; es = dx; - si = 8027; + si = 1265; _add(si, ax); ax = pop(); } -void DreamGenContext::showarrows() { - STACK_CHECK; - di = 116-12; - bx = 16; - ds = data.word(kTempgraphics); - al = 0; - ah = 0; - showframe(); - di = 226+12; - bx = 16; - ds = data.word(kTempgraphics); - al = 1; - ah = 0; - showframe(); - di = 280; - bx = 14; - ds = data.word(kTempgraphics); - al = 2; - ah = 0; - showframe(); -} - -void DreamGenContext::nextdest() { - STACK_CHECK; - _cmp(data.byte(kCommandtype), 218); - if (flags.z()) - goto alreadydu; - data.byte(kCommandtype) = 218; - al = 28; - commandonly(); -alreadydu: - ax = data.word(kMousebutton); - _and(ax, 1); - if (flags.z()) - return /* (nodu) */; - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (nodu) */; -searchdestup: - _inc(data.byte(kDestpos)); - _cmp(data.byte(kDestpos), 15); - if (!flags.z()) - goto notlastdest; - data.byte(kDestpos) = 0; -notlastdest: - getdestinfo(); - _cmp(al, 0); - if (flags.z()) - goto searchdestup; - data.byte(kNewtextline) = 1; - deltextline(); - delpointer(); - showpanel(); - showman(); - showarrows(); - locationpic(); - undertextline(); - readmouse(); - showpointer(); - worktoscreen(); - delpointer(); -} - -void DreamGenContext::lastdest() { - STACK_CHECK; - _cmp(data.byte(kCommandtype), 219); - if (flags.z()) - goto alreadydd; - data.byte(kCommandtype) = 219; - al = 29; - commandonly(); -alreadydd: - ax = data.word(kMousebutton); - _and(ax, 1); - if (flags.z()) - return /* (nodd) */; - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (nodd) */; -searchdestdown: - _dec(data.byte(kDestpos)); - _cmp(data.byte(kDestpos), -1); - if (!flags.z()) - goto notfirstdest; - data.byte(kDestpos) = 15; -notfirstdest: - getdestinfo(); - _cmp(al, 0); - if (flags.z()) - goto searchdestdown; - data.byte(kNewtextline) = 1; - deltextline(); - delpointer(); - showpanel(); - showman(); - showarrows(); - locationpic(); - undertextline(); - readmouse(); - showpointer(); - worktoscreen(); - delpointer(); -} - -void DreamGenContext::destselect() { - STACK_CHECK; - _cmp(data.byte(kCommandtype), 222); - if (flags.z()) - goto alreadytrav; - data.byte(kCommandtype) = 222; - al = 30; - commandonly(); -alreadytrav: - ax = data.word(kMousebutton); - _and(ax, 1); - if (flags.z()) - return /* (notrav) */; - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (notrav) */; - getdestinfo(); - al = data.byte(kDestpos); - data.byte(kNewlocation) = al; -} - -void DreamGenContext::getlocation() { - STACK_CHECK; - ah = 0; - bx = ax; - dx = data; - es = dx; - _add(bx, 8011); - al = es.byte(bx); -} - -void DreamGenContext::setlocation() { - STACK_CHECK; - ah = 0; - bx = ax; - dx = data; - es = dx; - _add(bx, 8011); - es.byte(bx) = 1; -} - -void DreamGenContext::resetlocation() { +void DreamGenContext::resetLocation() { STACK_CHECK; push(ax); _cmp(al, 5); if (!flags.z()) goto notdelhotel; - purgealocation(); + purgeALocation(); al = 21; - purgealocation(); + purgeALocation(); al = 22; - purgealocation(); + purgeALocation(); al = 27; - purgealocation(); + purgeALocation(); goto clearedlocations; notdelhotel: _cmp(al, 8); if (!flags.z()) goto notdeltvstud; - purgealocation(); + purgeALocation(); al = 28; - purgealocation(); + purgeALocation(); goto clearedlocations; notdeltvstud: _cmp(al, 6); if (!flags.z()) goto notdelsarters; - purgealocation(); + purgeALocation(); al = 20; - purgealocation(); + purgeALocation(); al = 25; - purgealocation(); + purgeALocation(); goto clearedlocations; notdelsarters: _cmp(al, 13); if (!flags.z()) goto notdelboathouse; - purgealocation(); + purgeALocation(); al = 29; - purgealocation(); + purgeALocation(); goto clearedlocations; notdelboathouse: clearedlocations: @@ -6765,252 +2957,19 @@ clearedlocations: bx = ax; dx = data; es = dx; - _add(bx, 8011); + _add(bx, 1249); es.byte(bx) = 0; } -void DreamGenContext::readdesticon() { - STACK_CHECK; - dx = 2013; - loadintotemp(); - dx = 2026; - loadintotemp2(); - dx = 1961; - loadintotemp3(); -} - -void DreamGenContext::readcitypic() { - STACK_CHECK; - dx = 2000; - loadintotemp(); -} - -void DreamGenContext::usemon() { - STACK_CHECK; - data.byte(kLasttrigger) = 0; - es = cs; - di = 2970+1; - cx = 12; - al = 32; - _stosb(cx, true); - es = cs; - di = offset_operand1+1; - cx = 12; - al = 32; - _stosb(cx, true); - es = cs; - di = offset_keys; - es.byte(di) = 1; - _add(di, 26); - cx = 3; -keyloop: - es.byte(di) = 0; - _add(di, 26); - if (--cx) - goto keyloop; - createpanel(); - showpanel(); - showicon(); - drawfloor(); - getridofall(); - dx = 1974; - loadintotemp(); - loadpersonal(); - loadnews(); - loadcart(); - dx = 1870; - loadtempcharset(); - printoutermon(); - initialmoncols(); - printlogo(); - worktoscreen(); - turnonpower(); - fadeupyellows(); - fadeupmonfirst(); - data.word(kMonadx) = 76; - data.word(kMonady) = 141; - al = 1; - monmessage(); - cx = 120; - hangoncurs(); - al = 2; - monmessage(); - cx = 60; - randomaccess(); - al = 3; - monmessage(); - cx = 100; - hangoncurs(); - printlogo(); - scrollmonitor(); - data.word(kBufferin) = 0; - data.word(kBufferout) = 0; -moreinput: - di = data.word(kMonadx); - bx = data.word(kMonady); - push(di); - push(bx); - input(); - bx = pop(); - di = pop(); - data.word(kMonadx) = di; - data.word(kMonady) = bx; - execcommand(); - _cmp(al, 0); - if (flags.z()) - goto moreinput; - getridoftemp(); - getridoftempcharset(); - es = data.word(kTextfile1); - deallocatemem(); - es = data.word(kTextfile2); - deallocatemem(); - es = data.word(kTextfile3); - deallocatemem(); - data.byte(kGetback) = 1; - al = 26; - playchannel1(); - data.byte(kManisoffscreen) = 0; - restoreall(); - redrawmainscrn(); - worktoscreenm(); -} - -void DreamGenContext::printoutermon() { - STACK_CHECK; - di = 40; - bx = 32; - ds = data.word(kTempgraphics); - al = 1; - ah = 0; - showframe(); - di = 264; - bx = 32; - ds = data.word(kTempgraphics); - al = 2; - ah = 0; - showframe(); - di = 40; - bx = 12; - ds = data.word(kTempgraphics); - al = 3; - ah = 0; - showframe(); - di = 40; - bx = 164; - ds = data.word(kTempgraphics); - al = 4; - ah = 0; - showframe(); -} - -void DreamGenContext::loadpersonal() { - STACK_CHECK; - al = data.byte(kLocation); - dx = 2052; - _cmp(al, 0); - if (flags.z()) - goto foundpersonal; - _cmp(al, 42); - if (flags.z()) - goto foundpersonal; - dx = 2065; - _cmp(al, 2); - if (flags.z()) - goto foundpersonal; -foundpersonal: - openfile(); - readheader(); - bx = es.word(di); - push(bx); - cl = 4; - _shr(bx, cl); - allocatemem(); - data.word(kTextfile1) = ax; - ds = ax; - cx = pop(); - dx = 0; - readfromfile(); - closefile(); -} - -void DreamGenContext::loadnews() { - STACK_CHECK; - al = data.byte(kNewsitem); - dx = 2078; - _cmp(al, 0); - if (flags.z()) - goto foundnews; - dx = 2091; - _cmp(al, 1); - if (flags.z()) - goto foundnews; - dx = 2104; - _cmp(al, 2); - if (flags.z()) - goto foundnews; - dx = 2117; -foundnews: - openfile(); - readheader(); - bx = es.word(di); - push(bx); - cl = 4; - _shr(bx, cl); - allocatemem(); - data.word(kTextfile2) = ax; - ds = ax; - cx = pop(); - dx = 0; - readfromfile(); - closefile(); -} - -void DreamGenContext::loadcart() { - STACK_CHECK; - lookininterface(); - dx = 2130; - _cmp(al, 0); - if (flags.z()) - goto gotcart; - dx = 2143; - _cmp(al, 1); - if (flags.z()) - goto gotcart; - dx = 2156; - _cmp(al, 2); - if (flags.z()) - goto gotcart; - dx = 2169; - _cmp(al, 3); - if (flags.z()) - goto gotcart; - dx = 2182; -gotcart: - openfile(); - readheader(); - bx = es.word(di); - push(bx); - cl = 4; - _shr(bx, cl); - allocatemem(); - data.word(kTextfile3) = ax; - ds = ax; - cx = pop(); - dx = 0; - readfromfile(); - closefile(); -} - -void DreamGenContext::lookininterface() { +void DreamGenContext::lookInInterface() { STACK_CHECK; al = 'I'; ah = 'N'; cl = 'T'; ch = 'F'; - findsetobject(); + findSetObject(); ah = 1; - checkinside(); + checkInside(); _cmp(cl, (114)); if (flags.z()) goto emptyinterface; @@ -7021,244 +2980,7 @@ emptyinterface: al = 0; } -void DreamGenContext::turnonpower() { - STACK_CHECK; - cx = 3; -powerloop: - push(cx); - powerlighton(); - cx = 30; - hangon(); - powerlightoff(); - cx = 30; - hangon(); - cx = pop(); - if (--cx) - goto powerloop; - powerlighton(); -} - -void DreamGenContext::randomaccess() { - STACK_CHECK; -accessloop: - push(cx); - vsync(); - vsync(); - randomnum1(); - _and(al, 15); - _cmp(al, 10); - if (flags.c()) - goto off; - accesslighton(); - goto chosenaccess; -off: - accesslightoff(); -chosenaccess: - cx = pop(); - if (--cx) - goto accessloop; - accesslightoff(); -} - -void DreamGenContext::powerlighton() { - STACK_CHECK; - di = 257+4; - bx = 182; - ds = data.word(kTempgraphics); - al = 6; - ah = 0; - push(di); - push(bx); - showframe(); - bx = pop(); - di = pop(); - cl = 12; - ch = 8; - multidump(); -} - -void DreamGenContext::powerlightoff() { - STACK_CHECK; - di = 257+4; - bx = 182; - ds = data.word(kTempgraphics); - al = 5; - ah = 0; - push(di); - push(bx); - showframe(); - bx = pop(); - di = pop(); - cl = 12; - ch = 8; - multidump(); -} - -void DreamGenContext::accesslighton() { - STACK_CHECK; - di = 74; - bx = 182; - ds = data.word(kTempgraphics); - al = 8; - ah = 0; - push(di); - push(bx); - showframe(); - bx = pop(); - di = pop(); - cl = 12; - ch = 8; - multidump(); -} - -void DreamGenContext::accesslightoff() { - STACK_CHECK; - di = 74; - bx = 182; - ds = data.word(kTempgraphics); - al = 7; - ah = 0; - push(di); - push(bx); - showframe(); - bx = pop(); - di = pop(); - cl = 12; - ch = 8; - multidump(); -} - -void DreamGenContext::locklighton() { - STACK_CHECK; - di = 56; - bx = 182; - ds = data.word(kTempgraphics); - al = 10; - ah = 0; - push(di); - push(bx); - showframe(); - bx = pop(); - di = pop(); - cl = 12; - ch = 8; - multidump(); -} - -void DreamGenContext::locklightoff() { - STACK_CHECK; - di = 56; - bx = 182; - ds = data.word(kTempgraphics); - al = 9; - ah = 0; - push(di); - push(bx); - showframe(); - bx = pop(); - di = pop(); - cl = 12; - ch = 8; - multidump(); -} - -void DreamGenContext::input() { - STACK_CHECK; - es = cs; - di = 8045; - cx = 64; - al = 0; - _stosb(cx, true); - data.word(kCurpos) = 0; - al = '>'; - di = data.word(kMonadx); - bx = data.word(kMonady); - ds = data.word(kTempcharset); - ah = 0; - printchar(); - di = data.word(kMonadx); - bx = data.word(kMonady); - cl = 6; - ch = 8; - multidump(); - _add(data.word(kMonadx), 6); - ax = data.word(kMonadx); - data.word(kCurslocx) = ax; - ax = data.word(kMonady); - data.word(kCurslocy) = ax; -waitkey: - printcurs(); - vsync(); - delcurs(); - readkey(); - al = data.byte(kCurrentkey); - _cmp(al, 0); - if (flags.z()) - goto waitkey; - _cmp(al, 13); - if (flags.z()) - return /* (endofinput) */; - _cmp(al, 8); - if (!flags.z()) - goto notdel; - _cmp(data.word(kCurpos), 0); - if (flags.z()) - goto waitkey; - delchar(); - goto waitkey; -notdel: - _cmp(data.word(kCurpos), 28); - if (flags.z()) - goto waitkey; - _cmp(data.byte(kCurrentkey), 32); - if (!flags.z()) - goto notleadingspace; - _cmp(data.word(kCurpos), 0); - if (flags.z()) - goto waitkey; -notleadingspace: - makecaps(); - es = cs; - si = data.word(kCurpos); - _add(si, si); - _add(si, 8045); - es.byte(si) = al; - _cmp(al, 'Z'+1); - if (!flags.c()) - goto waitkey; - push(ax); - push(es); - push(si); - di = data.word(kMonadx); - bx = data.word(kMonady); - ds = data.word(kMapstore); - ax = data.word(kCurpos); - _xchg(al, ah); - si = ax; - cl = 8; - ch = 8; - multiget(); - si = pop(); - es = pop(); - ax = pop(); - push(es); - push(si); - di = data.word(kMonadx); - bx = data.word(kMonady); - ds = data.word(kTempcharset); - ah = 0; - printchar(); - si = pop(); - es = pop(); - es.byte(si+1) = cl; - ch = 0; - _add(data.word(kMonadx), cx); - _inc(data.word(kCurpos)); - _add(data.word(kCurslocx), cx); - goto waitkey; -} - -void DreamGenContext::makecaps() { +void DreamGenContext::makeCaps() { STACK_CHECK; _cmp(al, 'a'); if (flags.c()) @@ -7266,45 +2988,17 @@ void DreamGenContext::makecaps() { _sub(al, 32); } -void DreamGenContext::delchar() { - STACK_CHECK; - _dec(data.word(kCurpos)); - si = data.word(kCurpos); - _add(si, si); - es = cs; - _add(si, 8045); - es.byte(si) = 0; - al = es.byte(si+1); - ah = 0; - _sub(data.word(kMonadx), ax); - _sub(data.word(kCurslocx), ax); - di = data.word(kMonadx); - bx = data.word(kMonady); - ds = data.word(kMapstore); - ax = data.word(kCurpos); - _xchg(al, ah); - si = ax; - cl = 8; - ch = 8; - multiput(); - di = data.word(kMonadx); - bx = data.word(kMonady); - cl = al; - ch = 8; - multidump(); -} - -void DreamGenContext::execcommand() { +void DreamGenContext::execCommand() { STACK_CHECK; es = cs; bx = offset_comlist; ds = cs; - si = 8045; + si = 1283; al = ds.byte(si); _cmp(al, 0); if (!flags.z()) goto notblankinp; - scrollmonitor(); + scrollMonitor(); return; notblankinp: cl = 0; @@ -7329,7 +3023,7 @@ comloop2: _cmp(cl, 6); if (!flags.z()) goto comloop; - neterror(); + netError(); al = 0; return; foundcom: @@ -7352,11 +3046,11 @@ foundcom: goto keyscom; goto quitcom; directory: - dircom(); + dirCom(); al = 0; return; signoncom: - signon(); + signOn(); al = 0; return; accesscom: @@ -7364,34 +3058,27 @@ accesscom: al = 0; return; keyscom: - showkeys(); + showKeys(); al = 0; return; testcom: al = 6; - monmessage(); + monMessage(); al = 0; return; quitcom: al = 1; } -void DreamGenContext::neterror() { - STACK_CHECK; - al = 5; - monmessage(); - scrollmonitor(); -} - -void DreamGenContext::dircom() { +void DreamGenContext::dirCom() { STACK_CHECK; cx = 30; - randomaccess(); + randomAccess(); parser(); _cmp(es.byte(di+1), 0); if (flags.z()) goto dirroot; - dirfile(); + dirFile(); return; dirroot: data.byte(kLogonum) = 0; @@ -7399,24 +3086,24 @@ dirroot: si = offset_rootdir; _inc(si); es = cs; - di = 2970; + di = 1125; _inc(di); cx = 12; _movsb(cx, true); - monitorlogo(); - scrollmonitor(); + monitorLogo(); + scrollMonitor(); al = 9; - monmessage(); + monMessage(); es = data.word(kTextfile1); - searchforfiles(); + searchForFiles(); es = data.word(kTextfile2); - searchforfiles(); + searchForFiles(); es = data.word(kTextfile3); - searchforfiles(); - scrollmonitor(); + searchForFiles(); + scrollMonitor(); } -void DreamGenContext::searchforfiles() { +void DreamGenContext::searchForFiles() { STACK_CHECK; bx = (66*2); directloop1: @@ -7428,11 +3115,11 @@ directloop1: _cmp(al, 34); if (!flags.z()) goto directloop1; - monprint(); + monPrint(); goto directloop1; } -void DreamGenContext::signon() { +void DreamGenContext::signOn() { STACK_CHECK; parser(); _inc(di); @@ -7450,7 +3137,7 @@ signonloop2: _cmp(al, 32); if (flags.z()) goto foundsign; - makecaps(); + makeCaps(); ah = es.byte(di); _inc(di); _cmp(al, ah); @@ -7466,7 +3153,7 @@ nomatch: if (--cx) goto signonloop; al = 13; - monmessage(); + monMessage(); return; foundsign: di = pop(); @@ -7478,14 +3165,14 @@ foundsign: if (flags.z()) goto notyetassigned; al = 17; - monmessage(); + monMessage(); return; notyetassigned: push(es); push(bx); - scrollmonitor(); + scrollMonitor(); al = 15; - monmessage(); + monMessage(); di = data.word(kMonadx); bx = data.word(kMonady); push(di); @@ -7501,7 +3188,7 @@ notyetassigned: push(bx); _add(bx, 2); ds = cs; - si = 8045; + si = 1283; checkpass: _lodsw(); ah = es.byte(bx); @@ -7514,32 +3201,32 @@ checkpass: goto checkpass; bx = pop(); es = pop(); - scrollmonitor(); + scrollMonitor(); al = 16; - monmessage(); + monMessage(); return; passpassed: al = 14; - monmessage(); + monMessage(); bx = pop(); es = pop(); push(es); push(bx); _add(bx, 14); - monprint(); - scrollmonitor(); + monPrint(); + scrollMonitor(); bx = pop(); es = pop(); es.byte(bx) = 1; } -void DreamGenContext::showkeys() { +void DreamGenContext::showKeys() { STACK_CHECK; cx = 10; - randomaccess(); - scrollmonitor(); + randomAccess(); + scrollMonitor(); al = 18; - monmessage(); + monMessage(); es = cs; bx = offset_keys; cx = 4; @@ -7550,34 +3237,34 @@ keysloop: if (flags.z()) goto notheld; _add(bx, 14); - monprint(); + monPrint(); notheld: bx = pop(); cx = pop(); _add(bx, 26); if (--cx) goto keysloop; - scrollmonitor(); + scrollMonitor(); } void DreamGenContext::read() { STACK_CHECK; cx = 40; - randomaccess(); + randomAccess(); parser(); _cmp(es.byte(di+1), 0); if (!flags.z()) goto okcom; - neterror(); + netError(); return; okcom: es = cs; - di = 2970; + di = 1125; ax = data.word(kTextfile1); data.word(kMonsource) = ax; ds = ax; si = (66*2); - searchforstring(); + searchForString(); _cmp(al, 0); if (flags.z()) goto foundfile2; @@ -7585,7 +3272,7 @@ okcom: data.word(kMonsource) = ax; ds = ax; si = (66*2); - searchforstring(); + searchForString(); _cmp(al, 0); if (flags.z()) goto foundfile2; @@ -7593,15 +3280,15 @@ okcom: data.word(kMonsource) = ax; ds = ax; si = (66*2); - searchforstring(); + searchForString(); _cmp(al, 0); if (flags.z()) goto foundfile2; al = 7; - monmessage(); + monMessage(); return; foundfile2: - getkeyandlogo(); + getKeyAndLogo(); _cmp(al, 0); if (flags.z()) goto keyok1; @@ -7610,25 +3297,25 @@ keyok1: es = cs; di = offset_operand1; ds = data.word(kMonsource); - searchforstring(); + searchForString(); _cmp(al, 0); if (flags.z()) goto findtopictext; al = data.byte(kOldlogonum); data.byte(kLogonum) = al; al = 11; - monmessage(); + monMessage(); return; findtopictext: _inc(bx); push(es); push(bx); - monitorlogo(); - scrollmonitor(); + monitorLogo(); + scrollMonitor(); bx = pop(); es = pop(); moretopic: - monprint(); + monPrint(); al = es.byte(bx); _cmp(al, 34); if (flags.z()) @@ -7641,17 +3328,17 @@ moretopic: goto endoftopic; push(es); push(bx); - processtrigger(); + processTrigger(); cx = 24; - randomaccess(); + randomAccess(); bx = pop(); es = pop(); goto moretopic; endoftopic: - scrollmonitor(); + scrollMonitor(); } -void DreamGenContext::dirfile() { +void DreamGenContext::dirFile() { STACK_CHECK; al = 34; es.byte(di) = al; @@ -7659,7 +3346,7 @@ void DreamGenContext::dirfile() { push(di); ds = data.word(kTextfile1); si = (66*2); - searchforstring(); + searchForString(); _cmp(al, 0); if (flags.z()) goto foundfile; @@ -7669,7 +3356,7 @@ void DreamGenContext::dirfile() { push(di); ds = data.word(kTextfile2); si = (66*2); - searchforstring(); + searchForString(); _cmp(al, 0); if (flags.z()) goto foundfile; @@ -7679,19 +3366,19 @@ void DreamGenContext::dirfile() { push(di); ds = data.word(kTextfile3); si = (66*2); - searchforstring(); + searchForString(); _cmp(al, 0); if (flags.z()) goto foundfile; di = pop(); es = pop(); al = 7; - monmessage(); + monMessage(); return; foundfile: ax = pop(); ax = pop(); - getkeyandlogo(); + getKeyAndLogo(); _cmp(al, 0); if (flags.z()) goto keyok2; @@ -7702,13 +3389,13 @@ keyok2: ds = cs; si = offset_operand1+1; es = cs; - di = 2970+1; + di = 1125+1; cx = 12; _movsb(cx, true); - monitorlogo(); - scrollmonitor(); + monitorLogo(); + scrollMonitor(); al = 10; - monmessage(); + monMessage(); bx = pop(); es = pop(); directloop2: @@ -7723,13 +3410,13 @@ directloop2: _cmp(al, '='); if (!flags.z()) goto directloop2; - monprint(); + monPrint(); goto directloop2; endofdir2: - scrollmonitor(); + scrollMonitor(); } -void DreamGenContext::getkeyandlogo() { +void DreamGenContext::getKeyAndLogo() { STACK_CHECK; _inc(bx); al = es.byte(bx); @@ -7756,12 +3443,12 @@ void DreamGenContext::getkeyandlogo() { push(bx); push(es); al = 12; - monmessage(); + monMessage(); es = pop(); bx = pop(); _add(bx, 14); - monprint(); - scrollmonitor(); + monPrint(); + scrollMonitor(); bx = pop(); es = pop(); al = 1; @@ -7774,7 +3461,7 @@ keyok: al = 0; } -void DreamGenContext::searchforstring() { +void DreamGenContext::searchForString() { STACK_CHECK; dl = es.byte(di); cx = di; @@ -7784,7 +3471,7 @@ restartlook: dh = 0; keeplooking: _lodsb(); - makecaps(); + makeCaps(); _cmp(al, '*'); if (flags.z()) goto notfound; @@ -7829,7 +3516,7 @@ void DreamGenContext::parser() { al = '='; _stosb(); ds = cs; - si = 8045; + si = 1283; notspace1: _lodsw(); _cmp(al, 32); @@ -7857,133 +3544,36 @@ finishpars: di = offset_operand1; } -void DreamGenContext::scrollmonitor() { - STACK_CHECK; - push(ax); - push(bx); - push(cx); - push(dx); - push(di); - push(si); - push(es); - push(ds); - printlogo(); - di = data.word(kMonadx); - bx = data.word(kMonady); - printundermon(); - ax = data.word(kMonady); - worktoscreen(); - al = 25; - playchannel1(); - ds = pop(); - es = pop(); - si = pop(); - di = pop(); - dx = pop(); - cx = pop(); - bx = pop(); - ax = pop(); -} - -void DreamGenContext::monitorlogo() { - STACK_CHECK; - al = data.byte(kLogonum); - _cmp(al, data.byte(kOldlogonum)); - if (flags.z()) - goto notnewlogo; - data.byte(kOldlogonum) = al; - printlogo(); - printundermon(); - worktoscreen(); - printlogo(); - printlogo(); - al = 26; - playchannel1(); - cx = 20; - randomaccess(); - return; -notnewlogo: - printlogo(); -} - -void DreamGenContext::printlogo() { - STACK_CHECK; - di = 56; - bx = 32; - ds = data.word(kTempgraphics); - al = 0; - ah = 0; - showframe(); - showcurrentfile(); -} - -void DreamGenContext::showcurrentfile() { - STACK_CHECK; - di = 178; - bx = 37; - si = 2970+1; -curfileloop: - al = cs.byte(si); - _cmp(al, 0); - if (flags.z()) - return /* (finishfile) */; - _inc(si); - push(si); - modifychar(); - ds = data.word(kTempcharset); - ah = 0; - printchar(); - si = pop(); - goto curfileloop; -} - -void DreamGenContext::monmessage() { - STACK_CHECK; - es = data.word(kTextfile1); - bx = (66*2); - cl = al; - ch = 0; -monmessageloop: - al = es.byte(bx); - _inc(bx); - _cmp(al, '+'); - if (!flags.z()) - goto monmessageloop; - if (--cx) - goto monmessageloop; - monprint(); -} - -void DreamGenContext::processtrigger() { +void DreamGenContext::processTrigger() { STACK_CHECK; _cmp(data.byte(kLasttrigger), '1'); if (!flags.z()) goto notfirsttrigger; al = 8; - setlocation(); + setLocation(); al = 45; - triggermessage(); + triggerMessage(); return; notfirsttrigger: _cmp(data.byte(kLasttrigger), '2'); if (!flags.z()) goto notsecondtrigger; al = 9; - setlocation(); + setLocation(); al = 55; - triggermessage(); + triggerMessage(); return; notsecondtrigger: _cmp(data.byte(kLasttrigger), '3'); if (!flags.z()) return /* (notthirdtrigger) */; al = 2; - setlocation(); + setLocation(); al = 59; - triggermessage(); + triggerMessage(); } -void DreamGenContext::triggermessage() { +void DreamGenContext::triggerMessage() { STACK_CHECK; push(ax); di = 174; @@ -7992,161 +3582,36 @@ void DreamGenContext::triggermessage() { ch = 63; ds = data.word(kMapstore); si = 0; - multiget(); + multiGet(); ax = pop(); - findpuztext(); + findPuzText(); di = 174; bx = 156; dl = 141; ah = 16; - printdirect(); + printDirect(); cx = 140; - hangon(); - worktoscreen(); + hangOn(); + workToScreen(); cx = 340; - hangon(); + hangOn(); di = 174; bx = 153; cl = 200; ch = 63; ds = data.word(kMapstore); si = 0; - multiput(); - worktoscreen(); + multiPut(); + workToScreen(); data.byte(kLasttrigger) = 0; } -void DreamGenContext::printcurs() { - STACK_CHECK; - push(si); - push(di); - push(ds); - push(dx); - push(bx); - push(es); - di = data.word(kCurslocx); - bx = data.word(kCurslocy); - cl = 6; - ch = 8; - _cmp(data.byte(kForeignrelease), 0); - if (flags.z()) - goto _tmp1; - _sub(bx, 3); - ch = 11; -_tmp1: - ds = data.word(kBuffers); - si = (0); - push(di); - push(bx); - multiget(); - bx = pop(); - di = pop(); - push(bx); - push(di); - _inc(data.word(kMaintimer)); - ax = data.word(kMaintimer); - _and(al, 16); - if (!flags.z()) - goto flashcurs; - al = '/'; - _sub(al, 32); - ah = 0; - ds = data.word(kTempcharset); - showframe(); -flashcurs: - di = pop(); - bx = pop(); - _sub(di, 6); - cl = 12; - ch = 8; - _cmp(data.byte(kForeignrelease), 0); - if (flags.z()) - goto _tmp2; - ch = 11; -_tmp2: - multidump(); - es = pop(); - bx = pop(); - dx = pop(); - ds = pop(); - di = pop(); - si = pop(); -} - -void DreamGenContext::delcurs() { - STACK_CHECK; - push(es); - push(bx); - push(di); - push(ds); - push(dx); - push(si); - di = data.word(kCurslocx); - bx = data.word(kCurslocy); - cl = 6; - ch = 8; - _cmp(data.byte(kForeignrelease), 0); - if (flags.z()) - goto _tmp1; - _sub(bx, 3); - ch = 11; -_tmp1: - push(di); - push(bx); - push(cx); - ds = data.word(kBuffers); - si = (0); - multiput(); - cx = pop(); - bx = pop(); - di = pop(); - multidump(); - si = pop(); - dx = pop(); - ds = pop(); - di = pop(); - bx = pop(); - es = pop(); -} - -void DreamGenContext::useobject() { - STACK_CHECK; - data.byte(kWithobject) = 255; - _cmp(data.byte(kCommandtype), 229); - if (flags.z()) - goto alreadyuse; - data.byte(kCommandtype) = 229; - bl = data.byte(kCommand); - bh = data.byte(kObjecttype); - al = 51; - commandwithob(); -alreadyuse: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (nouse) */; - _and(ax, 1); - if (!flags.z()) - goto douse; - return; -douse: - useroutine(); -} - -void DreamGenContext::wheelsound() { - STACK_CHECK; - al = 17; - playchannel1(); - showfirstuse(); - putbackobstuff(); -} - -void DreamGenContext::runtap() { +void DreamGenContext::runTap() { STACK_CHECK; _cmp(data.byte(kWithobject), 255); if (!flags.z()) goto tapwith; - withwhat(); + withWhat(); return; tapwith: al = data.byte(kWithobject); @@ -8169,111 +3634,52 @@ tapwith: goto cupfromtapfull; cx = 300; al = 56; - showpuztext(); - putbackobstuff(); + showPuzText(); + putBackObStuff(); return; fillcupfromtap: al = data.byte(kWithobject); - getexad(); + getExAd(); es.byte(bx+15) = 'F'-'A'; al = 8; - playchannel1(); + playChannel1(); cx = 300; al = 57; - showpuztext(); - putbackobstuff(); + showPuzText(); + putBackObStuff(); return; cupfromtapfull: cx = 300; al = 58; - showpuztext(); - putbackobstuff(); -} - -void DreamGenContext::playguitar() { - STACK_CHECK; - al = 14; - playchannel1(); - showfirstuse(); - putbackobstuff(); -} - -void DreamGenContext::hotelcontrol() { - STACK_CHECK; - _cmp(data.byte(kReallocation), 21); - if (!flags.z()) - goto notrightcont; - _cmp(data.byte(kMapx), 33); - if (!flags.z()) - goto notrightcont; - showfirstuse(); - putbackobstuff(); - return; -notrightcont: - showseconduse(); - putbackobstuff(); -} - -void DreamGenContext::hotelbell() { - STACK_CHECK; - al = 12; - playchannel1(); - showfirstuse(); - putbackobstuff(); -} - -void DreamGenContext::opentomb() { - STACK_CHECK; - _inc(data.byte(kProgresspoints)); - showfirstuse(); - data.word(kWatchingtime) = 35*2; - data.word(kReeltowatch) = 1; - data.word(kEndwatchreel) = 33; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; -} - -void DreamGenContext::usetrainer() { - STACK_CHECK; - getanyad(); - _cmp(es.byte(bx+2), 4); - if (!flags.z()) - goto notheldtrainer; - _inc(data.byte(kProgresspoints)); - makeworn(); - showseconduse(); - putbackobstuff(); - return; -notheldtrainer: - nothelderror(); + showPuzText(); + putBackObStuff(); } -void DreamGenContext::nothelderror() { +void DreamGenContext::notHeldError() { STACK_CHECK; - createpanel(); - showpanel(); - showman(); - showexit(); - obicons(); + createPanel(); + showPanel(); + showMan(); + showExit(); + obIcons(); di = 64; bx = 100; al = 63; ah = 1; dl = 201; printmessage2(); - worktoscreenm(); + workToScreenM(); cx = 50; - hangonp(); - putbackobstuff(); + hangOnP(); + putBackObStuff(); } -void DreamGenContext::usepipe() { +void DreamGenContext::usePipe() { STACK_CHECK; _cmp(data.byte(kWithobject), 255); if (!flags.z()) goto pipewith; - withwhat(); + withWhat(); return; pipewith: al = data.byte(kWithobject); @@ -8296,274 +3702,31 @@ pipewith: goto alreadyfull; cx = 300; al = 14; - showpuztext(); - putbackobstuff(); + showPuzText(); + putBackObStuff(); return; fillcup: cx = 300; al = 36; - showpuztext(); - putbackobstuff(); + showPuzText(); + putBackObStuff(); al = data.byte(kWithobject); - getexad(); + getExAd(); es.byte(bx+15) = 'F'-'A'; return; alreadyfull: cx = 300; al = 35; - showpuztext(); - putbackobstuff(); -} - -void DreamGenContext::usefullcart() { - STACK_CHECK; - _inc(data.byte(kProgresspoints)); - al = 2; - ah = data.byte(kRoomnum); - _add(ah, 6); - turnanypathon(); - data.byte(kManspath) = 4; - data.byte(kFacing) = 4; - data.byte(kTurntoface) = 4; - data.byte(kFinaldest) = 4; - findxyfrompath(); - data.byte(kResetmanxy) = 1; - showfirstuse(); - data.word(kWatchingtime) = 72*2; - data.word(kReeltowatch) = 58; - data.word(kEndwatchreel) = 142; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; + showPuzText(); + putBackObStuff(); } -void DreamGenContext::useplinth() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto plinthwith; - withwhat(); - return; -plinthwith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'D'; - ch = 'K'; - dl = 'E'; - dh = 'Y'; - compare(); - if (flags.z()) - goto isrightkey; - showfirstuse(); - putbackobstuff(); - return; -isrightkey: - _inc(data.byte(kProgresspoints)); - showseconduse(); - data.word(kWatchingtime) = 220; - data.word(kReeltowatch) = 0; - data.word(kEndwatchreel) = 104; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; - al = data.byte(kRoomafterdream); - data.byte(kNewlocation) = al; -} - -void DreamGenContext::chewy() { - STACK_CHECK; - showfirstuse(); - getanyad(); - es.byte(bx+2) = 255; - data.byte(kGetback) = 1; -} - -void DreamGenContext::useladder() { - STACK_CHECK; - showfirstuse(); - _sub(data.byte(kMapx), 11); - findroominloc(); - data.byte(kFacing) = 6; - data.byte(kTurntoface) = 6; - data.byte(kManspath) = 0; - data.byte(kDestination) = 0; - data.byte(kFinaldest) = 0; - findxyfrompath(); - data.byte(kResetmanxy) = 1; - data.byte(kGetback) = 1; -} - -void DreamGenContext::useladderb() { - STACK_CHECK; - showfirstuse(); - _add(data.byte(kMapx), 11); - findroominloc(); - data.byte(kFacing) = 2; - data.byte(kTurntoface) = 2; - data.byte(kManspath) = 1; - data.byte(kDestination) = 1; - data.byte(kFinaldest) = 1; - findxyfrompath(); - data.byte(kResetmanxy) = 1; - data.byte(kGetback) = 1; -} - -void DreamGenContext::slabdoora() { - STACK_CHECK; - showfirstuse(); - data.byte(kGetback) = 1; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kReeltowatch) = 13; - _cmp(data.byte(kDreamnumber), 3); - if (!flags.z()) - goto slabawrong; - _inc(data.byte(kProgresspoints)); - data.word(kWatchingtime) = 60; - data.word(kEndwatchreel) = 42; - data.byte(kNewlocation) = 47; - return; -slabawrong: - data.word(kWatchingtime) = 40; - data.word(kEndwatchreel) = 34; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; -} - -void DreamGenContext::slabdoorb() { - STACK_CHECK; - _cmp(data.byte(kDreamnumber), 1); - if (!flags.z()) - goto slabbwrong; - al = 'S'; - ah = 'H'; - cl = 'L'; - ch = 'D'; - isryanholding(); - if (!flags.z()) - goto gotcrystal; - al = 44; - cx = 200; - showpuztext(); - putbackobstuff(); - return; -gotcrystal: - showfirstuse(); - _inc(data.byte(kProgresspoints)); - data.byte(kGetback) = 1; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kReeltowatch) = 44; - data.word(kWatchingtime) = 60; - data.word(kEndwatchreel) = 71; - data.byte(kNewlocation) = 47; - return; -slabbwrong: - showfirstuse(); - data.byte(kGetback) = 1; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kReeltowatch) = 44; - data.word(kWatchingtime) = 40; - data.word(kEndwatchreel) = 63; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; -} - -void DreamGenContext::slabdoord() { - STACK_CHECK; - showfirstuse(); - data.byte(kGetback) = 1; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kReeltowatch) = 75; - _cmp(data.byte(kDreamnumber), 0); - if (!flags.z()) - goto slabcwrong; - _inc(data.byte(kProgresspoints)); - data.word(kWatchingtime) = 60; - data.word(kEndwatchreel) = 102; - data.byte(kNewlocation) = 47; - return; -slabcwrong: - data.word(kWatchingtime) = 40; - data.word(kEndwatchreel) = 94; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; -} - -void DreamGenContext::slabdoorc() { - STACK_CHECK; - showfirstuse(); - data.byte(kGetback) = 1; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kReeltowatch) = 108; - _cmp(data.byte(kDreamnumber), 4); - if (!flags.z()) - goto slabdwrong; - _inc(data.byte(kProgresspoints)); - data.word(kWatchingtime) = 60; - data.word(kEndwatchreel) = 135; - data.byte(kNewlocation) = 47; - return; -slabdwrong: - data.word(kWatchingtime) = 40; - data.word(kEndwatchreel) = 127; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; -} - -void DreamGenContext::slabdoore() { - STACK_CHECK; - showfirstuse(); - data.byte(kGetback) = 1; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kReeltowatch) = 141; - _cmp(data.byte(kDreamnumber), 5); - if (!flags.z()) - goto slabewrong; - _inc(data.byte(kProgresspoints)); - data.word(kWatchingtime) = 60; - data.word(kEndwatchreel) = 168; - data.byte(kNewlocation) = 47; - return; -slabewrong: - data.word(kWatchingtime) = 40; - data.word(kEndwatchreel) = 160; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; -} - -void DreamGenContext::slabdoorf() { - STACK_CHECK; - showfirstuse(); - data.byte(kGetback) = 1; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kReeltowatch) = 171; - _cmp(data.byte(kDreamnumber), 2); - if (!flags.z()) - goto slabfwrong; - _inc(data.byte(kProgresspoints)); - data.word(kWatchingtime) = 60; - data.word(kEndwatchreel) = 197; - data.byte(kNewlocation) = 47; - return; -slabfwrong: - data.word(kWatchingtime) = 40; - data.word(kEndwatchreel) = 189; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; -} - -void DreamGenContext::useslab() { +void DreamGenContext::useSLab() { STACK_CHECK; _cmp(data.byte(kWithobject), 255); if (!flags.z()) goto slabwith; - withwhat(); + withWhat(); return; slabwith: al = data.byte(kWithobject); @@ -8577,26 +3740,26 @@ slabwith: goto nextslab; cx = 300; al = 14; - showpuztext(); - putbackobstuff(); + showPuzText(); + putBackObStuff(); return; nextslab: al = data.byte(kWithobject); - getexad(); + getExAd(); es.byte(bx+2) = 0; al = data.byte(kCommand); push(ax); - removesetobject(); + removeSetObject(); ax = pop(); _inc(al); push(ax); - placesetobject(); + placeSetObject(); ax = pop(); _cmp(al, 54); if (!flags.z()) goto notlastslab; al = 0; - turnpathon(); + turnPathOn(); data.word(kWatchingtime) = 22; data.word(kReeltowatch) = 35; data.word(kEndwatchreel) = 48; @@ -8604,112 +3767,16 @@ nextslab: data.byte(kSpeedcount) = 1; notlastslab: _inc(data.byte(kProgresspoints)); - showfirstuse(); + showFirstUse(); data.byte(kGetback) = 1; } -void DreamGenContext::usecart() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto cartwith; - withwhat(); - return; -cartwith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'R'; - ch = 'O'; - dl = 'C'; - dh = 'K'; - compare(); - if (flags.z()) - goto nextcart; - cx = 300; - al = 14; - showpuztext(); - putbackobstuff(); - return; -nextcart: - al = data.byte(kWithobject); - getexad(); - es.byte(bx+2) = 0; - al = data.byte(kCommand); - push(ax); - removesetobject(); - ax = pop(); - _inc(al); - placesetobject(); - _inc(data.byte(kProgresspoints)); - al = 17; - playchannel1(); - showfirstuse(); - data.byte(kGetback) = 1; -} - -void DreamGenContext::useclearbox() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto clearboxwith; - withwhat(); - return; -clearboxwith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'R'; - ch = 'A'; - dl = 'I'; - dh = 'L'; - compare(); - if (flags.z()) - goto openbox; - cx = 300; - al = 14; - showpuztext(); - putbackobstuff(); - return; -openbox: - _inc(data.byte(kProgresspoints)); - showfirstuse(); - data.word(kWatchingtime) = 80; - data.word(kReeltowatch) = 67; - data.word(kEndwatchreel) = 105; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; -} - -void DreamGenContext::usecoveredbox() { - STACK_CHECK; - _inc(data.byte(kProgresspoints)); - showfirstuse(); - data.word(kWatchingtime) = 50; - data.word(kReeltowatch) = 41; - data.word(kEndwatchreel) = 66; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; -} - -void DreamGenContext::userailing() { - STACK_CHECK; - showfirstuse(); - data.word(kWatchingtime) = 80; - data.word(kReeltowatch) = 0; - data.word(kEndwatchreel) = 30; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; - data.byte(kMandead) = 4; -} - -void DreamGenContext::useopenbox() { +void DreamGenContext::useOpenBox() { STACK_CHECK; _cmp(data.byte(kWithobject), 255); if (!flags.z()) goto openboxwith; - withwhat(); + withWhat(); return; openboxwith: al = data.byte(kWithobject); @@ -8730,15 +3797,15 @@ openboxwith: compare(); if (flags.z()) goto openboxwrong; - showfirstuse(); + showFirstUse(); return; destoryopenbox: _inc(data.byte(kProgresspoints)); cx = 300; al = 37; - showpuztext(); + showPuzText(); al = data.byte(kWithobject); - getexad(); + getExAd(); es.byte(bx+15) = 'E'-'A'; data.word(kWatchingtime) = 140; data.word(kReeltowatch) = 105; @@ -8746,119 +3813,23 @@ destoryopenbox: data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; al = 4; - turnpathon(); + turnPathOn(); data.byte(kGetback) = 1; return; openboxwrong: cx = 300; al = 38; - showpuztext(); - putbackobstuff(); + showPuzText(); + putBackObStuff(); } -void DreamGenContext::wearwatch() { - STACK_CHECK; - _cmp(data.byte(kWatchon), 1); - if (flags.z()) - goto wearingwatch; - showfirstuse(); - data.byte(kWatchon) = 1; - data.byte(kGetback) = 1; - getanyad(); - makeworn(); - return; -wearingwatch: - showseconduse(); - putbackobstuff(); -} - -void DreamGenContext::wearshades() { - STACK_CHECK; - _cmp(data.byte(kShadeson), 1); - if (flags.z()) - goto wearingshades; - data.byte(kShadeson) = 1; - showfirstuse(); - data.byte(kGetback) = 1; - getanyad(); - makeworn(); - return; -wearingshades: - showseconduse(); - putbackobstuff(); -} - -void DreamGenContext::sitdowninbar() { - STACK_CHECK; - _cmp(data.byte(kWatchmode), -1); - if (!flags.z()) - goto satdown; - showfirstuse(); - data.word(kWatchingtime) = 50; - data.word(kReeltowatch) = 55; - data.word(kEndwatchreel) = 71; - data.word(kReeltohold) = 73; - data.word(kEndofholdreel) = 83; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; - return; -satdown: - showseconduse(); - putbackobstuff(); -} - -void DreamGenContext::usechurchhole() { - STACK_CHECK; - showfirstuse(); - data.byte(kGetback) = 1; - data.word(kWatchingtime) = 28; - data.word(kReeltowatch) = 13; - data.word(kEndwatchreel) = 26; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; -} - -void DreamGenContext::usehole() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto holewith; - withwhat(); - return; -holewith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'H'; - ch = 'N'; - dl = 'D'; - dh = 'A'; - compare(); - if (flags.z()) - goto righthand; - cx = 300; - al = 14; - showpuztext(); - putbackobstuff(); - return; -righthand: - showfirstuse(); - al = 86; - removesetobject(); - al = data.byte(kWithobject); - getexad(); - es.byte(bx+2) = 255; - data.byte(kCanmovealtar) = 1; - data.byte(kGetback) = 1; -} - -void DreamGenContext::usealtar() { +void DreamGenContext::useAltar() { STACK_CHECK; al = 'C'; ah = 'N'; cl = 'D'; ch = 'A'; - findexobject(); + findExObject(); _cmp(al, (114)); if (flags.z()) goto thingsonaltar; @@ -8866,7 +3837,7 @@ void DreamGenContext::usealtar() { ah = 'N'; cl = 'D'; ch = 'B'; - findexobject(); + findExObject(); _cmp(al, (114)); if (flags.z()) goto thingsonaltar; @@ -8875,12 +3846,12 @@ void DreamGenContext::usealtar() { goto movealtar; cx = 300; al = 23; - showpuztext(); + showPuzText(); data.byte(kGetback) = 1; return; movealtar: _inc(data.byte(kProgresspoints)); - showseconduse(); + showSecondUse(); data.word(kWatchingtime) = 160; data.word(kReeltowatch) = 81; data.word(kEndwatchreel) = 174; @@ -8891,61 +3862,15 @@ movealtar: bh = 76; cx = 32; dx = 98; - setuptimeduse(); + setupTimedUse(); data.byte(kGetback) = 1; return; thingsonaltar: - showfirstuse(); - data.byte(kGetback) = 1; -} - -void DreamGenContext::opentvdoor() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto tvdoorwith; - withwhat(); - return; -tvdoorwith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'U'; - ch = 'L'; - dl = 'O'; - dh = 'K'; - compare(); - if (flags.z()) - goto keyontv; - cx = 300; - al = 14; - showpuztext(); - putbackobstuff(); - return; -keyontv: - showfirstuse(); - data.byte(kLockstatus) = 0; - data.byte(kGetback) = 1; -} - -void DreamGenContext::usedryer() { - STACK_CHECK; - al = 12; - playchannel1(); - showfirstuse(); - data.byte(kGetback) = 1; -} - -void DreamGenContext::openlouis() { - STACK_CHECK; - al = 5; - ah = 2; - cl = 3; - ch = 8; - entercode(); + showFirstUse(); data.byte(kGetback) = 1; } -void DreamGenContext::nextcolon() { +void DreamGenContext::nextColon() { STACK_CHECK; lookcolon: al = es.byte(si); @@ -8955,513 +3880,22 @@ lookcolon: goto lookcolon; } -void DreamGenContext::openyourneighbour() { - STACK_CHECK; - al = 255; - ah = 255; - cl = 255; - ch = 255; - entercode(); - data.byte(kGetback) = 1; -} - -void DreamGenContext::usewindow() { - STACK_CHECK; - _cmp(data.byte(kManspath), 6); - if (!flags.z()) - goto notonbalc; - _inc(data.byte(kProgresspoints)); - showfirstuse(); - data.byte(kNewlocation) = 29; - data.byte(kGetback) = 1; - return; -notonbalc: - showseconduse(); - putbackobstuff(); -} - -void DreamGenContext::usebalcony() { - STACK_CHECK; - showfirstuse(); - al = 6; - turnpathon(); - al = 0; - turnpathoff(); - al = 1; - turnpathoff(); - al = 2; - turnpathoff(); - al = 3; - turnpathoff(); - al = 4; - turnpathoff(); - al = 5; - turnpathoff(); - _inc(data.byte(kProgresspoints)); - data.byte(kManspath) = 6; - data.byte(kDestination) = 6; - data.byte(kFinaldest) = 6; - findxyfrompath(); - switchryanoff(); - data.byte(kResetmanxy) = 1; - data.word(kWatchingtime) = 30*2; - data.word(kReeltowatch) = 183; - data.word(kEndwatchreel) = 212; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; -} - -void DreamGenContext::openryan() { - STACK_CHECK; - al = 5; - ah = 1; - cl = 0; - ch = 6; - entercode(); - data.byte(kGetback) = 1; -} - -void DreamGenContext::openpoolboss() { - STACK_CHECK; - al = 5; - ah = 2; - cl = 2; - ch = 2; - entercode(); - data.byte(kGetback) = 1; -} - -void DreamGenContext::openeden() { - STACK_CHECK; - al = 2; - ah = 8; - cl = 6; - ch = 5; - entercode(); - data.byte(kGetback) = 1; -} - -void DreamGenContext::opensarters() { - STACK_CHECK; - al = 7; - ah = 8; - cl = 3; - ch = 3; - entercode(); - data.byte(kGetback) = 1; -} - -void DreamGenContext::isitright() { - STACK_CHECK; - bx = data; - es = bx; - bx = 8573; - _cmp(es.byte(bx+0), al); - if (!flags.z()) - return /* (notright) */; - _cmp(es.byte(bx+1), ah); - if (!flags.z()) - return /* (notright) */; - _cmp(es.byte(bx+2), cl); - if (!flags.z()) - return /* (notright) */; - _cmp(es.byte(bx+3), ch); -} - -void DreamGenContext::drawitall() { - STACK_CHECK; - createpanel(); - drawfloor(); - printsprites(); - showicon(); -} - -void DreamGenContext::openhoteldoor() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto hoteldoorwith; - withwhat(); - return; -hoteldoorwith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'K'; - ch = 'E'; - dl = 'Y'; - dh = 'A'; - compare(); - if (flags.z()) - goto keyonhotel1; - cx = 300; - al = 14; - showpuztext(); - putbackobstuff(); - return; -keyonhotel1: - al = 16; - playchannel1(); - showfirstuse(); - data.byte(kLockstatus) = 0; - data.byte(kGetback) = 1; -} - -void DreamGenContext::openhoteldoor2() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto hoteldoorwith2; - withwhat(); - return; -hoteldoorwith2: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'K'; - ch = 'E'; - dl = 'Y'; - dh = 'A'; - compare(); - if (flags.z()) - goto keyonhotel2; - cx = 300; - al = 14; - showpuztext(); - putbackobstuff(); - return; -keyonhotel2: - al = 16; - playchannel1(); - showfirstuse(); - putbackobstuff(); -} - -void DreamGenContext::grafittidoor() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto grafwith; - withwhat(); - return; -grafwith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'A'; - ch = 'P'; - dl = 'E'; - dh = 'N'; - compare(); - if (flags.z()) - goto dograf; - cx = 300; - al = 14; - showpuztext(); - putbackobstuff(); - return; -dograf: - showfirstuse(); - putbackobstuff(); -} - -void DreamGenContext::trapdoor() { - STACK_CHECK; - _inc(data.byte(kProgresspoints)); - showfirstuse(); - switchryanoff(); - data.word(kWatchingtime) = 20*2; - data.word(kReeltowatch) = 181; - data.word(kEndwatchreel) = 197; - data.byte(kNewlocation) = 26; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; -} - -void DreamGenContext::callhotellift() { - STACK_CHECK; - al = 12; - playchannel1(); - showfirstuse(); - data.byte(kCounttoopen) = 8; - data.byte(kGetback) = 1; - data.byte(kDestination) = 5; - data.byte(kFinaldest) = 5; - autosetwalk(); - al = 4; - turnpathon(); -} - -void DreamGenContext::calledenslift() { - STACK_CHECK; - showfirstuse(); - data.byte(kCounttoopen) = 8; - data.byte(kGetback) = 1; - al = 2; - turnpathon(); -} - -void DreamGenContext::calledensdlift() { - STACK_CHECK; - _cmp(data.byte(kLiftflag), 1); - if (flags.z()) - goto edensdhere; - showfirstuse(); - data.byte(kCounttoopen) = 8; - data.byte(kGetback) = 1; - al = 2; - turnpathon(); - return; -edensdhere: - showseconduse(); - putbackobstuff(); -} - -void DreamGenContext::usepoolreader() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto poolwith; - withwhat(); - return; -poolwith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'M'; - ch = 'E'; - dl = 'M'; - dh = 'B'; - compare(); - if (flags.z()) - goto openpool; - cx = 300; - al = 14; - showpuztext(); - putbackobstuff(); - return; -openpool: - _cmp(data.byte(kTalkedtoattendant), 1); - if (flags.z()) - goto canopenpool; - showseconduse(); - putbackobstuff(); - return; -canopenpool: - al = 17; - playchannel1(); - showfirstuse(); - data.byte(kCounttoopen) = 6; - data.byte(kGetback) = 1; -} - -void DreamGenContext::uselighter() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto gotlighterwith; - withwhat(); - return; -gotlighterwith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'S'; - ch = 'M'; - dl = 'K'; - dh = 'E'; - compare(); - if (flags.z()) - goto cigarette; - showfirstuse(); - putbackobstuff(); - return; -cigarette: - cx = 300; - al = 9; - showpuztext(); - al = data.byte(kWithobject); - getexad(); - es.byte(bx+2) = 255; - data.byte(kGetback) = 1; -} - -void DreamGenContext::showseconduse() { - STACK_CHECK; - getobtextstart(); - nextcolon(); - nextcolon(); - nextcolon(); - usetext(); - cx = 400; - hangonp(); -} - -void DreamGenContext::usecardreader1() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto gotreader1with; - withwhat(); - return; -gotreader1with: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'C'; - ch = 'S'; - dl = 'H'; - dh = 'R'; - compare(); - if (flags.z()) - goto correctcard; - cx = 300; - al = 14; - showpuztext(); - putbackobstuff(); - return; -correctcard: - _cmp(data.byte(kTalkedtosparky), 0); - if (flags.z()) - goto notyet; - _cmp(data.word(kCard1money), 0); - if (flags.z()) - goto getscash; - cx = 300; - al = 17; - showpuztext(); - putbackobstuff(); - return; -getscash: - al = 16; - playchannel1(); - cx = 300; - al = 18; - showpuztext(); - _inc(data.byte(kProgresspoints)); - data.word(kCard1money) = 12432; - data.byte(kGetback) = 1; - return; -notyet: - showfirstuse(); - putbackobstuff(); -} - -void DreamGenContext::usecardreader2() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto gotreader2with; - withwhat(); - return; -gotreader2with: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'C'; - ch = 'S'; - dl = 'H'; - dh = 'R'; - compare(); - if (flags.z()) - goto correctcard2; - cx = 300; - al = 14; - showpuztext(); - putbackobstuff(); - return; -correctcard2: - _cmp(data.byte(kTalkedtoboss), 0); - if (flags.z()) - goto notyetboss; - _cmp(data.word(kCard1money), 0); - if (flags.z()) - goto nocash; - _cmp(data.byte(kGunpassflag), 2); - if (flags.z()) - goto alreadygotnew; - al = 18; - playchannel1(); - cx = 300; - al = 19; - showpuztext(); - al = 94; - placesetobject(); - data.byte(kGunpassflag) = 1; - _sub(data.word(kCard1money), 2000); - _inc(data.byte(kProgresspoints)); - data.byte(kGetback) = 1; - return; -nocash: - cx = 300; - al = 20; - showpuztext(); - putbackobstuff(); - return; -alreadygotnew: - cx = 300; - al = 22; - showpuztext(); - putbackobstuff(); - return; -notyetboss: - showfirstuse(); - putbackobstuff(); -} - -void DreamGenContext::usecardreader3() { +void DreamGenContext::drawItAll() { STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto gotreader3with; - withwhat(); - return; -gotreader3with: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'C'; - ch = 'S'; - dl = 'H'; - dh = 'R'; - compare(); - if (flags.z()) - goto rightcard; - cx = 300; - al = 14; - showpuztext(); - putbackobstuff(); - return; -rightcard: - _cmp(data.byte(kTalkedtorecep), 0); - if (flags.z()) - goto notyetrecep; - _cmp(data.byte(kCardpassflag), 0); - if (!flags.z()) - goto alreadyusedit; - al = 16; - playchannel1(); - cx = 300; - al = 25; - showpuztext(); - _inc(data.byte(kProgresspoints)); - _sub(data.word(kCard1money), 8300); - data.byte(kCardpassflag) = 1; - data.byte(kGetback) = 1; - return; -alreadyusedit: - cx = 300; - al = 26; - showpuztext(); - putbackobstuff(); - return; -notyetrecep: - showfirstuse(); - putbackobstuff(); + createPanel(); + drawFloor(); + printSprites(); + showIcon(); } -void DreamGenContext::usecashcard() { +void DreamGenContext::useCashCard() { STACK_CHECK; - getridofreels(); - loadkeypad(); - createpanel(); - showpanel(); - showexit(); - showman(); + getRidOfReels(); + loadKeypad(); + createPanel(); + showPanel(); + showExit(); + showMan(); di = 114; bx = 120; _cmp(data.byte(kForeignrelease), 0); @@ -9472,18 +3906,18 @@ _tmp1: ds = data.word(kTempgraphics); al = 39; ah = 0; - showframe(); + showFrame(); ax = data.word(kCard1money); - moneypoke(); - getobtextstart(); - nextcolon(); - nextcolon(); + moneyPoke(); + getObTextStart(); + nextColon(); + nextColon(); di = 36; bx = 98; dl = 241; al = 0; ah = 0; - printdirect(); + printDirect(); di = 160; bx = 155; es = cs; @@ -9492,7 +3926,7 @@ _tmp1: al = 0; ah = 0; dl = 240; - printdirect(); + printDirect(); di = 187; bx = 155; es = cs; @@ -9501,50 +3935,50 @@ _tmp1: al = 0; ah = 0; dl = 240; - printdirect(); + printDirect(); data.word(kCharshift) = 0; - worktoscreenm(); + workToScreenM(); cx = 400; - hangonp(); - getridoftemp(); - restorereels(); - putbackobstuff(); + hangOnP(); + getRidOfTemp(); + restoreReels(); + putBackObStuff(); } -void DreamGenContext::lookatcard() { +void DreamGenContext::lookAtCard() { STACK_CHECK; data.byte(kManisoffscreen) = 1; - getridofreels(); - loadkeypad(); - createpanel2(); + getRidOfReels(); + loadKeypad(); + createPanel2(); di = 160; bx = 80; ds = data.word(kTempgraphics); al = 42; ah = 128; - showframe(); - getobtextstart(); - findnextcolon(); - findnextcolon(); - findnextcolon(); + showFrame(); + getObTextStart(); + findNextColon(); + findNextColon(); + findNextColon(); di = 36; bx = 124; dl = 241; al = 0; ah = 0; - printdirect(); + printDirect(); push(es); push(si); - worktoscreenm(); + workToScreenM(); cx = 280; - hangonw(); - createpanel2(); + hangOnW(); + createPanel2(); di = 160; bx = 80; ds = data.word(kTempgraphics); al = 42; ah = 128; - showframe(); + showFrame(); si = pop(); es = pop(); di = 36; @@ -9552,17 +3986,17 @@ void DreamGenContext::lookatcard() { dl = 241; al = 0; ah = 0; - printdirect(); - worktoscreenm(); + printDirect(); + workToScreenM(); cx = 200; - hangonw(); + hangOnW(); data.byte(kManisoffscreen) = 0; - getridoftemp(); - restorereels(); - putbackobstuff(); + getRidOfTemp(); + restoreReels(); + putBackObStuff(); } -void DreamGenContext::moneypoke() { +void DreamGenContext::moneyPoke() { STACK_CHECK; bx = offset_money1poke; cl = 48-1; @@ -9605,12 +4039,12 @@ numberpoke3: cs.byte(bx) = al; } -void DreamGenContext::usecontrol() { +void DreamGenContext::useControl() { STACK_CHECK; _cmp(data.byte(kWithobject), 255); if (!flags.z()) goto gotcontrolwith; - withwhat(); + withWhat(); return; gotcontrolwith: al = data.byte(kWithobject); @@ -9644,18 +4078,18 @@ gotcontrolwith: if (flags.z()) goto axeoncontrols; balls: - showfirstuse(); - putbackobstuff(); + showFirstUse(); + putBackObStuff(); return; rightkey: al = 16; - playchannel1(); + playChannel1(); _cmp(data.byte(kLocation), 21); if (flags.z()) goto goingdown; cx = 300; al = 0; - showpuztext(); + showPuzText(); data.byte(kNewlocation) = 21; data.byte(kCounttoclose) = 8; data.byte(kCounttoopen) = 0; @@ -9665,7 +4099,7 @@ rightkey: goingdown: cx = 300; al = 3; - showpuztext(); + showPuzText(); data.byte(kNewlocation) = 30; data.byte(kCounttoclose) = 8; data.byte(kCounttoopen) = 0; @@ -9674,191 +4108,58 @@ goingdown: return; jimmycontrols: al = 50; - placesetobject(); + placeSetObject(); al = 51; - placesetobject(); + placeSetObject(); al = 26; - placesetobject(); + placeSetObject(); al = 30; - placesetobject(); + placeSetObject(); al = 16; - removesetobject(); + removeSetObject(); al = 17; - removesetobject(); + removeSetObject(); al = 14; - playchannel1(); + playChannel1(); cx = 300; al = 10; - showpuztext(); + showPuzText(); _inc(data.byte(kProgresspoints)); data.byte(kGetback) = 1; return; axeoncontrols: cx = 300; al = 16; - showpuztext(); - _inc(data.byte(kProgresspoints)); - putbackobstuff(); -} - -void DreamGenContext::usehatch() { - STACK_CHECK; - showfirstuse(); - data.byte(kNewlocation) = 40; - data.byte(kGetback) = 1; -} - -void DreamGenContext::usewire() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto gotwirewith; - withwhat(); - return; -gotwirewith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'K'; - ch = 'N'; - dl = 'F'; - dh = 'E'; - compare(); - if (flags.z()) - goto wireknife; - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'A'; - ch = 'X'; - dl = 'E'; - dh = 'D'; - compare(); - if (flags.z()) - goto wireaxe; - cx = 300; - al = 14; - showpuztext(); - putbackobstuff(); - return; -wireaxe: - cx = 300; - al = 16; - showpuztext(); - putbackobstuff(); - return; -wireknife: - al = 51; - removesetobject(); - al = 52; - placesetobject(); - cx = 300; - al = 11; - showpuztext(); + showPuzText(); _inc(data.byte(kProgresspoints)); - data.byte(kGetback) = 1; + putBackObStuff(); } -void DreamGenContext::usehandle() { +void DreamGenContext::useHandle() { STACK_CHECK; al = 'C'; ah = 'U'; cl = 'T'; ch = 'W'; - findsetobject(); + findSetObject(); al = es.byte(bx+58); _cmp(al, 255); if (!flags.z()) goto havecutwire; cx = 300; al = 12; - showpuztext(); + showPuzText(); data.byte(kGetback) = 1; return; havecutwire: cx = 300; al = 13; - showpuztext(); + showPuzText(); data.byte(kNewlocation) = 22; data.byte(kGetback) = 1; } -void DreamGenContext::useelevator1() { - STACK_CHECK; - showfirstuse(); - selectlocation(); - data.byte(kGetback) = 1; -} - -void DreamGenContext::showfirstuse() { - STACK_CHECK; - getobtextstart(); - findnextcolon(); - findnextcolon(); - usetext(); - cx = 400; - hangonp(); -} - -void DreamGenContext::useelevator3() { - STACK_CHECK; - showfirstuse(); - data.byte(kCounttoclose) = 20; - data.byte(kNewlocation) = 34; - data.word(kReeltowatch) = 46; - data.word(kEndwatchreel) = 63; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kWatchingtime) = 80; - data.byte(kGetback) = 1; -} - -void DreamGenContext::useelevator4() { - STACK_CHECK; - showfirstuse(); - data.word(kReeltowatch) = 0; - data.word(kEndwatchreel) = 11; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kCounttoclose) = 20; - data.word(kWatchingtime) = 80; - data.byte(kGetback) = 1; - data.byte(kNewlocation) = 24; -} - -void DreamGenContext::useelevator2() { - STACK_CHECK; - _cmp(data.byte(kLocation), 23); - if (flags.z()) - goto inpoolhall; - showfirstuse(); - data.byte(kNewlocation) = 23; - data.byte(kCounttoclose) = 20; - data.byte(kCounttoopen) = 0; - data.word(kWatchingtime) = 80; - data.byte(kGetback) = 1; - return; -inpoolhall: - showfirstuse(); - data.byte(kNewlocation) = 31; - data.byte(kCounttoclose) = 20; - data.byte(kCounttoopen) = 0; - data.word(kWatchingtime) = 80; - data.byte(kGetback) = 1; -} - -void DreamGenContext::useelevator5() { - STACK_CHECK; - al = 4; - placesetobject(); - al = 0; - removesetobject(); - data.byte(kNewlocation) = 20; - data.word(kWatchingtime) = 80; - data.byte(kLiftflag) = 1; - data.byte(kCounttoclose) = 8; - data.byte(kGetback) = 1; -} - -void DreamGenContext::usekey() { +void DreamGenContext::useKey() { STACK_CHECK; _cmp(data.byte(kLocation), 5); if (flags.z()) @@ -9871,8 +4172,8 @@ void DreamGenContext::usekey() { goto usekey2; cx = 200; al = 1; - showpuztext(); - putbackobstuff(); + showPuzText(); + putBackObStuff(); return; usekey1: _cmp(data.byte(kMapx), 22); @@ -9883,7 +4184,7 @@ usekey1: goto wrongroom1; cx = 300; al = 0; - showpuztext(); + showPuzText(); data.byte(kCounttoclose) = 100; data.byte(kGetback) = 1; return; @@ -9896,29 +4197,29 @@ usekey2: goto wrongroom1; cx = 300; al = 3; - showpuztext(); + showPuzText(); data.byte(kNewlocation) = 30; al = 2; - fadescreendown(); - showfirstuse(); - putbackobstuff(); + fadeScreenDown(); + showFirstUse(); + putBackObStuff(); return; wrongroom1: cx = 200; al = 2; - showpuztext(); - putbackobstuff(); + showPuzText(); + putBackObStuff(); } -void DreamGenContext::usestereo() { +void DreamGenContext::useStereo() { STACK_CHECK; _cmp(data.byte(kLocation), 0); if (flags.z()) goto stereook; cx = 400; al = 4; - showpuztext(); - putbackobstuff(); + showPuzText(); + putBackObStuff(); return; stereook: _cmp(data.byte(kMapx), 11); @@ -9930,30 +4231,30 @@ stereook: stereonotok: cx = 400; al = 5; - showpuztext(); - putbackobstuff(); + showPuzText(); + putBackObStuff(); return; stereook2: al = 'C'; ah = 'D'; cl = 'P'; ch = 'L'; - findsetobject(); + findSetObject(); ah = 1; - checkinside(); + checkInside(); _cmp(cl, (114)); if (!flags.z()) goto cdinside; al = 6; cx = 400; - showpuztext(); - putbackobstuff(); - getanyad(); + showPuzText(); + putBackObStuff(); + getAnyAd(); al = 255; es.byte(bx+10) = al; return; cdinside: - getanyad(); + getAnyAd(); al = es.byte(bx+10); _xor(al, 1); es.byte(bx+10) = al; @@ -9962,33 +4263,17 @@ cdinside: goto stereoon; al = 7; cx = 400; - showpuztext(); - putbackobstuff(); + showPuzText(); + putBackObStuff(); return; stereoon: al = 8; cx = 400; - showpuztext(); - putbackobstuff(); -} - -void DreamGenContext::usecooker() { - STACK_CHECK; - al = data.byte(kCommand); - ah = data.byte(kObjecttype); - checkinside(); - _cmp(cl, (114)); - if (!flags.z()) - goto foodinside; - showfirstuse(); - putbackobstuff(); - return; -foodinside: - showseconduse(); - putbackobstuff(); + showPuzText(); + putBackObStuff(); } -void DreamGenContext::useaxe() { +void DreamGenContext::useAxe() { STACK_CHECK; _cmp(data.byte(kReallocation), 22); if (!flags.z()) @@ -9996,20 +4281,20 @@ void DreamGenContext::useaxe() { _cmp(data.byte(kMapy), 10); if (flags.z()) goto axeondoor; - showseconduse(); + showSecondUse(); _inc(data.byte(kProgresspoints)); data.byte(kLastweapon) = 2; data.byte(kGetback) = 1; - removeobfrominv(); + removeObFromInv(); return; notinpool: - showfirstuse(); + showFirstUse(); return; /*continuing to unbounded code: axeondoor from useelvdoor:19-30*/ axeondoor: al = 15; cx = 300; - showpuztext(); + showPuzText(); _inc(data.byte(kProgresspoints)); data.word(kWatchingtime) = 46*2; data.word(kReeltowatch) = 31; @@ -10019,52 +4304,17 @@ axeondoor: data.byte(kGetback) = 1; } -void DreamGenContext::useelvdoor() { +void DreamGenContext::withWhat() { STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto gotdoorwith; - withwhat(); - return; -gotdoorwith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'A'; - ch = 'X'; - dl = 'E'; - dh = 'D'; - compare(); - if (flags.z()) - goto axeondoor; - al = 14; - cx = 300; - showpuztext(); - putbackobstuff(); - return; -axeondoor: - al = 15; - cx = 300; - showpuztext(); - _inc(data.byte(kProgresspoints)); - data.word(kWatchingtime) = 46*2; - data.word(kReeltowatch) = 31; - data.word(kEndwatchreel) = 77; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; -} - -void DreamGenContext::withwhat() { - STACK_CHECK; - createpanel(); - showpanel(); - showman(); - showexit(); + createPanel(); + showPanel(); + showMan(); + showExit(); al = data.byte(kCommand); ah = data.byte(kObjecttype); es = cs; di = offset_commandline; - copyname(); + copyName(); di = 100; bx = 21; dl = 200; @@ -10079,7 +4329,7 @@ void DreamGenContext::withwhat() { dl = 220; al = 0; ah = 0; - printdirect(); + printDirect(); di = data.word(kLastxpos); _add(di, 5); bx = 21; @@ -10087,18 +4337,18 @@ void DreamGenContext::withwhat() { al = 63; ah = 3; printmessage2(); - fillryan(); + fillRyan(); data.byte(kCommandtype) = 255; - readmouse(); - showpointer(); - worktoscreen(); - delpointer(); + readMouse(); + showPointer(); + workToScreen(); + delPointer(); data.byte(kInvopen) = 2; } -void DreamGenContext::selectob() { +void DreamGenContext::selectOb() { STACK_CHECK; - findinvpos(); + findInvPos(); ax = es.word(bx); _cmp(al, 255); if (!flags.z()) @@ -10119,7 +4369,7 @@ diffsub3: data.word(kOldsubject) = ax; bx = ax; al = 0; - commandwithob(); + commandWithOb(); alreadyselob: ax = data.word(kMousebutton); _cmp(ax, data.word(kOldbutton)); @@ -10130,12 +4380,12 @@ alreadyselob: goto doselob; return; doselob: - delpointer(); + delPointer(); data.byte(kInvopen) = 0; - useroutine(); + useRoutine(); } -void DreamGenContext::findsetobject() { +void DreamGenContext::findSetObject() { STACK_CHECK; _sub(al, 'A'); _sub(ah, 'A'); @@ -10168,7 +4418,7 @@ nofind: al = dl; } -void DreamGenContext::findexobject() { +void DreamGenContext::findExObject() { STACK_CHECK; _sub(al, 'A'); _sub(ah, 'A'); @@ -10201,7 +4451,7 @@ nofindex: al = dl; } -void DreamGenContext::isryanholding() { +void DreamGenContext::isRyanHolding() { STACK_CHECK; _sub(al, 'A'); _sub(ah, 'A'); @@ -10239,7 +4489,7 @@ nofindininv: _cmp(al, (114)); } -void DreamGenContext::checkinside() { +void DreamGenContext::checkInside() { STACK_CHECK; es = data.word(kExtras); bx = (0+2080+30000); @@ -10260,47 +4510,7 @@ notfoundinside: goto insideloop; } -void DreamGenContext::putbackobstuff() { - STACK_CHECK; - createpanel(); - showpanel(); - showman(); - obicons(); - showexit(); - obpicture(); - describeob(); - undertextline(); - data.byte(kCommandtype) = 255; - readmouse(); - showpointer(); - worktoscreen(); - delpointer(); -} - -void DreamGenContext::showpuztext() { - STACK_CHECK; - push(cx); - findpuztext(); - push(es); - push(si); - createpanel(); - showpanel(); - showman(); - showexit(); - obicons(); - si = pop(); - es = pop(); - di = 36; - bx = 104; - dl = 241; - ah = 0; - printdirect(); - worktoscreenm(); - cx = pop(); - hangonp(); -} - -void DreamGenContext::findpuztext() { +void DreamGenContext::findPuzText() { STACK_CHECK; ah = 0; si = ax; @@ -10311,121 +4521,17 @@ void DreamGenContext::findpuztext() { si = ax; } -void DreamGenContext::issetobonmap() { - STACK_CHECK; - push(es); - push(bx); - getsetad(); - al = es.byte(bx+58); - bx = pop(); - es = pop(); - _cmp(al, 0); -} - -void DreamGenContext::placefreeobject() { +void DreamGenContext::removeFreeObject() { STACK_CHECK; push(es); push(bx); - cl = 0; - ch = 1; - findormake(); - getfreead(); - es.byte(bx+2) = 0; - bx = pop(); - es = pop(); -} - -void DreamGenContext::removefreeobject() { - STACK_CHECK; - push(es); - push(bx); - getfreead(); + getFreeAd(); es.byte(bx+2) = 255; bx = pop(); es = pop(); } -void DreamGenContext::switchryanon() { - STACK_CHECK; - data.byte(kRyanon) = 255; -} - -void DreamGenContext::switchryanoff() { - STACK_CHECK; - data.byte(kRyanon) = 1; -} - -void DreamGenContext::autoappear() { - STACK_CHECK; - _cmp(data.byte(kLocation), 32); - if (!flags.z()) - goto notinalley; - al = 5; - resetlocation(); - al = 10; - setlocation(); - data.byte(kDestpos) = 10; - return; -notinalley: - _cmp(data.byte(kReallocation), 24); - if (!flags.z()) - goto notinedens; - _cmp(data.byte(kGeneraldead), 1); - if (!flags.z()) - goto edenspart2; - _inc(data.byte(kGeneraldead)); - al = 44; - placesetobject(); - al = 18; - placesetobject(); - al = 93; - placesetobject(); - al = 92; - removesetobject(); - al = 55; - removesetobject(); - al = 75; - removesetobject(); - al = 84; - removesetobject(); - al = 85; - removesetobject(); - return; -edenspart2: - _cmp(data.byte(kSartaindead), 1); - if (!flags.z()) - return /* (notedens2) */; - al = 44; - removesetobject(); - al = 93; - removesetobject(); - al = 55; - placesetobject(); - _inc(data.byte(kSartaindead)); - return; -notinedens: - _cmp(data.byte(kReallocation), 25); - if (!flags.z()) - goto notonsartroof; - data.byte(kNewsitem) = 3; - al = 6; - resetlocation(); - al = 11; - setlocation(); - data.byte(kDestpos) = 11; - return; -notonsartroof: - _cmp(data.byte(kReallocation), 2); - if (!flags.z()) - return /* (notinlouiss) */; - _cmp(data.byte(kRockstardead), 0); - if (flags.z()) - return /* (notinlouiss) */; - al = 23; - placesetobject(); -} - -void DreamGenContext::setuptimeduse() { +void DreamGenContext::setupTimedUse() { STACK_CHECK; _cmp(data.word(kTimecount), 0); if (!flags.z()) @@ -10447,120 +4553,13 @@ void DreamGenContext::setuptimeduse() { data.word(kTimedoffset) = bx; } -void DreamGenContext::edenscdplayer() { - STACK_CHECK; - showfirstuse(); - data.word(kWatchingtime) = 18*2; - data.word(kReeltowatch) = 25; - data.word(kEndwatchreel) = 42; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; -} - -void DreamGenContext::usewall() { - STACK_CHECK; - showfirstuse(); - _cmp(data.byte(kManspath), 3); - if (flags.z()) - goto gobackover; - data.word(kWatchingtime) = 30*2; - data.word(kReeltowatch) = 2; - data.word(kEndwatchreel) = 31; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; - al = 3; - turnpathon(); - al = 4; - turnpathon(); - al = 0; - turnpathoff(); - al = 1; - turnpathoff(); - al = 2; - turnpathoff(); - al = 5; - turnpathoff(); - data.byte(kManspath) = 3; - data.byte(kFinaldest) = 3; - findxyfrompath(); - data.byte(kResetmanxy) = 1; - switchryanoff(); - return; -gobackover: - data.word(kWatchingtime) = 30*2; - data.word(kReeltowatch) = 34; - data.word(kEndwatchreel) = 60; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; - al = 3; - turnpathoff(); - al = 4; - turnpathoff(); - al = 0; - turnpathon(); - al = 1; - turnpathon(); - al = 2; - turnpathon(); - al = 5; - turnpathon(); - data.byte(kManspath) = 5; - data.byte(kFinaldest) = 5; - findxyfrompath(); - data.byte(kResetmanxy) = 1; - switchryanoff(); -} - -void DreamGenContext::usechurchgate() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto gatewith; - withwhat(); - return; -gatewith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'C'; - ch = 'U'; - dl = 'T'; - dh = 'T'; - compare(); - if (flags.z()) - goto cutgate; - cx = 300; - al = 14; - showpuztext(); - putbackobstuff(); - return; -cutgate: - showfirstuse(); - data.word(kWatchingtime) = 64*2; - data.word(kReeltowatch) = 4; - data.word(kEndwatchreel) = 70; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; - _inc(data.byte(kProgresspoints)); - al = 3; - turnpathon(); - _cmp(data.byte(kAidedead), 0); - if (flags.z()) - return /* (notopenchurch) */; - al = 2; - turnpathon(); -} - -void DreamGenContext::usegun() { +void DreamGenContext::useGun() { STACK_CHECK; _cmp(data.byte(kObjecttype), 4); if (flags.z()) goto istakengun; - showseconduse(); - putbackobstuff(); + showSecondUse(); + putBackObStuff(); return; istakengun: _cmp(data.byte(kReallocation), 22); @@ -10568,7 +4567,7 @@ istakengun: goto notinpoolroom; cx = 300; al = 34; - showpuztext(); + showPuzText(); data.byte(kLastweapon) = 1; data.byte(kCombatcount) = 39; data.byte(kGetback) = 1; @@ -10580,7 +4579,7 @@ notinpoolroom: goto nothelicopter; cx = 300; al = 34; - showpuztext(); + showPuzText(); data.byte(kLastweapon) = 1; data.byte(kCombatcount) = 19; data.byte(kGetback) = 1; @@ -10595,7 +4594,7 @@ nothelicopter: goto notinrockroom; cx = 300; al = 46; - showpuztext(); + showPuzText(); data.byte(kPointermode) = 2; data.byte(kRockstardead) = 1; data.byte(kLastweapon) = 1; @@ -10616,7 +4615,7 @@ notinrockroom: if (!flags.z()) goto notbystudio; al = 92; - issetobonmap(); + isSetObOnMap(); if (flags.z()) goto notbystudio; _cmp(data.byte(kManspath), 9); @@ -10624,7 +4623,7 @@ notinrockroom: goto notbystudio; data.byte(kDestination) = 9; data.byte(kFinaldest) = 9; - autosetwalk(); + autoSetWalk(); data.byte(kLastweapon) = 1; data.byte(kGetback) = 1; _inc(data.byte(kProgresspoints)); @@ -10640,20 +4639,20 @@ notbystudio: if (!flags.z()) goto notsarters; al = 5; - issetobonmap(); + isSetObOnMap(); if (!flags.z()) goto notsarters; data.byte(kDestination) = 1; data.byte(kFinaldest) = 1; - autosetwalk(); + autoSetWalk(); al = 5; - removesetobject(); + removeSetObject(); al = 6; - placesetobject(); + placeSetObject(); al = 1; ah = data.byte(kRoomnum); _dec(ah); - turnanypathon(); + turnAnyPathOn(); data.byte(kLiftflag) = 1; data.word(kWatchingtime) = 40*2; data.word(kReeltowatch) = 4; @@ -10669,13 +4668,13 @@ notsarters: goto notaide; data.byte(kGetback) = 1; al = 13; - resetlocation(); + resetLocation(); al = 12; - setlocation(); + setLocation(); data.byte(kDestpos) = 12; data.byte(kDestination) = 2; data.byte(kFinaldest) = 2; - autosetwalk(); + autoSetWalk(); data.word(kWatchingtime) = 164*2; data.word(kReeltowatch) = 3; data.word(kEndwatchreel) = 164; @@ -10701,7 +4700,7 @@ notaide: goto pathokboss; data.byte(kDestination) = 5; data.byte(kFinaldest) = 5; - autosetwalk(); + autoSetWalk(); pathokboss: data.byte(kLastweapon) = 1; data.byte(kGetback) = 1; @@ -10721,1279 +4720,17 @@ notwithboss: goto pathoktv; data.byte(kDestination) = 2; data.byte(kFinaldest) = 2; - autosetwalk(); + autoSetWalk(); pathoktv: data.byte(kLastweapon) = 1; data.byte(kGetback) = 1; return; nottvsoldier: - showfirstuse(); - putbackobstuff(); -} - -void DreamGenContext::useshield() { - STACK_CHECK; - _cmp(data.byte(kReallocation), 20); - if (!flags.z()) - goto notinsartroom; - _cmp(data.byte(kCombatcount), 0); - if (flags.z()) - goto notinsartroom; - data.byte(kLastweapon) = 3; - showseconduse(); - data.byte(kGetback) = 1; - _inc(data.byte(kProgresspoints)); - removeobfrominv(); - return; -notinsartroom: - showfirstuse(); - putbackobstuff(); + showFirstUse(); + putBackObStuff(); } -void DreamGenContext::usebuttona() { - STACK_CHECK; - al = 95; - issetobonmap(); - if (flags.z()) - goto donethisbit; - showfirstuse(); - al = 0; - ah = data.byte(kRoomnum); - _dec(ah); - turnanypathon(); - al = 9; - removesetobject(); - al = 95; - placesetobject(); - data.word(kWatchingtime) = 15*2; - data.word(kReeltowatch) = 71; - data.word(kEndwatchreel) = 85; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; - _inc(data.byte(kProgresspoints)); - return; -donethisbit: - showseconduse(); - putbackobstuff(); -} - -void DreamGenContext::useplate() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto platewith; - withwhat(); - return; -platewith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'S'; - ch = 'C'; - dl = 'R'; - dh = 'W'; - compare(); - if (flags.z()) - goto unscrewplate; - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'K'; - ch = 'N'; - dl = 'F'; - dh = 'E'; - compare(); - if (flags.z()) - goto triedknife; - cx = 300; - al = 14; - showpuztext(); - putbackobstuff(); - return; -unscrewplate: - al = 20; - playchannel1(); - showfirstuse(); - al = 28; - placesetobject(); - al = 24; - placesetobject(); - al = 25; - removesetobject(); - al = 0; - placefreeobject(); - _inc(data.byte(kProgresspoints)); - data.byte(kGetback) = 1; - return; -triedknife: - cx = 300; - al = 54; - showpuztext(); - putbackobstuff(); -} - -void DreamGenContext::usewinch() { - STACK_CHECK; - al = 40; - ah = 1; - checkinside(); - _cmp(cl, (114)); - if (flags.z()) - goto nowinch; - al = cl; - ah = 4; - cl = 'F'; - ch = 'U'; - dl = 'S'; - dh = 'E'; - compare(); - if (!flags.z()) - goto nowinch; - data.word(kWatchingtime) = 217*2; - data.word(kReeltowatch) = 0; - data.word(kEndwatchreel) = 217; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kDestpos) = 1; - data.byte(kNewlocation) = 45; - data.byte(kDreamnumber) = 1; - data.byte(kRoomafterdream) = 44; - data.byte(kGeneraldead) = 1; - data.byte(kNewsitem) = 2; - data.byte(kGetback) = 1; - _inc(data.byte(kProgresspoints)); - return; -nowinch: - showfirstuse(); - putbackobstuff(); -} - -void DreamGenContext::entercode() { - STACK_CHECK; - data.word(kKeypadax) = ax; - data.word(kKeypadcx) = cx; - getridofreels(); - loadkeypad(); - createpanel(); - showicon(); - showouterpad(); - showkeypad(); - readmouse(); - showpointer(); - worktoscreen(); - delpointer(); - data.word(kPresspointer) = 0; - data.byte(kGetback) = 0; -keypadloop: - _cmp(data.byte(kQuitrequested), 0); - if (!flags.z()) - goto numberright; - delpointer(); - readmouse(); - showkeypad(); - showpointer(); - vsync(); - _cmp(data.byte(kPresscount), 0); - if (flags.z()) - goto nopresses; - _dec(data.byte(kPresscount)); - goto afterpress; -nopresses: - data.byte(kPressed) = 255; - data.byte(kGraphicpress) = 255; - vsync(); -afterpress: - dumppointer(); - dumpkeypad(); - dumptextline(); - bx = offset_keypadlist; - checkcoords(); - _cmp(data.byte(kGetback), 1); - if (flags.z()) - goto numberright; - _cmp(data.byte(kLightcount), 1); - if (!flags.z()) - goto notendkey; - _cmp(data.byte(kLockstatus), 0); - if (flags.z()) - goto numberright; - goto keypadloop; -notendkey: - _cmp(data.byte(kPresscount), 40); - if (!flags.z()) - goto keypadloop; - addtopresslist(); - _cmp(data.byte(kPressed), 11); - if (!flags.z()) - goto keypadloop; - ax = data.word(kKeypadax); - cx = data.word(kKeypadcx); - isitright(); - if (!flags.z()) - goto incorrect; - data.byte(kLockstatus) = 0; - al = 11; - playchannel1(); - data.byte(kLightcount) = 120; - data.word(kPresspointer) = 0; - goto keypadloop; -incorrect: - al = 11; - playchannel1(); - data.byte(kLightcount) = 120; - data.word(kPresspointer) = 0; - goto keypadloop; -numberright: - data.byte(kManisoffscreen) = 0; - getridoftemp(); - restorereels(); - redrawmainscrn(); - worktoscreenm(); -} - -void DreamGenContext::loadkeypad() { - STACK_CHECK; - dx = 1948; - loadintotemp(); -} - -void DreamGenContext::quitkey() { - STACK_CHECK; - _cmp(data.byte(kCommandtype), 222); - if (flags.z()) - goto alreadyqk; - data.byte(kCommandtype) = 222; - al = 4; - commandonly(); -alreadyqk: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (notqk) */; - _and(ax, 1); - if (!flags.z()) - goto doqk; - return; -doqk: - data.byte(kGetback) = 1; -} - -void DreamGenContext::addtopresslist() { - STACK_CHECK; - _cmp(data.word(kPresspointer), 5); - if (flags.z()) - return /* (nomorekeys) */; - al = data.byte(kPressed); - _cmp(al, 10); - if (!flags.z()) - goto not10; - al = 0; -not10: - bx = data.word(kPresspointer); - dx = data; - es = dx; - _add(bx, 8573); - es.byte(bx) = al; - _inc(data.word(kPresspointer)); -} - -void DreamGenContext::buttonone() { - STACK_CHECK; - cl = 1; - buttonpress(); -} - -void DreamGenContext::buttontwo() { - STACK_CHECK; - cl = 2; - buttonpress(); -} - -void DreamGenContext::buttonthree() { - STACK_CHECK; - cl = 3; - buttonpress(); -} - -void DreamGenContext::buttonfour() { - STACK_CHECK; - cl = 4; - buttonpress(); -} - -void DreamGenContext::buttonfive() { - STACK_CHECK; - cl = 5; - buttonpress(); -} - -void DreamGenContext::buttonsix() { - STACK_CHECK; - cl = 6; - buttonpress(); -} - -void DreamGenContext::buttonseven() { - STACK_CHECK; - cl = 7; - buttonpress(); -} - -void DreamGenContext::buttoneight() { - STACK_CHECK; - cl = 8; - buttonpress(); -} - -void DreamGenContext::buttonnine() { - STACK_CHECK; - cl = 9; - buttonpress(); -} - -void DreamGenContext::buttonnought() { - STACK_CHECK; - cl = 10; - buttonpress(); -} - -void DreamGenContext::buttonenter() { - STACK_CHECK; - cl = 11; - buttonpress(); -} - -void DreamGenContext::buttonpress() { - STACK_CHECK; - ch = cl; - _add(ch, 100); - _cmp(data.byte(kCommandtype), ch); - if (flags.z()) - goto alreadyb; - data.byte(kCommandtype) = ch; - al = cl; - _add(al, 4); - push(cx); - commandonly(); - cx = pop(); -alreadyb: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (notb) */; - _and(ax, 1); - if (!flags.z()) - goto dob; - return; -dob: - data.byte(kPressed) = cl; - _add(cl, 21); - data.byte(kGraphicpress) = cl; - data.byte(kPresscount) = 40; - _cmp(cl, 32); - if (flags.z()) - return /* (nonoise) */; - al = 10; - playchannel1(); -} - -void DreamGenContext::showouterpad() { - STACK_CHECK; - di = (36+112)-3; - bx = (72)-4; - ds = data.word(kTempgraphics); - al = 1; - ah = 0; - showframe(); - di = (36+112)+74; - bx = (72)+76; - ds = data.word(kTempgraphics); - al = 37; - ah = 0; - showframe(); -} - -void DreamGenContext::showkeypad() { - STACK_CHECK; - al = 22; - di = (36+112)+9; - bx = (72)+5; - singlekey(); - al = 23; - di = (36+112)+31; - bx = (72)+5; - singlekey(); - al = 24; - di = (36+112)+53; - bx = (72)+5; - singlekey(); - al = 25; - di = (36+112)+9; - bx = (72)+23; - singlekey(); - al = 26; - di = (36+112)+31; - bx = (72)+23; - singlekey(); - al = 27; - di = (36+112)+53; - bx = (72)+23; - singlekey(); - al = 28; - di = (36+112)+9; - bx = (72)+41; - singlekey(); - al = 29; - di = (36+112)+31; - bx = (72)+41; - singlekey(); - al = 30; - di = (36+112)+53; - bx = (72)+41; - singlekey(); - al = 31; - di = (36+112)+9; - bx = (72)+59; - singlekey(); - al = 32; - di = (36+112)+31; - bx = (72)+59; - singlekey(); - _cmp(data.byte(kLightcount), 0); - if (flags.z()) - return /* (notenter) */; - _dec(data.byte(kLightcount)); - al = 36; - bx = (72)-1+63; - _cmp(data.byte(kLockstatus), 0); - if (!flags.z()) - goto changelight; - al = 41; - bx = (72)+4+63; -changelight: - _cmp(data.byte(kLightcount), 60); - if (flags.c()) - goto gotlight; - _cmp(data.byte(kLightcount), 100); - if (!flags.c()) - goto gotlight; - _dec(al); -gotlight: - ds = data.word(kTempgraphics); - ah = 0; - di = (36+112)+60; - showframe(); -} - -void DreamGenContext::singlekey() { - STACK_CHECK; - _cmp(data.byte(kGraphicpress), al); - if (!flags.z()) - goto gotkey; - _add(al, 11); - _cmp(data.byte(kPresscount), 8); - if (!flags.c()) - goto gotkey; - _sub(al, 11); -gotkey: - ds = data.word(kTempgraphics); - _sub(al, 20); - ah = 0; - showframe(); -} - -void DreamGenContext::dumpkeypad() { - STACK_CHECK; - di = (36+112)-3; - bx = (72)-4; - cl = 120; - ch = 90; - multidump(); -} - -void DreamGenContext::usemenu() { - STACK_CHECK; - getridofreels(); - loadmenu(); - createpanel(); - showpanel(); - showicon(); - data.byte(kNewobs) = 0; - drawfloor(); - printsprites(); - al = 4; - ah = 0; - di = (80+40)-48; - bx = (60)-4; - ds = data.word(kTempgraphics2); - showframe(); - getundermenu(); - al = 5; - ah = 0; - di = (80+40)+54; - bx = (60)+72; - ds = data.word(kTempgraphics2); - showframe(); - worktoscreenm(); - data.byte(kGetback) = 0; -menuloop: - delpointer(); - putundermenu(); - showmenu(); - readmouse(); - showpointer(); - vsync(); - dumppointer(); - dumpmenu(); - dumptextline(); - bx = offset_menulist; - checkcoords(); - _cmp(data.byte(kGetback), 1); - if (!flags.z()) - goto menuloop; - data.byte(kManisoffscreen) = 0; - redrawmainscrn(); - getridoftemp(); - getridoftemp2(); - restorereels(); - worktoscreenm(); -} - -void DreamGenContext::dumpmenu() { - STACK_CHECK; - di = (80+40); - bx = (60); - cl = 48; - ch = 48; - multidump(); -} - -void DreamGenContext::getundermenu() { - STACK_CHECK; - di = (80+40); - bx = (60); - cl = 48; - ch = 48; - ds = data.word(kBuffers); - si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)); - multiget(); -} - -void DreamGenContext::putundermenu() { - STACK_CHECK; - di = (80+40); - bx = (60); - cl = 48; - ch = 48; - ds = data.word(kBuffers); - si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)); - multiput(); -} - -void DreamGenContext::showoutermenu() { - STACK_CHECK; - al = 40; - ah = 0; - di = (80+40)-34; - bx = (60)-40; - ds = data.word(kTempgraphics); - showframe(); - al = 41; - ah = 0; - di = (80+40)+64-34; - bx = (60)-40; - ds = data.word(kTempgraphics); - showframe(); - al = 42; - ah = 0; - di = (80+40)-26; - bx = (60)+57-40; - ds = data.word(kTempgraphics); - showframe(); - al = 43; - ah = 0; - di = (80+40)+64-26; - bx = (60)+57-40; - ds = data.word(kTempgraphics); - showframe(); -} - -void DreamGenContext::showmenu() { - STACK_CHECK; - _inc(data.byte(kMenucount)); - _cmp(data.byte(kMenucount), 37*2); - if (!flags.z()) - goto menuframeok; - data.byte(kMenucount) = 0; -menuframeok: - al = data.byte(kMenucount); - _shr(al, 1); - ah = 0; - di = (80+40); - bx = (60); - ds = data.word(kTempgraphics); - showframe(); -} - -void DreamGenContext::loadmenu() { - STACK_CHECK; - dx = 1832; - loadintotemp(); - dx = 1987; - loadintotemp2(); -} - -void DreamGenContext::viewfolder() { - STACK_CHECK; - data.byte(kManisoffscreen) = 1; - getridofall(); - loadfolder(); - data.byte(kFolderpage) = 0; - showfolder(); - worktoscreenm(); - data.byte(kGetback) = 0; -folderloop: - delpointer(); - readmouse(); - showpointer(); - vsync(); - dumppointer(); - dumptextline(); - bx = offset_folderlist; - checkcoords(); - _cmp(data.byte(kGetback), 0); - if (flags.z()) - goto folderloop; - data.byte(kManisoffscreen) = 0; - getridoftemp(); - getridoftemp2(); - getridoftemp3(); - getridoftempcharset(); - restoreall(); - redrawmainscrn(); - worktoscreenm(); -} - -void DreamGenContext::nextfolder() { - STACK_CHECK; - _cmp(data.byte(kFolderpage), 12); - if (!flags.z()) - goto cannextf; - blank(); - return; -cannextf: - _cmp(data.byte(kCommandtype), 201); - if (flags.z()) - goto alreadynextf; - data.byte(kCommandtype) = 201; - al = 16; - commandonly(); -alreadynextf: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (notnextf) */; - _cmp(ax, 1); - if (flags.z()) - goto donextf; - return; -donextf: - _inc(data.byte(kFolderpage)); - folderhints(); - delpointer(); - showfolder(); - data.word(kMousebutton) = 0; - bx = offset_folderlist; - checkcoords(); - worktoscreenm(); -} - -void DreamGenContext::folderhints() { - STACK_CHECK; - _cmp(data.byte(kFolderpage), 5); - if (!flags.z()) - goto notaideadd; - _cmp(data.byte(kAidedead), 1); - if (flags.z()) - goto notaideadd; - al = 13; - getlocation(); - _cmp(al, 1); - if (flags.z()) - goto notaideadd; - al = 13; - setlocation(); - showfolder(); - al = 30; - findtext1(); - di = 0; - bx = 86; - dl = 141; - ah = 16; - printdirect(); - worktoscreenm(); - cx = 200; - hangonp(); - return; -notaideadd: - _cmp(data.byte(kFolderpage), 9); - if (!flags.z()) - return /* (notaristoadd) */; - al = 7; - getlocation(); - _cmp(al, 1); - if (flags.z()) - return /* (notaristoadd) */; - al = 7; - setlocation(); - showfolder(); - al = 31; - findtext1(); - di = 0; - bx = 86; - dl = 141; - ah = 16; - printdirect(); - worktoscreenm(); - cx = 200; - hangonp(); -} - -void DreamGenContext::lastfolder() { - STACK_CHECK; - _cmp(data.byte(kFolderpage), 0); - if (!flags.z()) - goto canlastf; - blank(); - return; -canlastf: - _cmp(data.byte(kCommandtype), 202); - if (flags.z()) - goto alreadylastf; - data.byte(kCommandtype) = 202; - al = 17; - commandonly(); -alreadylastf: - _cmp(data.byte(kFolderpage), 0); - if (flags.z()) - return /* (notlastf) */; - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (notlastf) */; - _cmp(ax, 1); - if (flags.z()) - goto dolastf; - return; -dolastf: - _dec(data.byte(kFolderpage)); - delpointer(); - showfolder(); - data.word(kMousebutton) = 0; - bx = offset_folderlist; - checkcoords(); - worktoscreenm(); -} - -void DreamGenContext::loadfolder() { - STACK_CHECK; - dx = 2299; - loadintotemp(); - dx = 2312; - loadintotemp2(); - dx = 2325; - loadintotemp3(); - dx = 1883; - loadtempcharset(); - dx = 2195; - loadtemptext(); -} - -void DreamGenContext::showfolder() { - STACK_CHECK; - data.byte(kCommandtype) = 255; - _cmp(data.byte(kFolderpage), 0); - if (flags.z()) - goto closedfolder; - usetempcharset(); - createpanel2(); - ds = data.word(kTempgraphics); - di = 0; - bx = 0; - al = 0; - ah = 0; - showframe(); - ds = data.word(kTempgraphics); - di = 143; - bx = 0; - al = 1; - ah = 0; - showframe(); - ds = data.word(kTempgraphics); - di = 0; - bx = 92; - al = 2; - ah = 0; - showframe(); - ds = data.word(kTempgraphics); - di = 143; - bx = 92; - al = 3; - ah = 0; - showframe(); - folderexit(); - _cmp(data.byte(kFolderpage), 1); - if (flags.z()) - goto noleftpage; - showleftpage(); -noleftpage: - _cmp(data.byte(kFolderpage), 12); - if (flags.z()) - goto norightpage; - showrightpage(); -norightpage: - usecharset1(); - undertextline(); - return; -closedfolder: - createpanel2(); - ds = data.word(kTempgraphics3); - di = 143-28; - bx = 0; - al = 0; - ah = 0; - showframe(); - ds = data.word(kTempgraphics3); - di = 143-28; - bx = 92; - al = 1; - ah = 0; - showframe(); - folderexit(); - undertextline(); -} - -void DreamGenContext::folderexit() { - STACK_CHECK; - ds = data.word(kTempgraphics2); - di = 296; - bx = 178; - al = 6; - ah = 0; - showframe(); -} - -void DreamGenContext::showleftpage() { - STACK_CHECK; - ds = data.word(kTempgraphics2); - di = 0; - bx = 12; - al = 3; - ah = 0; - showframe(); - bx = 12+5; - cx = 9; -leftpageloop: - push(cx); - push(bx); - ds = data.word(kTempgraphics2); - di = 0; - al = 4; - ah = 0; - showframe(); - bx = pop(); - cx = pop(); - _add(bx, 16); - if (--cx) - goto leftpageloop; - ds = data.word(kTempgraphics2); - di = 0; - al = 5; - ah = 0; - showframe(); - data.word(kLinespacing) = 8; - data.word(kCharshift) = 91; - data.byte(kKerning) = 1; - bl = data.byte(kFolderpage); - _dec(bl); - _dec(bl); - _add(bl, bl); - bh = 0; - _add(bx, bx); - es = data.word(kTextfile1); - si = es.word(bx); - _add(si, 66*2); - di = 2; - bx = 48; - dl = 140; - cx = 2; -twolotsleft: - push(cx); -contleftpage: - printdirect(); - _add(bx, data.word(kLinespacing)); - _cmp(al, 0); - if (!flags.z()) - goto contleftpage; - cx = pop(); - if (--cx) - goto twolotsleft; - data.byte(kKerning) = 0; - data.word(kCharshift) = 0; - data.word(kLinespacing) = 10; - es = data.word(kWorkspace); - ds = data.word(kWorkspace); - di = (48*320)+2; - si = (48*320)+2+130; - cx = 120; -flipfolder: - push(cx); - push(di); - push(si); - cx = 65; -flipfolderline: - al = es.byte(di); - ah = es.byte(si); - es.byte(di) = ah; - es.byte(si) = al; - _dec(si); - _inc(di); - if (--cx) - goto flipfolderline; - si = pop(); - di = pop(); - cx = pop(); - _add(si, 320); - _add(di, 320); - if (--cx) - goto flipfolder; -} - -void DreamGenContext::showrightpage() { - STACK_CHECK; - ds = data.word(kTempgraphics2); - di = 143; - bx = 12; - al = 0; - ah = 0; - showframe(); - bx = 12+37; - cx = 7; -rightpageloop: - push(cx); - push(bx); - ds = data.word(kTempgraphics2); - di = 143; - al = 1; - ah = 0; - showframe(); - bx = pop(); - cx = pop(); - _add(bx, 16); - if (--cx) - goto rightpageloop; - ds = data.word(kTempgraphics2); - di = 143; - al = 2; - ah = 0; - showframe(); - data.word(kLinespacing) = 8; - data.byte(kKerning) = 1; - bl = data.byte(kFolderpage); - _dec(bl); - _add(bl, bl); - bh = 0; - _add(bx, bx); - es = data.word(kTextfile1); - si = es.word(bx); - _add(si, 66*2); - di = 152; - bx = 48; - dl = 140; - cx = 2; -twolotsright: - push(cx); -contrightpage: - printdirect(); - _add(bx, data.word(kLinespacing)); - _cmp(al, 0); - if (!flags.z()) - goto contrightpage; - cx = pop(); - if (--cx) - goto twolotsright; - data.byte(kKerning) = 0; - data.word(kLinespacing) = 10; -} - -void DreamGenContext::entersymbol() { - STACK_CHECK; - data.byte(kManisoffscreen) = 1; - getridofreels(); - dx = 2338; - loadintotemp(); - data.byte(kSymboltopx) = 24; - data.byte(kSymboltopdir) = 0; - data.byte(kSymbolbotx) = 24; - data.byte(kSymbolbotdir) = 0; - redrawmainscrn(); - showsymbol(); - undertextline(); - worktoscreenm(); - data.byte(kGetback) = 0; -symbolloop: - delpointer(); - updatesymboltop(); - updatesymbolbot(); - showsymbol(); - readmouse(); - showpointer(); - vsync(); - dumppointer(); - dumptextline(); - dumpsymbol(); - bx = offset_symbollist; - checkcoords(); - _cmp(data.byte(kGetback), 0); - if (flags.z()) - goto symbolloop; - _cmp(data.byte(kSymbolbotnum), 3); - if (!flags.z()) - goto symbolwrong; - _cmp(data.byte(kSymboltopnum), 5); - if (!flags.z()) - goto symbolwrong; - al = 43; - removesetobject(); - al = 46; - placesetobject(); - ah = data.byte(kRoomnum); - _add(ah, 12); - al = 0; - turnanypathon(); - data.byte(kManisoffscreen) = 0; - redrawmainscrn(); - getridoftemp(); - restorereels(); - worktoscreenm(); - al = 13; - playchannel1(); - return; -symbolwrong: - al = 46; - removesetobject(); - al = 43; - placesetobject(); - ah = data.byte(kRoomnum); - _add(ah, 12); - al = 0; - turnanypathoff(); - data.byte(kManisoffscreen) = 0; - redrawmainscrn(); - getridoftemp(); - restorereels(); - worktoscreenm(); -} - -void DreamGenContext::quitsymbol() { - STACK_CHECK; - _cmp(data.byte(kSymboltopx), 24); - if (!flags.z()) - { blank(); return; }; - _cmp(data.byte(kSymbolbotx), 24); - if (!flags.z()) - { blank(); return; }; - _cmp(data.byte(kCommandtype), 222); - if (flags.z()) - goto alreadyqs; - data.byte(kCommandtype) = 222; - al = 18; - commandonly(); -alreadyqs: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (notqs) */; - _and(ax, 1); - if (!flags.z()) - goto doqs; - return; -doqs: - data.byte(kGetback) = 1; -} - -void DreamGenContext::settopleft() { - STACK_CHECK; - _cmp(data.byte(kSymboltopdir), 0); - if (!flags.z()) - { blank(); return; }; - _cmp(data.byte(kCommandtype), 210); - if (flags.z()) - goto alreadytopl; - data.byte(kCommandtype) = 210; - al = 19; - commandonly(); -alreadytopl: - _cmp(data.word(kMousebutton), 0); - if (flags.z()) - return /* (notopleft) */; - data.byte(kSymboltopdir) = -1; -} - -void DreamGenContext::settopright() { - STACK_CHECK; - _cmp(data.byte(kSymboltopdir), 0); - if (!flags.z()) - { blank(); return; }; - _cmp(data.byte(kCommandtype), 211); - if (flags.z()) - goto alreadytopr; - data.byte(kCommandtype) = 211; - al = 20; - commandonly(); -alreadytopr: - _cmp(data.word(kMousebutton), 0); - if (flags.z()) - return /* (notopright) */; - data.byte(kSymboltopdir) = 1; -} - -void DreamGenContext::setbotleft() { - STACK_CHECK; - _cmp(data.byte(kSymbolbotdir), 0); - if (!flags.z()) - { blank(); return; }; - _cmp(data.byte(kCommandtype), 212); - if (flags.z()) - goto alreadybotl; - data.byte(kCommandtype) = 212; - al = 21; - commandonly(); -alreadybotl: - _cmp(data.word(kMousebutton), 0); - if (flags.z()) - return /* (nobotleft) */; - data.byte(kSymbolbotdir) = -1; -} - -void DreamGenContext::setbotright() { - STACK_CHECK; - _cmp(data.byte(kSymbolbotdir), 0); - if (!flags.z()) - { blank(); return; }; - _cmp(data.byte(kCommandtype), 213); - if (flags.z()) - goto alreadybotr; - data.byte(kCommandtype) = 213; - al = 22; - commandonly(); -alreadybotr: - _cmp(data.word(kMousebutton), 0); - if (flags.z()) - return /* (nobotright) */; - data.byte(kSymbolbotdir) = 1; -} - -void DreamGenContext::dumpsymbol() { - STACK_CHECK; - data.byte(kNewtextline) = 0; - di = (64); - bx = (56)+20; - cl = 104; - ch = 60; - multidump(); -} - -void DreamGenContext::showsymbol() { - STACK_CHECK; - al = 12; - ah = 0; - di = (64); - bx = (56); - ds = data.word(kTempgraphics); - showframe(); - al = data.byte(kSymboltopx); - ah = 0; - di = ax; - _add(di, (64)-44); - al = data.byte(kSymboltopnum); - bx = (56)+20; - ds = data.word(kTempgraphics); - ah = 32; - push(ax); - push(di); - push(bx); - push(ds); - showframe(); - ds = pop(); - bx = pop(); - di = pop(); - ax = pop(); - nextsymbol(); - _add(di, 49); - push(ax); - push(di); - push(bx); - push(ds); - showframe(); - ds = pop(); - bx = pop(); - di = pop(); - ax = pop(); - nextsymbol(); - _add(di, 49); - showframe(); - al = data.byte(kSymbolbotx); - ah = 0; - di = ax; - _add(di, (64)-44); - al = data.byte(kSymbolbotnum); - _add(al, 6); - bx = (56)+49; - ds = data.word(kTempgraphics); - ah = 32; - push(ax); - push(di); - push(bx); - push(ds); - showframe(); - ds = pop(); - bx = pop(); - di = pop(); - ax = pop(); - nextsymbol(); - _add(di, 49); - push(ax); - push(di); - push(bx); - push(ds); - showframe(); - ds = pop(); - bx = pop(); - di = pop(); - ax = pop(); - nextsymbol(); - _add(di, 49); - showframe(); -} - -void DreamGenContext::nextsymbol() { - STACK_CHECK; - _inc(al); - _cmp(al, 6); - if (flags.z()) - goto topwrap; - _cmp(al, 12); - if (flags.z()) - goto botwrap; - return; -topwrap: - al = 0; - return; -botwrap: - al = 6; -} - -void DreamGenContext::updatesymboltop() { +void DreamGenContext::updateSymbolTop() { STACK_CHECK; _cmp(data.byte(kSymboltopdir), 0); if (flags.z()) @@ -12037,7 +4774,7 @@ notwrapback: data.byte(kSymboltopdir) = 0; } -void DreamGenContext::updatesymbolbot() { +void DreamGenContext::updateSymbolBot() { STACK_CHECK; _cmp(data.byte(kSymbolbotdir), 0); if (flags.z()) @@ -12081,78 +4818,7 @@ notwrapbackb: data.byte(kSymbolbotdir) = 0; } -void DreamGenContext::dumpsymbox() { - STACK_CHECK; - _cmp(data.word(kDumpx), -1); - if (flags.z()) - return /* (nodumpsym) */; - di = data.word(kDumpx); - bx = data.word(kDumpy); - cl = 30; - ch = 77; - multidump(); - data.word(kDumpx) = -1; -} - -void DreamGenContext::usediary() { - STACK_CHECK; - getridofreels(); - dx = 2039; - loadintotemp(); - dx = 2208; - loadtemptext(); - dx = 1883; - loadtempcharset(); - createpanel(); - showicon(); - showdiary(); - undertextline(); - showdiarypage(); - readmouse(); - showpointer(); - worktoscreen(); - delpointer(); - data.byte(kGetback) = 0; -diaryloop: - delpointer(); - readmouse(); - showdiarykeys(); - showpointer(); - vsync(); - dumppointer(); - dumpdiarykeys(); - dumptextline(); - bx = offset_diarylist; - checkcoords(); - _cmp(data.byte(kGetback), 0); - if (flags.z()) - goto diaryloop; - getridoftemp(); - getridoftemptext(); - getridoftempcharset(); - restorereels(); - data.byte(kManisoffscreen) = 0; - redrawmainscrn(); - worktoscreenm(); -} - -void DreamGenContext::showdiary() { - STACK_CHECK; - al = 1; - ah = 0; - di = (68+24); - bx = (48+12)+37; - ds = data.word(kTempgraphics); - showframe(); - al = 2; - ah = 0; - di = (68+24)+176; - bx = (48+12)+108; - ds = data.word(kTempgraphics); - showframe(); -} - -void DreamGenContext::showdiarykeys() { +void DreamGenContext::showDiaryKeys() { STACK_CHECK; _cmp(data.byte(kPresscount), 0); if (flags.z()) @@ -12174,11 +4840,11 @@ gotkeyn: di = (68+24)+94; bx = (48+12)+97; ds = data.word(kTempgraphics); - showframe(); + showFrame(); _cmp(data.byte(kPresscount), 1); if (!flags.z()) return /* (notshown) */; - showdiarypage(); + showDiaryPage(); return; nokeyn: al = 5; @@ -12191,14 +4857,14 @@ gotkeyp: di = (68+24)+151; bx = (48+12)+71; ds = data.word(kTempgraphics); - showframe(); + showFrame(); _cmp(data.byte(kPresscount), 1); if (!flags.z()) return /* (notshowp) */; - showdiarypage(); + showDiaryPage(); } -void DreamGenContext::dumpdiarykeys() { +void DreamGenContext::dumpDiaryKeys() { STACK_CHECK; _cmp(data.byte(kPresscount), 1); if (!flags.z()) @@ -12213,143 +4879,83 @@ void DreamGenContext::dumpdiarykeys() { if (!flags.z()) goto notsartadd; al = 6; - getlocation(); + getLocation(); _cmp(al, 1); if (flags.z()) goto notsartadd; al = 6; - setlocation(); - delpointer(); + setLocation(); + delPointer(); al = 12; - findtext1(); + findText1(); di = 70; bx = 106; dl = 241; ah = 16; - printdirect(); - worktoscreenm(); + printDirect(); + workToScreenM(); cx = 200; - hangonp(); - createpanel(); - showicon(); - showdiary(); - showdiarypage(); - worktoscreenm(); - showpointer(); + hangOnP(); + createPanel(); + showIcon(); + showDiary(); + showDiaryPage(); + workToScreenM(); + showPointer(); return; notsartadd: di = (68+24)+48; bx = (48+12)+15; cl = 200; ch = 16; - multidump(); + multiDump(); notdumpdiary: di = (68+24)+94; bx = (48+12)+97; cl = 16; ch = 16; - multidump(); + multiDump(); di = (68+24)+151; bx = (48+12)+71; cl = 16; ch = 16; - multidump(); + multiDump(); } -void DreamGenContext::diarykeyp() { - STACK_CHECK; - _cmp(data.byte(kCommandtype), 214); - if (flags.z()) - goto alreadykeyp; - data.byte(kCommandtype) = 214; - al = 23; - commandonly(); -alreadykeyp: - _cmp(data.word(kMousebutton), 0); - if (flags.z()) - return /* (notkeyp) */; - ax = data.word(kOldbutton); - _cmp(ax, data.word(kMousebutton)); - if (flags.z()) - return /* (notkeyp) */; - _cmp(data.byte(kPresscount), 0); - if (!flags.z()) - return /* (notkeyp) */; - al = 16; - playchannel1(); - data.byte(kPresscount) = 12; - data.byte(kPressed) = 'P'; - _dec(data.byte(kDiarypage)); - _cmp(data.byte(kDiarypage), -1); - if (!flags.z()) - return /* (notkeyp) */; - data.byte(kDiarypage) = 11; -} - -void DreamGenContext::diarykeyn() { - STACK_CHECK; - _cmp(data.byte(kCommandtype), 213); - if (flags.z()) - goto alreadykeyn; - data.byte(kCommandtype) = 213; - al = 23; - commandonly(); -alreadykeyn: - _cmp(data.word(kMousebutton), 0); - if (flags.z()) - return /* (notkeyn) */; - ax = data.word(kOldbutton); - _cmp(ax, data.word(kMousebutton)); - if (flags.z()) - return /* (notkeyn) */; - _cmp(data.byte(kPresscount), 0); - if (!flags.z()) - return /* (notkeyn) */; - al = 16; - playchannel1(); - data.byte(kPresscount) = 12; - data.byte(kPressed) = 'N'; - _inc(data.byte(kDiarypage)); - _cmp(data.byte(kDiarypage), 12); - if (!flags.z()) - return /* (notkeyn) */; - data.byte(kDiarypage) = 0; -} - -void DreamGenContext::showdiarypage() { +void DreamGenContext::showDiaryPage() { STACK_CHECK; al = 0; ah = 0; di = (68+24); bx = (48+12); ds = data.word(kTempgraphics); - showframe(); + showFrame(); al = data.byte(kDiarypage); - findtext1(); + findText1(); data.byte(kKerning) = 1; - usetempcharset(); + useTempCharset(); di = (68+24)+48; bx = (48+12)+16; dl = 240; ah = 16; data.word(kCharshift) = 91+91; - printdirect(); + printDirect(); di = (68+24)+129; bx = (48+12)+16; dl = 240; ah = 16; - printdirect(); + printDirect(); di = (68+24)+48; bx = (48+12)+23; dl = 240; ah = 16; - printdirect(); + printDirect(); data.byte(kKerning) = 0; data.word(kCharshift) = 0; - usecharset1(); + useCharset1(); } -void DreamGenContext::findtext1() { +void DreamGenContext::findText1() { STACK_CHECK; ah = 0; si = ax; @@ -12360,490 +4966,14 @@ void DreamGenContext::findtext1() { si = ax; } -void DreamGenContext::zoomonoff() { - STACK_CHECK; - _cmp(data.word(kWatchingtime), 0); - if (!flags.z()) - { blank(); return; }; - _cmp(data.byte(kPointermode), 2); - if (flags.z()) - { blank(); return; }; - _cmp(data.byte(kCommandtype), 222); - if (flags.z()) - goto alreadyonoff; - data.byte(kCommandtype) = 222; - al = 39; - commandonly(); -alreadyonoff: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (nozoomonoff) */; - _and(ax, 1); - if (!flags.z()) - goto dozoomonoff; - return; -dozoomonoff: - al = data.byte(kZoomon); - _xor(al, 1); - data.byte(kZoomon) = al; - createpanel(); - data.byte(kNewobs) = 0; - drawfloor(); - printsprites(); - reelsonscreen(); - showicon(); - getunderzoom(); - undertextline(); - al = 39; - commandonly(); - readmouse(); - worktoscreenm(); -} - -void DreamGenContext::saveload() { - STACK_CHECK; - _cmp(data.word(kWatchingtime), 0); - if (!flags.z()) - { blank(); return; }; - _cmp(data.byte(kPointermode), 2); - if (flags.z()) - { blank(); return; }; - _cmp(data.byte(kCommandtype), 253); - if (flags.z()) - goto alreadyops; - data.byte(kCommandtype) = 253; - al = 43; - commandonly(); -alreadyops: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (noops) */; - _and(ax, 1); - if (flags.z()) - return /* (noops) */; - dosaveload(); -} - -void DreamGenContext::dosaveload() { - STACK_CHECK; - data.byte(kPointerframe) = 0; - data.word(kTextaddressx) = 70; - data.word(kTextaddressy) = 182-8; - data.byte(kTextlen) = 181; - data.byte(kManisoffscreen) = 1; - clearwork(); - createpanel2(); - undertextline(); - getridofall(); - loadsavebox(); - showopbox(); - showmainops(); - worktoscreen(); - goto donefirstops; -restartops: - showopbox(); - showmainops(); - worktoscreenm(); -donefirstops: - data.byte(kGetback) = 0; -waitops: - _cmp(data.byte(kQuitrequested), 0); - if (!flags.z()) - goto justret; - readmouse(); - showpointer(); - vsync(); - dumppointer(); - dumptextline(); - delpointer(); - bx = offset_opslist; - checkcoords(); - _cmp(data.byte(kGetback), 0); - if (flags.z()) - goto waitops; - _cmp(data.byte(kGetback), 2); - if (flags.z()) - goto restartops; - data.word(kTextaddressx) = 13; - data.word(kTextaddressy) = 182; - data.byte(kTextlen) = 240; - _cmp(data.byte(kGetback), 4); - if (flags.z()) - goto justret; - getridoftemp(); - restoreall(); - redrawmainscrn(); - worktoscreenm(); - data.byte(kCommandtype) = 200; -justret: - data.byte(kManisoffscreen) = 0; -} - -void DreamGenContext::getbackfromops() { - STACK_CHECK; - _cmp(data.byte(kMandead), 2); - if (flags.z()) - goto opsblock1; - getback1(); - return; -opsblock1: - blank(); -} - -void DreamGenContext::showmainops() { - STACK_CHECK; - ds = data.word(kTempgraphics); - di = (60)+10; - bx = (52)+10; - al = 8; - ah = 0; - showframe(); - ds = data.word(kTempgraphics); - di = (60)+59; - bx = (52)+30; - al = 7; - ah = 0; - showframe(); - ds = data.word(kTempgraphics); - di = (60)+128+4; - bx = (52)+12; - al = 1; - ah = 0; - showframe(); -} - -void DreamGenContext::showdiscops() { - STACK_CHECK; - ds = data.word(kTempgraphics); - di = (60)+128+4; - bx = (52)+12; - al = 1; - ah = 0; - showframe(); - ds = data.word(kTempgraphics); - di = (60)+10; - bx = (52)+10; - al = 9; - ah = 0; - showframe(); - ds = data.word(kTempgraphics); - di = (60)+59; - bx = (52)+30; - al = 10; - ah = 0; - showframe(); - ds = data.word(kTempgraphics); - di = (60)+176+2; - bx = (52)+60-4; - al = 5; - ah = 0; - showframe(); -} - -void DreamGenContext::loadsavebox() { - STACK_CHECK; - dx = 1961; - loadintotemp(); -} - -void DreamGenContext::getbacktoops() { - STACK_CHECK; - _cmp(data.byte(kCommandtype), 201); - if (flags.z()) - goto alreadygetops; - data.byte(kCommandtype) = 201; - al = 42; - commandonly(); -alreadygetops: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (nogetbackops) */; - _and(ax, 1); - if (!flags.z()) - goto dogetbackops; - return; -dogetbackops: - oldtonames(); - data.byte(kGetback) = 2; -} - -void DreamGenContext::discops() { - STACK_CHECK; - _cmp(data.byte(kCommandtype), 249); - if (flags.z()) - goto alreadydiscops; - data.byte(kCommandtype) = 249; - al = 43; - commandonly(); -alreadydiscops: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (nodiscops) */; - _and(ax, 1); - if (!flags.z()) - goto dodiscops; - return; -dodiscops: - scanfornames(); - data.byte(kLoadingorsave) = 2; - showopbox(); - showdiscops(); - data.byte(kCurrentslot) = 0; - worktoscreenm(); - data.byte(kGetback) = 0; -discopsloop: - _cmp(data.byte(kQuitrequested), 0); - if (!flags.z()) - return /* (quitdiscops) */; - delpointer(); - readmouse(); - showpointer(); - vsync(); - dumppointer(); - dumptextline(); - bx = offset_discopslist; - checkcoords(); - _cmp(data.byte(kGetback), 0); - if (flags.z()) - goto discopsloop; -} - -void DreamGenContext::actualsave() { - STACK_CHECK; - _cmp(data.byte(kCommandtype), 222); - if (flags.z()) - goto alreadyactsave; - data.byte(kCommandtype) = 222; - al = 44; - commandonly(); -alreadyactsave: - ax = data.word(kMousebutton); - _and(ax, 1); - if (flags.z()) - return /* (noactsave) */; - dx = data; - ds = dx; - si = 8579; - al = data.byte(kCurrentslot); - ah = 0; - cx = 17; - _mul(cx); - _add(si, ax); - _inc(si); - _cmp(ds.byte(si), 0); - if (flags.z()) - return /* (noactsave) */; - al = data.byte(kLocation); - ah = 0; - cx = 32; - _mul(cx); - ds = cs; - si = 6187; - _add(si, ax); - di = 7979; - bx = di; - es = cs; - cx = 16; - _movsw(cx, true); - al = data.byte(kRoomssample); - es.byte(bx+13) = al; - al = data.byte(kMapx); - es.byte(bx+15) = al; - al = data.byte(kMapy); - es.byte(bx+16) = al; - al = data.byte(kLiftflag); - es.byte(bx+20) = al; - al = data.byte(kManspath); - es.byte(bx+21) = al; - al = data.byte(kFacing); - es.byte(bx+22) = al; - al = 255; - es.byte(bx+27) = al; - saveposition(); - getridoftemp(); - restoreall(); - data.word(kTextaddressx) = 13; - data.word(kTextaddressy) = 182; - data.byte(kTextlen) = 240; - redrawmainscrn(); - worktoscreenm(); - data.byte(kGetback) = 4; -} - -void DreamGenContext::actualload() { - STACK_CHECK; - _cmp(data.byte(kCommandtype), 221); - if (flags.z()) - goto alreadyactload; - data.byte(kCommandtype) = 221; - al = 41; - commandonly(); -alreadyactload: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (notactload) */; - _cmp(ax, 1); - if (!flags.z()) - return /* (notactload) */; - dx = data; - ds = dx; - si = 8579; - al = data.byte(kCurrentslot); - ah = 0; - cx = 17; - _mul(cx); - _add(si, ax); - _inc(si); - _cmp(ds.byte(si), 0); - if (flags.z()) - return /* (notactload) */; - loadposition(); - data.byte(kGetback) = 1; -} - -void DreamGenContext::selectslot2() { - STACK_CHECK; - _cmp(data.word(kMousebutton), 0); - if (flags.z()) - goto noselslot2; - data.byte(kLoadingorsave) = 2; -noselslot2: - selectslot(); -} - -void DreamGenContext::checkinput() { - STACK_CHECK; - _cmp(data.byte(kLoadingorsave), 3); - if (flags.z()) - return /* (nokeypress) */; - readkey(); - al = data.byte(kCurrentkey); - _cmp(al, 0); - if (flags.z()) - return /* (nokeypress) */; - _cmp(al, 13); - if (!flags.z()) - goto notret; - data.byte(kLoadingorsave) = 3; - goto afterkey; -notret: - _cmp(al, 8); - if (!flags.z()) - goto nodel2; - _cmp(data.byte(kCursorpos), 0); - if (flags.z()) - return /* (nokeypress) */; - getnamepos(); - _dec(data.byte(kCursorpos)); - es.byte(bx) = 0; - es.byte(bx+1) = 1; - goto afterkey; -nodel2: - _cmp(data.byte(kCursorpos), 14); - if (flags.z()) - return /* (nokeypress) */; - getnamepos(); - _inc(data.byte(kCursorpos)); - al = data.byte(kCurrentkey); - es.byte(bx+1) = al; - es.byte(bx+2) = 0; - es.byte(bx+3) = 1; - goto afterkey; - return; -afterkey: - showopbox(); - shownames(); - showslots(); - showsaveops(); - worktoscreenm(); -} - -void DreamGenContext::getnamepos() { - STACK_CHECK; - al = data.byte(kCurrentslot); - ah = 0; - cx = 17; - _mul(cx); - dx = data; - es = dx; - bx = 8579; - _add(bx, ax); - al = data.byte(kCursorpos); - ah = 0; - _add(bx, ax); -} - -void DreamGenContext::showopbox() { - STACK_CHECK; - ds = data.word(kTempgraphics); - di = (60); - bx = (52); - al = 0; - ah = 0; - showframe(); - ds = data.word(kTempgraphics); - di = (60); - bx = (52)+55; - al = 4; - ah = 0; - showframe(); -} - -void DreamGenContext::showloadops() { - STACK_CHECK; - ds = data.word(kTempgraphics); - di = (60)+128+4; - bx = (52)+12; - al = 1; - ah = 0; - showframe(); - ds = data.word(kTempgraphics); - di = (60)+176+2; - bx = (52)+60-4; - al = 5; - ah = 0; - showframe(); - di = (60)+104; - bx = (52)+14; - al = 55; - dl = 101; - printmessage(); -} - -void DreamGenContext::showsaveops() { - STACK_CHECK; - ds = data.word(kTempgraphics); - di = (60)+128+4; - bx = (52)+12; - al = 1; - ah = 0; - showframe(); - ds = data.word(kTempgraphics); - di = (60)+176+2; - bx = (52)+60-4; - al = 5; - ah = 0; - showframe(); - di = (60)+104; - bx = (52)+14; - al = 54; - dl = 101; - printmessage(); -} - -void DreamGenContext::selectslot() { +void DreamGenContext::selectSlot() { STACK_CHECK; _cmp(data.byte(kCommandtype), 244); if (flags.z()) goto alreadysel; data.byte(kCommandtype) = 244; al = 45; - commandonly(); + commandOnly(); alreadysel: ax = data.word(kMousebutton); _cmp(ax, 1); @@ -12857,7 +4987,7 @@ alreadysel: goto notnocurs; _dec(data.byte(kLoadingorsave)); notnocurs: - oldtonames(); + oldToNames(); ax = data.word(kMousey); _sub(ax, (52)+4); cl = -1; @@ -12867,35 +4997,35 @@ getslotnum: if (!flags.c()) goto getslotnum; data.byte(kCurrentslot) = cl; - delpointer(); - showopbox(); - showslots(); - shownames(); + delPointer(); + showOpBox(); + showSlots(); + showNames(); _cmp(data.byte(kLoadingorsave), 1); if (flags.z()) goto isloadmode; - showsaveops(); - readmouse(); - showpointer(); - worktoscreen(); - delpointer(); + showSaveOps(); + readMouse(); + showPointer(); + workToScreen(); + delPointer(); return; isloadmode: - showloadops(); - readmouse(); - showpointer(); - worktoscreen(); - delpointer(); + showLoadOps(); + readMouse(); + showPointer(); + workToScreen(); + delPointer(); } -void DreamGenContext::showslots() { +void DreamGenContext::showSlots() { STACK_CHECK; di = (60)+7; bx = (52)+8; al = 2; ds = data.word(kTempgraphics); ah = 0; - showframe(); + showFrame(); di = (60)+10; bx = (52)+11; cl = 0; @@ -12909,7 +5039,7 @@ slotloop: al = 3; ds = data.word(kTempgraphics); ah = 0; - showframe(); + showFrame(); nomatchslot: bx = pop(); di = pop(); @@ -12921,564 +5051,7 @@ nomatchslot: goto slotloop; } -void DreamGenContext::shownames() { - STACK_CHECK; - dx = data; - es = dx; - si = 8579+1; - di = (60)+21; - bx = (52)+10; - cl = 0; -shownameloop: - push(cx); - push(di); - push(es); - push(bx); - push(si); - al = 4; - _cmp(cl, data.byte(kCurrentslot)); - if (!flags.z()) - goto nomatchslot2; - _cmp(data.byte(kLoadingorsave), 2); - if (!flags.z()) - goto loadmode; - dx = si; - cx = 15; - _add(si, 15); -zerostill: - _dec(si); - _dec(cl); - _cmp(es.byte(si), 1); - if (!flags.z()) - goto foundcharacter; - goto zerostill; -foundcharacter: - data.byte(kCursorpos) = cl; - es.byte(si) = '/'; - es.byte(si+1) = 0; - push(si); - si = dx; - dl = 200; - ah = 0; - printdirect(); - si = pop(); - es.byte(si) = 0; - es.byte(si+1) = 1; - goto afterprintname; -loadmode: - al = 0; - dl = 200; - ah = 0; - data.word(kCharshift) = 91; - printdirect(); - data.word(kCharshift) = 0; - goto afterprintname; -nomatchslot2: - dl = 200; - ah = 0; - printdirect(); -afterprintname: - si = pop(); - bx = pop(); - es = pop(); - di = pop(); - cx = pop(); - _add(si, 17); - _add(bx, 10); - _inc(cl); - _cmp(cl, 7); - if (!flags.z()) - goto shownameloop; -} - -void DreamGenContext::namestoold() { - STACK_CHECK; - ds = cs; - si = 8579; - di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); - es = data.word(kBuffers); - cx = 17*4; - _movsb(cx, true); -} - -void DreamGenContext::oldtonames() { - STACK_CHECK; - es = cs; - di = 8579; - si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); - ds = data.word(kBuffers); - cx = 17*4; - _movsb(cx, true); -} - -void DreamGenContext::saveposition() { - STACK_CHECK; - makeheader(); - al = data.byte(kCurrentslot); - ah = 0; - push(ax); - cx = 13; - _mul(cx); - dx = data; - ds = dx; - dx = 8698; - _add(dx, ax); - openforsave(); - dx = data; - ds = dx; - dx = 6091; - cx = (6187-6091); - savefilewrite(); - dx = data; - es = dx; - di = 6141; - ax = pop(); - cx = 17; - _mul(cx); - dx = data; - ds = dx; - dx = 8579; - _add(dx, ax); - saveseg(); - dx = data; - ds = dx; - dx = 0; - saveseg(); - ds = data.word(kExtras); - dx = (0); - saveseg(); - ds = data.word(kBuffers); - dx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); - saveseg(); - dx = data; - ds = dx; - dx = 7979; - saveseg(); - dx = data; - ds = dx; - dx = 534; - saveseg(); - closefile(); -} - -void DreamGenContext::loadposition() { - STACK_CHECK; - data.word(kTimecount) = 0; - clearchanges(); - al = data.byte(kCurrentslot); - ah = 0; - push(ax); - cx = 13; - _mul(cx); - dx = data; - ds = dx; - dx = 8698; - _add(dx, ax); - openfilefromc(); - ds = cs; - dx = 6091; - cx = (6187-6091); - savefileread(); - es = cs; - di = 6141; - ax = pop(); - cx = 17; - _mul(cx); - dx = data; - ds = dx; - dx = 8579; - _add(dx, ax); - loadseg(); - dx = data; - ds = dx; - dx = 0; - loadseg(); - ds = data.word(kExtras); - dx = (0); - loadseg(); - ds = data.word(kBuffers); - dx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); - loadseg(); - dx = data; - ds = dx; - dx = 7979; - loadseg(); - ds = cs; - dx = 534; - loadseg(); - closefile(); -} - -void DreamGenContext::makeheader() { - STACK_CHECK; - dx = data; - es = dx; - di = 6141; - ax = 17; - storeit(); - ax = (68-0); - storeit(); - ax = (0+2080+30000+(16*114)+((114+2)*2)+18000); - storeit(); - ax = (250)*4; - storeit(); - ax = 48; - storeit(); - ax = (991-534); - storeit(); -} - -void DreamGenContext::storeit() { - STACK_CHECK; - _cmp(ax, 0); - if (!flags.z()) - goto isntblank; - _inc(ax); -isntblank: - _stosw(); -} - -void DreamGenContext::scanfornames() { - STACK_CHECK; - dx = data; - es = dx; - di = 8579; - dx = data; - ds = dx; - dx = 8698; - cx = 7; -scanloop: - push(es); - push(ds); - push(di); - push(dx); - push(cx); - openfilefromc(); - if (flags.c()) - goto notexist; - cx = pop(); - _inc(ch); - push(cx); - push(di); - push(es); - dx = data; - ds = dx; - dx = 6091; - cx = (6187-6091); - savefileread(); - dx = data; - es = dx; - di = 6141; - ds = pop(); - dx = pop(); - loadseg(); - bx = data.word(kHandle); - closefile(); -notexist: - cx = pop(); - dx = pop(); - di = pop(); - ds = pop(); - es = pop(); - _add(dx, 13); - _add(di, 17); - _dec(cl); - if (!flags.z()) - goto scanloop; - al = ch; -} - -void DreamGenContext::decide() { - STACK_CHECK; - setmode(); - loadpalfromiff(); - clearpalette(); - data.byte(kPointermode) = 0; - data.word(kWatchingtime) = 0; - data.byte(kPointerframe) = 0; - data.word(kTextaddressx) = 70; - data.word(kTextaddressy) = 182-8; - data.byte(kTextlen) = 181; - data.byte(kManisoffscreen) = 1; - loadsavebox(); - showdecisions(); - worktoscreen(); - fadescreenup(); - data.byte(kGetback) = 0; -waitdecide: - _cmp(data.byte(kQuitrequested), 0); - if (flags.z()) - goto _tmp1; - return; -_tmp1: - readmouse(); - showpointer(); - vsync(); - dumppointer(); - dumptextline(); - delpointer(); - bx = offset_decidelist; - checkcoords(); - _cmp(data.byte(kGetback), 0); - if (flags.z()) - goto waitdecide; - _cmp(data.byte(kGetback), 4); - if (flags.z()) - goto hasloadedroom; - getridoftemp(); -hasloadedroom: - data.word(kTextaddressx) = 13; - data.word(kTextaddressy) = 182; - data.byte(kTextlen) = 240; -} - -void DreamGenContext::showdecisions() { - STACK_CHECK; - createpanel2(); - showopbox(); - ds = data.word(kTempgraphics); - di = (60)+17; - bx = (52)+13; - al = 6; - ah = 0; - showframe(); - undertextline(); -} - -void DreamGenContext::newgame() { - STACK_CHECK; - _cmp(data.byte(kCommandtype), 251); - if (flags.z()) - goto alreadynewgame; - data.byte(kCommandtype) = 251; - al = 47; - commandonly(); -alreadynewgame: - ax = data.word(kMousebutton); - _cmp(ax, 1); - if (!flags.z()) - return /* (nonewgame) */; - data.byte(kGetback) = 3; -} - -void DreamGenContext::loadold() { - STACK_CHECK; - _cmp(data.byte(kCommandtype), 252); - if (flags.z()) - goto alreadyloadold; - data.byte(kCommandtype) = 252; - al = 48; - commandonly(); -alreadyloadold: - ax = data.word(kMousebutton); - _and(ax, 1); - if (flags.z()) - return /* (noloadold) */; - ax = 0x0ffff; - doload(); - _cmp(data.byte(kGetback), 4); - if (flags.z()) - return /* (noloadold) */; - _cmp(data.byte(kQuitrequested), 0); - if (!flags.z()) - return /* (noloadold) */; - showdecisions(); - worktoscreenm(); - data.byte(kGetback) = 0; -} - -void DreamGenContext::createname() { - STACK_CHECK; - push(ax); - di = offset_speechfile; - cs.byte(di+0) = dl; - cs.byte(di+3) = cl; - al = dh; - ah = '0'-1; -findten: - _inc(ah); - _sub(al, 10); - if (!flags.c()) - goto findten; - cs.byte(di+1) = ah; - _add(al, 10+'0'); - cs.byte(di+2) = al; - ax = pop(); - cl = '0'-1; -thousandsc: - _inc(cl); - _sub(ax, 1000); - if (!flags.c()) - goto thousandsc; - _add(ax, 1000); - cs.byte(di+4) = cl; - cl = '0'-1; -hundredsc: - _inc(cl); - _sub(ax, 100); - if (!flags.c()) - goto hundredsc; - _add(ax, 100); - cs.byte(di+5) = cl; - cl = '0'-1; -tensc: - _inc(cl); - _sub(ax, 10); - if (!flags.c()) - goto tensc; - _add(ax, 10); - cs.byte(di+6) = cl; - _add(al, '0'); - cs.byte(di+7) = al; -} - -void DreamGenContext::trysoundalloc() { - STACK_CHECK; - _cmp(data.byte(kNeedsoundbuff), 1); - if (flags.z()) - return /* (gotsoundbuff) */; - _inc(data.byte(kSoundtimes)); - bx = (16384+2048)/16; - allocatemem(); - data.word(kSoundbuffer) = ax; - push(ax); - al = ah; - cl = 4; - _shr(al, cl); - data.byte(kSoundbufferpage) = al; - ax = pop(); - cl = 4; - _shl(ax, cl); - data.word(kSoundbufferad) = ax; - _cmp(ax, 0x0b7ff); - if (!flags.c()) - goto soundfail; - es = data.word(kSoundbuffer); - di = 0; - cx = 16384/2; - ax = 0x7f7f; - _stosw(cx, true); - data.byte(kNeedsoundbuff) = 1; - return; -soundfail: - es = data.word(kSoundbuffer); - deallocatemem(); -} - -void DreamGenContext::playchannel0() { - STACK_CHECK; - _cmp(data.byte(kSoundint), 255); - if (flags.z()) - return /* (dontbother4) */; - push(es); - push(ds); - push(bx); - push(cx); - push(di); - push(si); - data.byte(kCh0playing) = al; - es = data.word(kSounddata); - _cmp(al, 12); - if (flags.c()) - goto notsecondbank; - es = data.word(kSounddata2); - _sub(al, 12); -notsecondbank: - data.byte(kCh0repeat) = ah; - ah = 0; - _add(ax, ax); - bx = ax; - _add(ax, ax); - _add(bx, ax); - al = es.byte(bx); - ah = 0; - data.word(kCh0emmpage) = ax; - ax = es.word(bx+1); - data.word(kCh0offset) = ax; - ax = es.word(bx+3); - data.word(kCh0blockstocopy) = ax; - _cmp(data.byte(kCh0repeat), 0); - if (flags.z()) - goto nosetloop; - ax = data.word(kCh0emmpage); - data.word(kCh0oldemmpage) = ax; - ax = data.word(kCh0offset); - data.word(kCh0oldoffset) = ax; - ax = data.word(kCh0blockstocopy); - data.word(kCh0oldblockstocopy) = ax; -nosetloop: - si = pop(); - di = pop(); - cx = pop(); - bx = pop(); - ds = pop(); - es = pop(); -} - -void DreamGenContext::playchannel1() { - STACK_CHECK; - _cmp(data.byte(kSoundint), 255); - if (flags.z()) - return /* (dontbother5) */; - _cmp(data.byte(kCh1playing), 7); - if (flags.z()) - return /* (dontbother5) */; - push(es); - push(ds); - push(bx); - push(cx); - push(di); - push(si); - data.byte(kCh1playing) = al; - es = data.word(kSounddata); - _cmp(al, 12); - if (flags.c()) - goto notsecondbank1; - es = data.word(kSounddata2); - _sub(al, 12); -notsecondbank1: - ah = 0; - _add(ax, ax); - bx = ax; - _add(ax, ax); - _add(bx, ax); - al = es.byte(bx); - ah = 0; - data.word(kCh1emmpage) = ax; - ax = es.word(bx+1); - data.word(kCh1offset) = ax; - ax = es.word(bx+3); - data.word(kCh1blockstocopy) = ax; - si = pop(); - di = pop(); - cx = pop(); - bx = pop(); - ds = pop(); - es = pop(); -} - -void DreamGenContext::volumeadjust() { - STACK_CHECK; - al = data.byte(kVolumedirection); - _cmp(al, 0); - if (flags.z()) - return /* (volok) */; - al = data.byte(kVolume); - _cmp(al, data.byte(kVolumeto)); - if (flags.z()) - goto volfinish; - _add(data.byte(kVolumecount), 64); - if (!flags.z()) - return /* (volok) */; - al = data.byte(kVolume); - _add(al, data.byte(kVolumedirection)); - data.byte(kVolume) = al; - return; -volfinish: - data.byte(kVolumedirection) = 0; -} - -void DreamGenContext::entrytexts() { +void DreamGenContext::entryTexts() { STACK_CHECK; _cmp(data.byte(kLocation), 21); if (!flags.z()) @@ -13488,7 +5061,7 @@ void DreamGenContext::entrytexts() { dx = 11; bl = 68; bh = 64; - setuptimeduse(); + setupTimedUse(); return; notloc15: _cmp(data.byte(kLocation), 30); @@ -13499,7 +5072,7 @@ notloc15: dx = 11; bl = 68; bh = 64; - setuptimeduse(); + setupTimedUse(); return; notloc43: _cmp(data.byte(kLocation), 23); @@ -13510,7 +5083,7 @@ notloc43: dx = 11; bl = 68; bh = 64; - setuptimeduse(); + setupTimedUse(); return; notloc23: _cmp(data.byte(kLocation), 31); @@ -13521,7 +5094,7 @@ notloc23: dx = 11; bl = 68; bh = 64; - setuptimeduse(); + setupTimedUse(); return; notloc44: _cmp(data.byte(kLocation), 20); @@ -13532,7 +5105,7 @@ notloc44: dx = 11; bl = 68; bh = 64; - setuptimeduse(); + setupTimedUse(); return; notsarters2: _cmp(data.byte(kLocation), 24); @@ -13543,7 +5116,7 @@ notsarters2: dx = 3; bl = 68; bh = 64; - setuptimeduse(); + setupTimedUse(); return; notedenlob: _cmp(data.byte(kLocation), 34); @@ -13554,17 +5127,17 @@ notedenlob: dx = 3; bl = 68; bh = 64; - setuptimeduse(); + setupTimedUse(); } -void DreamGenContext::entryanims() { +void DreamGenContext::entryAnims() { STACK_CHECK; data.word(kReeltowatch) = -1; data.byte(kWatchmode) = -1; _cmp(data.byte(kLocation), 33); if (!flags.z()) goto notinthebeach; - switchryanoff(); + switchRyanOff(); data.word(kWatchingtime) = 76*2; data.word(kReeltowatch) = 0; data.word(kEndwatchreel) = 76; @@ -13576,13 +5149,13 @@ notinthebeach: if (!flags.z()) goto notsparkys; al = 8; - resetlocation(); + resetLocation(); data.word(kWatchingtime) = 50*2; data.word(kReeltowatch) = 247; data.word(kEndwatchreel) = 297; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - switchryanoff(); + switchRyanOff(); return; notsparkys: _cmp(data.byte(kLocation), 22); @@ -13593,7 +5166,7 @@ notsparkys: data.word(kEndwatchreel) = 30; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - switchryanoff(); + switchRyanOff(); return; notinthelift: _cmp(data.byte(kLocation), 26); @@ -13612,7 +5185,7 @@ notunderchurch: data.word(kEndwatchreel) = 198; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - switchryanoff(); + switchRyanOff(); return; notenterdream: _cmp(data.byte(kReallocation), 46); @@ -13622,39 +5195,39 @@ notenterdream: if (!flags.z()) goto notcrystal; al = 0; - removefreeobject(); + removeFreeObject(); return; notcrystal: _cmp(data.byte(kLocation), 9); if (!flags.z()) goto nottopchurch; al = 2; - checkifpathison(); + checkIfPathIsOn(); if (flags.z()) goto nottopchurch; _cmp(data.byte(kAidedead), 0); if (flags.z()) goto nottopchurch; al = 3; - checkifpathison(); + checkIfPathIsOn(); if (!flags.z()) goto makedoorsopen; al = 2; - turnpathon(); + turnPathOn(); makedoorsopen: al = 4; - removesetobject(); + removeSetObject(); al = 5; - placesetobject(); + placeSetObject(); return; nottopchurch: _cmp(data.byte(kLocation), 47); if (!flags.z()) goto notdreamcentre; al = 4; - placesetobject(); + placeSetObject(); al = 5; - placesetobject(); + placeSetObject(); return; notdreamcentre: _cmp(data.byte(kLocation), 38); @@ -13665,7 +5238,7 @@ notdreamcentre: data.word(kEndwatchreel) = 57; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - switchryanoff(); + switchRyanOff(); return; notcarpark: _cmp(data.byte(kLocation), 32); @@ -13676,7 +5249,7 @@ notcarpark: data.word(kEndwatchreel) = 66; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - switchryanoff(); + switchRyanOff(); return; notalley: _cmp(data.byte(kLocation), 24); @@ -13685,111 +5258,13 @@ notalley: al = 2; ah = data.byte(kRoomnum); _dec(ah); - turnanypathon(); + turnAnyPathOn(); } -void DreamGenContext::initialinv() { - STACK_CHECK; - _cmp(data.byte(kReallocation), 24); - if (flags.z()) - goto isedens; - return; -isedens: - al = 11; - ah = 5; - pickupob(); - al = 12; - ah = 6; - pickupob(); - al = 13; - ah = 7; - pickupob(); - al = 14; - ah = 8; - pickupob(); - al = 18; - al = 18; - ah = 0; - pickupob(); - al = 19; - ah = 1; - pickupob(); - al = 20; - ah = 9; - pickupob(); - al = 16; - ah = 2; - pickupob(); - data.byte(kWatchmode) = 1; - data.word(kReeltohold) = 0; - data.word(kEndofholdreel) = 6; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - switchryanoff(); -} - -void DreamGenContext::pickupob() { - STACK_CHECK; - data.byte(kLastinvpos) = ah; - data.byte(kObjecttype) = 2; - data.byte(kItemframe) = al; - data.byte(kCommand) = al; - getanyad(); - transfertoex(); -} - -void DreamGenContext::checkforemm() { - STACK_CHECK; -} - -void DreamGenContext::checkbasemem() { - STACK_CHECK; - bx = data.word(kHowmuchalloc); - _cmp(bx, 0x9360); - if (!flags.c()) - return /* (enoughmem) */; - data.byte(kGameerror) = 5; - { quickquit(); return; }; -} - -void DreamGenContext::allocatebuffers() { - STACK_CHECK; - bx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/16; - allocatemem(); - data.word(kExtras) = ax; - trysoundalloc(); - bx = (0+(66*60))/16; - allocatemem(); - data.word(kMapdata) = ax; - trysoundalloc(); - bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+991-534+68-0)/16; - allocatemem(); - data.word(kBuffers) = ax; - trysoundalloc(); - bx = (16*80)/16; - allocatemem(); - data.word(kFreedat) = ax; - trysoundalloc(); - bx = (64*128)/16; - allocatemem(); - data.word(kSetdat) = ax; - trysoundalloc(); - bx = (22*8*20*8)/16; - allocatemem(); - data.word(kMapstore) = ax; - allocatework(); - bx = 2048/16; - allocatemem(); - data.word(kSounddata) = ax; - bx = 2048/16; - allocatemem(); - data.word(kSounddata2) = ax; -} - -void DreamGenContext::clearbuffers() { +void DreamGenContext::clearBuffers() { STACK_CHECK; es = data.word(kBuffers); - cx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+991-534+68-0)/2; + cx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+916-459+68-0)/2; ax = 0; di = 0; _stosw(cx, true); @@ -13801,19 +5276,19 @@ void DreamGenContext::clearbuffers() { es = data.word(kBuffers); di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)); ds = cs; - si = 534; - cx = (991-534); + si = 459; + cx = (916-459); _movsb(cx, true); es = data.word(kBuffers); - di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+991-534); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+916-459); ds = cs; si = 0; cx = (68-0); _movsb(cx, true); - clearchanges(); + clearChanges(); } -void DreamGenContext::clearchanges() { +void DreamGenContext::clearChanges() { STACK_CHECK; es = data.word(kBuffers); cx = (250)*2; @@ -13823,11 +5298,11 @@ void DreamGenContext::clearchanges() { ds = data.word(kBuffers); si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)); es = cs; - di = 534; - cx = (991-534); + di = 459; + cx = (916-459); _movsb(cx, true); ds = data.word(kBuffers); - si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+991-534); + si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+916-459); es = cs; di = 0; cx = (68-0); @@ -13841,7 +5316,7 @@ void DreamGenContext::clearchanges() { di = 0; _stosw(cx, true); es = cs; - di = 8011; + di = 1249; al = 1; _stosb(2); al = 0; @@ -13853,506 +5328,7 @@ void DreamGenContext::clearchanges() { _stosw(cx, true); } -void DreamGenContext::clearbeforeload() { - STACK_CHECK; - _cmp(data.byte(kRoomloaded), 1); - if (!flags.z()) - return /* (noclear) */; - clearreels(); - clearrest(); - data.byte(kRoomloaded) = 0; -} - -void DreamGenContext::clearreels() { - STACK_CHECK; - es = data.word(kReel1); - deallocatemem(); - es = data.word(kReel2); - deallocatemem(); - es = data.word(kReel3); - deallocatemem(); -} - -void DreamGenContext::clearrest() { - STACK_CHECK; - es = data.word(kMapdata); - cx = (66*60)/2; - ax = 0; - di = (0); - _stosw(cx, true); - es = data.word(kBackdrop); - deallocatemem(); - es = data.word(kSetframes); - deallocatemem(); - es = data.word(kReels); - deallocatemem(); - es = data.word(kPeople); - deallocatemem(); - es = data.word(kSetdesc); - deallocatemem(); - es = data.word(kBlockdesc); - deallocatemem(); - es = data.word(kRoomdesc); - deallocatemem(); - es = data.word(kFreeframes); - deallocatemem(); - es = data.word(kFreedesc); - deallocatemem(); -} - -void DreamGenContext::startup() { - STACK_CHECK; - data.byte(kCurrentkey) = 0; - data.byte(kMainmode) = 0; - createpanel(); - data.byte(kNewobs) = 1; - drawfloor(); - showicon(); - getunderzoom(); - spriteupdate(); - printsprites(); - undertextline(); - reelsonscreen(); - atmospheres(); -} - -void DreamGenContext::startup1() { - STACK_CHECK; - clearpalette(); - data.byte(kThroughdoor) = 0; - data.byte(kCurrentkey) = '0'; - data.byte(kMainmode) = 0; - createpanel(); - data.byte(kNewobs) = 1; - drawfloor(); - showicon(); - getunderzoom(); - spriteupdate(); - printsprites(); - undertextline(); - reelsonscreen(); - atmospheres(); - worktoscreen(); - fadescreenup(); -} - -void DreamGenContext::screenupdate() { - STACK_CHECK; - newplace(); - mainscreen(); - animpointer(); - showpointer(); - _cmp(data.word(kWatchingtime), 0); - if (!flags.z()) - goto iswatchingmode; - _cmp(data.byte(kNewlocation), 255); - if (!flags.z()) - return /* (finishearly) */; -iswatchingmode: - vsync(); - readmouse1(); - dumppointer(); - dumptextline(); - delpointer(); - autolook(); - spriteupdate(); - watchcount(); - zoom(); - showpointer(); - _cmp(data.byte(kWongame), 0); - if (!flags.z()) - return /* (finishearly) */; - vsync(); - readmouse2(); - dumppointer(); - dumpzoom(); - delpointer(); - deleverything(); - printsprites(); - reelsonscreen(); - afternewroom(); - showpointer(); - vsync(); - readmouse3(); - dumppointer(); - dumpmap(); - dumptimedtext(); - delpointer(); - showpointer(); - vsync(); - readmouse4(); - dumppointer(); - dumpwatch(); - delpointer(); -} - -void DreamGenContext::watchreel() { - STACK_CHECK; - _cmp(data.word(kReeltowatch), -1); - if (flags.z()) - goto notplayingreel; - al = data.byte(kManspath); - _cmp(al, data.byte(kFinaldest)); - if (!flags.z()) - return /* (waitstopwalk) */; - al = data.byte(kTurntoface); - _cmp(al, data.byte(kFacing)); - if (flags.z()) - goto notwatchpath; - return; -notwatchpath: - _dec(data.byte(kSpeedcount)); - _cmp(data.byte(kSpeedcount), -1); - if (!flags.z()) - goto showwatchreel; - al = data.byte(kWatchspeed); - data.byte(kSpeedcount) = al; - ax = data.word(kReeltowatch); - _cmp(ax, data.word(kEndwatchreel)); - if (!flags.z()) - goto ismorereel; - _cmp(data.word(kWatchingtime), 0); - if (!flags.z()) - goto showwatchreel; - data.word(kReeltowatch) = -1; - data.byte(kWatchmode) = -1; - _cmp(data.word(kReeltohold), -1); - if (flags.z()) - return /* (nomorereel) */; - data.byte(kWatchmode) = 1; - goto notplayingreel; -ismorereel: - _inc(data.word(kReeltowatch)); -showwatchreel: - ax = data.word(kReeltowatch); - data.word(kReelpointer) = ax; - plotreel(); - ax = data.word(kReelpointer); - data.word(kReeltowatch) = ax; - checkforshake(); - return; -notplayingreel: - _cmp(data.byte(kWatchmode), 1); - if (!flags.z()) - goto notholdingreel; - ax = data.word(kReeltohold); - data.word(kReelpointer) = ax; - plotreel(); - return; -notholdingreel: - _cmp(data.byte(kWatchmode), 2); - if (!flags.z()) - return /* (notreleasehold) */; - _dec(data.byte(kSpeedcount)); - _cmp(data.byte(kSpeedcount), -1); - if (!flags.z()) - goto notlastspeed2; - al = data.byte(kWatchspeed); - data.byte(kSpeedcount) = al; - _inc(data.word(kReeltohold)); -notlastspeed2: - ax = data.word(kReeltohold); - _cmp(ax, data.word(kEndofholdreel)); - if (!flags.z()) - goto ismorereel2; - data.word(kReeltohold) = -1; - data.byte(kWatchmode) = -1; - al = data.byte(kDestafterhold); - data.byte(kDestination) = al; - data.byte(kFinaldest) = al; - autosetwalk(); - return; -ismorereel2: - ax = data.word(kReeltohold); - data.word(kReelpointer) = ax; - plotreel(); -} - -void DreamGenContext::checkforshake() { - STACK_CHECK; - _cmp(data.byte(kReallocation), 26); - if (!flags.z()) - return /* (notstartshake) */; - _cmp(ax, 104); - if (!flags.z()) - return /* (notstartshake) */; - data.byte(kShakecounter) = -1; -} - -void DreamGenContext::watchcount() { - STACK_CHECK; - _cmp(data.byte(kWatchon), 0); - if (flags.z()) - return /* (nowatchworn) */; - _inc(data.byte(kTimercount)); - _cmp(data.byte(kTimercount), 9); - if (flags.z()) - goto flashdots; - _cmp(data.byte(kTimercount), 18); - if (flags.z()) - goto uptime; - return; -flashdots: - ax = 91*3+21; - di = 268+4; - bx = 21; - ds = data.word(kCharset1); - showframe(); - goto finishwatch; -uptime: - data.byte(kTimercount) = 0; - _add(data.byte(kSecondcount), 1); - _cmp(data.byte(kSecondcount), 60); - if (!flags.z()) - goto finishtime; - data.byte(kSecondcount) = 0; - _inc(data.byte(kMinutecount)); - _cmp(data.byte(kMinutecount), 60); - if (!flags.z()) - goto finishtime; - data.byte(kMinutecount) = 0; - _inc(data.byte(kHourcount)); - _cmp(data.byte(kHourcount), 24); - if (!flags.z()) - goto finishtime; - data.byte(kHourcount) = 0; -finishtime: - showtime(); -finishwatch: - data.byte(kWatchdump) = 1; -} - -void DreamGenContext::showtime() { - STACK_CHECK; - _cmp(data.byte(kWatchon), 0); - if (flags.z()) - return /* (nowatch) */; - al = data.byte(kSecondcount); - cl = 0; - twodigitnum(); - push(ax); - al = ah; - ah = 0; - _add(ax, 91*3+10); - ds = data.word(kCharset1); - di = 282+5; - bx = 21; - showframe(); - ax = pop(); - ah = 0; - _add(ax, 91*3+10); - ds = data.word(kCharset1); - di = 282+9; - bx = 21; - showframe(); - al = data.byte(kMinutecount); - cl = 0; - twodigitnum(); - push(ax); - al = ah; - ah = 0; - _add(ax, 91*3); - ds = data.word(kCharset1); - di = 270+5; - bx = 21; - showframe(); - ax = pop(); - ah = 0; - _add(ax, 91*3); - ds = data.word(kCharset1); - di = 270+11; - bx = 21; - showframe(); - al = data.byte(kHourcount); - cl = 0; - twodigitnum(); - push(ax); - al = ah; - ah = 0; - _add(ax, 91*3); - ds = data.word(kCharset1); - di = 256+5; - bx = 21; - showframe(); - ax = pop(); - ah = 0; - _add(ax, 91*3); - ds = data.word(kCharset1); - di = 256+11; - bx = 21; - showframe(); - ax = 91*3+20; - ds = data.word(kCharset1); - di = 267+5; - bx = 21; - showframe(); -} - -void DreamGenContext::dumpwatch() { - STACK_CHECK; - _cmp(data.byte(kWatchdump), 1); - if (!flags.z()) - return /* (nodumpwatch) */; - di = 256; - bx = 21; - cl = 40; - ch = 12; - multidump(); - data.byte(kWatchdump) = 0; -} - -void DreamGenContext::showbyte() { - STACK_CHECK; - dl = al; - _shr(dl, 1); - _shr(dl, 1); - _shr(dl, 1); - _shr(dl, 1); - onedigit(); - es.byte(di) = dl; - dl = al; - _and(dl, 15); - onedigit(); - es.byte(di+1) = dl; - _add(di, 3); -} - -void DreamGenContext::onedigit() { - STACK_CHECK; - _cmp(dl, 10); - if (!flags.c()) - goto morethan10; - _add(dl, '0'); - return; -morethan10: - _sub(dl, 10); - _add(dl, 'A'); -} - -void DreamGenContext::twodigitnum() { - STACK_CHECK; - ah = cl; - _dec(ah); -numloop1: - _inc(ah); - _sub(al, 10); - if (!flags.c()) - goto numloop1; - _add(al, 10); - _add(al, cl); -} - -void DreamGenContext::showword() { - STACK_CHECK; - ch = 0; - bx = 10000; - cl = 47; -word1: - _inc(cl); - _sub(ax, bx); - if (!flags.c()) - goto word1; - _add(ax, bx); - convnum(); - cs.byte(di) = cl; - bx = 1000; - cl = 47; -word2: - _inc(cl); - _sub(ax, bx); - if (!flags.c()) - goto word2; - _add(ax, bx); - convnum(); - cs.byte(di+1) = cl; - bx = 100; - cl = 47; -word3: - _inc(cl); - _sub(ax, bx); - if (!flags.c()) - goto word3; - _add(ax, bx); - convnum(); - cs.byte(di+2) = cl; - bx = 10; - cl = 47; -word4: - _inc(cl); - _sub(ax, bx); - if (!flags.c()) - goto word4; - _add(ax, bx); - convnum(); - cs.byte(di+3) = cl; - _add(al, 48); - cl = al; - convnum(); - cs.byte(di+4) = cl; -} - -void DreamGenContext::convnum() { - STACK_CHECK; - _cmp(ch, 0); - if (!flags.z()) - return /* (noconvnum) */; - _cmp(cl, '0'); - if (!flags.z()) - goto notzeronum; - cl = 32; - return /* (noconvnum) */; -notzeronum: - ch = 1; -} - -void DreamGenContext::mainscreen() { - STACK_CHECK; - data.byte(kInmaparea) = 0; - bx = offset_mainlist; - _cmp(data.byte(kWatchon), 1); - if (flags.z()) - goto checkmain; - bx = offset_mainlist2; -checkmain: - checkcoords(); - _cmp(data.byte(kWalkandexam), 0); - if (flags.z()) - return /* (finishmain) */; - walkandexamine(); -} - -void DreamGenContext::madmanrun() { - STACK_CHECK; - _cmp(data.byte(kLocation), 14); - if (!flags.z()) - { identifyob(); return; }; - _cmp(data.byte(kMapx), 22); - if (!flags.z()) - { identifyob(); return; }; - _cmp(data.byte(kPointermode), 2); - if (!flags.z()) - { identifyob(); return; }; - _cmp(data.byte(kMadmanflag), 0); - if (!flags.z()) - { identifyob(); return; }; - _cmp(data.byte(kCommandtype), 211); - if (flags.z()) - goto alreadyrun; - data.byte(kCommandtype) = 211; - al = 52; - commandonly(); -alreadyrun: - _cmp(data.word(kMousebutton), 1); - if (!flags.z()) - return /* (norun) */; - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (norun) */; - data.byte(kLastweapon) = 8; -} - -void DreamGenContext::identifyob() { +void DreamGenContext::identifyOb() { STACK_CHECK; _cmp(data.word(kWatchingtime), 0); if (!flags.z()) @@ -14376,23 +5352,23 @@ notover2: data.byte(kInmaparea) = 1; ah = bl; push(ax); - findpathofpoint(); + findPathOfPoint(); data.byte(kPointerspath) = dl; ax = pop(); push(ax); - findfirstpath(); + findFirstPath(); data.byte(kPointerfirstpath) = al; ax = pop(); - checkifex(); + checkIfEx(); if (!flags.z()) return /* (finishidentify) */; - checkiffree(); + checkIfFree(); if (!flags.z()) return /* (finishidentify) */; - checkifperson(); + checkIfPerson(); if (!flags.z()) return /* (finishidentify) */; - checkifset(); + checkIfSet(); if (!flags.z()) return /* (finishidentify) */; ax = data.word(kMousex); @@ -14401,7 +5377,7 @@ notover2: ax = data.word(kMousey); _sub(ax, data.word(kMapady)); ch = al; - checkone(); + checkOne(); _cmp(al, 0); if (flags.z()) goto nothingund; @@ -14409,13 +5385,13 @@ notover2: if (flags.z()) goto nothingund; ah = 3; - obname(); + obName(); return; nothingund: blank(); } -void DreamGenContext::findpathofpoint() { +void DreamGenContext::findPathOfPoint() { STACK_CHECK; push(ax); bx = (0); @@ -14459,7 +5435,7 @@ flunkedit: dl = 255; } -void DreamGenContext::findfirstpath() { +void DreamGenContext::findFirstPath() { STACK_CHECK; push(ax); bx = (0); @@ -14502,155 +5478,6 @@ gotfirst: al = es.byte(bx+6); } -void DreamGenContext::afternewroom() { - STACK_CHECK; - _cmp(data.byte(kNowinnewroom), 0); - if (flags.z()) - return /* (notnew) */; - data.word(kTimecount) = 0; - createpanel(); - data.byte(kCommandtype) = 0; - findroominloc(); - _cmp(data.byte(kRyanon), 1); - if (flags.z()) - goto ryansoff; - al = data.byte(kRyanx); - _add(al, 12); - ah = data.byte(kRyany); - _add(ah, 12); - findpathofpoint(); - data.byte(kManspath) = dl; - findxyfrompath(); - data.byte(kResetmanxy) = 1; -ryansoff: - data.byte(kNewobs) = 1; - drawfloor(); - data.word(kLookcounter) = 160; - data.byte(kNowinnewroom) = 0; - showicon(); - spriteupdate(); - printsprites(); - undertextline(); - reelsonscreen(); - mainscreen(); - getunderzoom(); - zoom(); - worktoscreenm(); - walkintoroom(); - reminders(); - atmospheres(); -} - -void DreamGenContext::atmospheres() { - STACK_CHECK; - cl = data.byte(kMapx); - ch = data.byte(kMapy); - bx = offset_atmospherelist; -nextatmos: - al = cs.byte(bx); - _cmp(al, 255); - if (flags.z()) - goto nomoreatmos; - _cmp(al, data.byte(kReallocation)); - if (!flags.z()) - goto wrongatmos; - ax = cs.word(bx+1); - _cmp(ax, cx); - if (!flags.z()) - goto wrongatmos; - ax = cs.word(bx+3); - _cmp(al, data.byte(kCh0playing)); - if (flags.z()) - goto playingalready; - _cmp(data.byte(kLocation), 45); - if (!flags.z()) - goto notweb; - _cmp(data.word(kReeltowatch), 45); - if (flags.z()) - goto wrongatmos; -notweb: - playchannel0(); - _cmp(data.byte(kReallocation), 2); - _cmp(data.byte(kMapy), 0); - if (flags.z()) - goto fullvol; - if (!flags.z()) - goto notlouisvol; - _cmp(data.byte(kMapy), 10); - if (!flags.z()) - goto notlouisvol; - _cmp(data.byte(kMapx), 22); - if (!flags.z()) - goto notlouisvol; - data.byte(kVolume) = 5; -notlouisvol: - _cmp(data.byte(kReallocation), 14); - if (!flags.z()) - goto notmad1; - _cmp(data.byte(kMapx), 33); - if (flags.z()) - goto ismad2; - _cmp(data.byte(kMapx), 22); - if (!flags.z()) - goto notmad1; - data.byte(kVolume) = 5; - return; -ismad2: - data.byte(kVolume) = 0; - return; -notmad1: -playingalready: - _cmp(data.byte(kReallocation), 2); - if (!flags.z()) - return /* (notlouisvol2) */; - _cmp(data.byte(kMapx), 22); - if (flags.z()) - goto louisvol; - _cmp(data.byte(kMapx), 11); - if (!flags.z()) - return /* (notlouisvol2) */; -fullvol: - data.byte(kVolume) = 0; - return; -louisvol: - data.byte(kVolume) = 5; - return; -wrongatmos: - _add(bx, 5); - goto nextatmos; -nomoreatmos: - cancelch0(); -} - -void DreamGenContext::walkintoroom() { - STACK_CHECK; - _cmp(data.byte(kLocation), 14); - if (!flags.z()) - return /* (notlair) */; - _cmp(data.byte(kMapx), 22); - if (!flags.z()) - return /* (notlair) */; - data.byte(kDestination) = 1; - data.byte(kFinaldest) = 1; - autosetwalk(); -} - -void DreamGenContext::afterintroroom() { - STACK_CHECK; - _cmp(data.byte(kNowinnewroom), 0); - if (flags.z()) - return /* (notnewintro) */; - clearwork(); - findroominloc(); - data.byte(kNewobs) = 1; - drawfloor(); - reelsonscreen(); - spriteupdate(); - printsprites(); - worktoscreen(); - data.byte(kNowinnewroom) = 0; -} - void DreamGenContext::printmessage2() { STACK_CHECK; push(dx); @@ -14667,7 +5494,7 @@ void DreamGenContext::printmessage2() { ax = pop(); searchmess: push(ax); - findnextcolon(); + findNextColon(); ax = pop(); _dec(ah); if (!flags.z()) @@ -14677,923 +5504,9 @@ searchmess: dx = pop(); al = 0; ah = 0; - printdirect(); -} - -void DreamGenContext::setwalk() { - STACK_CHECK; - _cmp(data.byte(kLinepointer), 254); - if (!flags.z()) - goto alreadywalking; - al = data.byte(kPointerspath); - _cmp(al, data.byte(kManspath)); - if (flags.z()) - goto cantwalk2; - _cmp(data.byte(kWatchmode), 1); - if (flags.z()) - goto holdingreel; - _cmp(data.byte(kWatchmode), 2); - if (flags.z()) - return /* (cantwalk) */; - data.byte(kDestination) = al; - data.byte(kFinaldest) = al; - _cmp(data.word(kMousebutton), 2); - if (!flags.z()) - goto notwalkandexam; - _cmp(data.byte(kCommandtype), 3); - if (flags.z()) - goto notwalkandexam; - data.byte(kWalkandexam) = 1; - al = data.byte(kCommandtype); - data.byte(kWalkexamtype) = al; - al = data.byte(kCommand); - data.byte(kWalkexamnum) = al; -notwalkandexam: - autosetwalk(); - return; -cantwalk2: - facerightway(); - return; -alreadywalking: - al = data.byte(kPointerspath); - data.byte(kFinaldest) = al; - return; -holdingreel: - data.byte(kDestafterhold) = al; - data.byte(kWatchmode) = 2; -} - -void DreamGenContext::workoutframes() { - STACK_CHECK; - bx = data.word(kLinestartx); - _add(bx, 32); - ax = data.word(kLineendx); - _add(ax, 32); - _sub(bx, ax); - if (!flags.c()) - goto notneg1; - _neg(bx); -notneg1: - cx = data.word(kLinestarty); - _add(cx, 32); - ax = data.word(kLineendy); - _add(ax, 32); - _sub(cx, ax); - if (!flags.c()) - goto notneg2; - _neg(cx); -notneg2: - _cmp(bx, cx); - if (!flags.c()) - goto tendstohoriz; - dl = 2; - ax = cx; - _shr(ax, 1); - _cmp(bx, ax); - if (flags.c()) - goto gotquad; - dl = 1; - goto gotquad; -tendstohoriz: - dl = 0; - ax = bx; - _shr(ax, 1); - _cmp(cx, ax); - if (flags.c()) - goto gotquad; - dl = 1; - goto gotquad; -gotquad: - bx = data.word(kLinestartx); - _add(bx, 32); - ax = data.word(kLineendx); - _add(ax, 32); - _sub(bx, ax); - if (flags.c()) - goto isinright; - cx = data.word(kLinestarty); - _add(cx, 32); - ax = data.word(kLineendy); - _add(ax, 32); - _sub(cx, ax); - if (!flags.c()) - goto topleft; - _cmp(dl, 1); - if (flags.z()) - goto noswap1; - _xor(dl, 2); -noswap1: - _add(dl, 4); - goto success; -topleft: - _add(dl, 6); - goto success; -isinright: - cx = data.word(kLinestarty); - _add(cx, 32); - ax = data.word(kLineendy); - _add(ax, 32); - _sub(cx, ax); - if (!flags.c()) - goto botright; - _add(dl, 2); - goto success; -botright: - _cmp(dl, 1); - if (flags.z()) - goto noswap2; - _xor(dl, 2); -noswap2: -success: - _and(dl, 7); - data.byte(kTurntoface) = dl; - data.byte(kTurndirection) = 0; -} - -void DreamGenContext::showicon() { - STACK_CHECK; - _cmp(data.byte(kReallocation), 50); - if (!flags.c()) - goto isdream1; - showpanel(); - showman(); - roomname(); - panelicons1(); - zoomicon(); - return; -isdream1: - ds = data.word(kTempsprites); - di = 72; - bx = 2; - al = 45; - ah = 0; - showframe(); - ds = data.word(kTempsprites); - di = 72+47; - bx = 2; - al = 46; - ah = 0; - showframe(); - ds = data.word(kTempsprites); - di = 69-10; - bx = 21; - al = 49; - ah = 0; - showframe(); - ds = data.word(kTempsprites); - di = 160+88; - bx = 2; - al = 45; - ah = 4; - showframe(); - ds = data.word(kTempsprites); - di = 160+43; - bx = 2; - al = 46; - ah = 4; - showframe(); - ds = data.word(kTempsprites); - di = 160+101; - bx = 21; - al = 49; - ah = 4; - showframe(); - middlepanel(); -} - -void DreamGenContext::middlepanel() { - STACK_CHECK; - ds = data.word(kTempsprites); - di = 72+47+20; - bx = 0; - al = 48; - ah = 0; - showframe(); - ds = data.word(kTempsprites); - di = 72+19; - bx = 21; - al = 47; - ah = 0; - showframe(); - ds = data.word(kTempsprites); - di = 160+23; - bx = 0; - al = 48; - ah = 4; - showframe(); - ds = data.word(kTempsprites); - di = 160+71; - bx = 21; - al = 47; - ah = 4; - showframe(); -} - -void DreamGenContext::showman() { - STACK_CHECK; - ds = data.word(kIcons1); - di = 0; - bx = 0; - al = 0; - ah = 0; - showframe(); - ds = data.word(kIcons1); - di = 0; - bx = 114; - al = 1; - ah = 0; - showframe(); - _cmp(data.byte(kShadeson), 0); - if (flags.z()) - return /* (notverycool) */; - ds = data.word(kIcons1); - di = 28; - bx = 25; - al = 2; - ah = 0; - showframe(); -} - -void DreamGenContext::roomname() { - STACK_CHECK; - di = 88; - bx = 18; - al = 53; - dl = 240; - printmessage(); - bl = data.byte(kRoomnum); - _cmp(bl, 32); - if (flags.c()) - goto notover32; - _sub(bl, 32); -notover32: - bh = 0; - _add(bx, bx); - es = data.word(kRoomdesc); - _add(bx, (0)); - ax = es.word(bx); - _add(ax, (0+(38*2))); - si = ax; - data.word(kLinespacing) = 7; - di = 88; - bx = 25; - dl = 120; - _cmp(data.byte(kWatchon), 1); - if (flags.z()) - goto gotpl; - dl = 160; -gotpl: - al = 0; - ah = 0; - printdirect(); - data.word(kLinespacing) = 10; - usecharset1(); -} - -void DreamGenContext::usecharset1() { - STACK_CHECK; - ax = data.word(kCharset1); - data.word(kCurrentset) = ax; -} - -void DreamGenContext::usetempcharset() { - STACK_CHECK; - ax = data.word(kTempcharset); - data.word(kCurrentset) = ax; -} - -void DreamGenContext::showexit() { - STACK_CHECK; - ds = data.word(kIcons1); - di = 274; - bx = 154; - al = 11; - ah = 0; - showframe(); -} - -void DreamGenContext::panelicons1() { - STACK_CHECK; - di = 0; - _cmp(data.byte(kWatchon), 1); - if (flags.z()) - goto watchison; - di = 48; -watchison: - push(di); - ds = data.word(kIcons2); - _add(di, 204); - bx = 4; - al = 2; - ah = 0; - showframe(); - di = pop(); - push(di); - _cmp(data.byte(kZoomon), 1); - if (flags.z()) - goto zoomisoff; - ds = data.word(kIcons1); - _add(di, 228); - bx = 8; - al = 5; - ah = 0; - showframe(); -zoomisoff: - di = pop(); - showwatch(); -} - -void DreamGenContext::showwatch() { - STACK_CHECK; - _cmp(data.byte(kWatchon), 0); - if (flags.z()) - return /* (nowristwatch) */; - ds = data.word(kIcons1); - di = 250; - bx = 1; - al = 6; - ah = 0; - showframe(); - showtime(); -} - -void DreamGenContext::zoomicon() { - STACK_CHECK; - _cmp(data.byte(kZoomon), 0); - if (flags.z()) - return /* (nozoom1) */; - ds = data.word(kIcons1); - di = (8); - bx = (132)-1; - al = 8; - ah = 0; - showframe(); -} - -void DreamGenContext::worktoscreenm() { - STACK_CHECK; - animpointer(); - readmouse(); - showpointer(); - vsync(); - worktoscreen(); - delpointer(); -} - -void DreamGenContext::blank() { - STACK_CHECK; - _cmp(data.byte(kCommandtype), 199); - if (flags.z()) - return /* (alreadyblnk) */; - data.byte(kCommandtype) = 199; - al = 0; - commandonly(); + printDirect(); } -void DreamGenContext::allpointer() { - STACK_CHECK; - readmouse(); - showpointer(); - dumppointer(); -} - -void DreamGenContext::hangonw() { - STACK_CHECK; -hangloopw: - push(cx); - delpointer(); - readmouse(); - animpointer(); - showpointer(); - vsync(); - dumppointer(); - cx = pop(); - if (--cx) - goto hangloopw; -} - -void DreamGenContext::hangoncurs() { - STACK_CHECK; -monloop1: - push(cx); - printcurs(); - vsync(); - delcurs(); - cx = pop(); - if (--cx) - goto monloop1; -} - -void DreamGenContext::getunderzoom() { - STACK_CHECK; - di = (8)+5; - bx = (132)+4; - ds = data.word(kBuffers); - si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); - cl = 46; - ch = 40; - multiget(); -} - -void DreamGenContext::dumpzoom() { - STACK_CHECK; - _cmp(data.byte(kZoomon), 1); - if (!flags.z()) - return /* (notzoomon) */; - di = (8)+5; - bx = (132)+4; - cl = 46; - ch = 40; - multidump(); -} - -void DreamGenContext::putunderzoom() { - STACK_CHECK; - di = (8)+5; - bx = (132)+4; - ds = data.word(kBuffers); - si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); - cl = 46; - ch = 40; - multiput(); -} - -void DreamGenContext::undertextline() { - STACK_CHECK; - di = data.word(kTextaddressx); - bx = data.word(kTextaddressy); - _cmp(data.byte(kForeignrelease), 0); - if (flags.z()) - goto _tmp1; - _sub(bx, 3); -_tmp1: - ds = data.word(kBuffers); - si = (0); - cl = (228); - ch = (13); - multiget(); -} - -void DreamGenContext::readkey() { - STACK_CHECK; - bx = data.word(kBufferout); - _cmp(bx, data.word(kBufferin)); - if (flags.z()) - goto nokey; - _inc(bx); - _and(bx, 15); - data.word(kBufferout) = bx; - di = offset_keybuffer; - _add(di, bx); - al = cs.byte(di); - data.byte(kCurrentkey) = al; - return; -nokey: - data.byte(kCurrentkey) = 0; -} - -void DreamGenContext::randomnum1() { - STACK_CHECK; - push(ds); - push(es); - push(di); - push(bx); - push(cx); - randomnumber(); - cx = pop(); - bx = pop(); - di = pop(); - es = pop(); - ds = pop(); -} - -void DreamGenContext::randomnum2() { - STACK_CHECK; - push(ds); - push(es); - push(di); - push(bx); - push(ax); - randomnumber(); - cl = al; - ax = pop(); - bx = pop(); - di = pop(); - es = pop(); - ds = pop(); -} - -void DreamGenContext::loadtraveltext() { - STACK_CHECK; - dx = 2234; - standardload(); - data.word(kTraveltext) = ax; -} - -void DreamGenContext::loadintotemp() { - STACK_CHECK; - ds = cs; - standardload(); - data.word(kTempgraphics) = ax; -} - -void DreamGenContext::loadintotemp2() { - STACK_CHECK; - ds = cs; - standardload(); - data.word(kTempgraphics2) = ax; -} - -void DreamGenContext::loadintotemp3() { - STACK_CHECK; - ds = cs; - standardload(); - data.word(kTempgraphics3) = ax; -} - -void DreamGenContext::loadtempcharset() { - STACK_CHECK; - standardload(); - data.word(kTempcharset) = ax; -} - -void DreamGenContext::standardload() { - STACK_CHECK; - openfile(); - readheader(); - bx = es.word(di); - push(bx); - cl = 4; - _shr(bx, cl); - allocatemem(); - ds = ax; - cx = pop(); - push(ax); - dx = 0; - readfromfile(); - closefile(); - ax = pop(); -} - -void DreamGenContext::loadtemptext() { - STACK_CHECK; - standardload(); - data.word(kTextfile1) = ax; -} - -void DreamGenContext::loadroom() { - STACK_CHECK; - data.byte(kRoomloaded) = 1; - data.word(kTimecount) = 0; - data.word(kMaintimer) = 0; - data.word(kMapoffsetx) = 104; - data.word(kMapoffsety) = 38; - data.word(kTextaddressx) = 13; - data.word(kTextaddressy) = 182; - data.byte(kTextlen) = 240; - al = data.byte(kNewlocation); - data.byte(kLocation) = al; - getroomdata(); - startloading(); - loadroomssample(); - switchryanon(); - drawflags(); - getdimension(); -} - -void DreamGenContext::loadroomssample() { - STACK_CHECK; - al = data.byte(kRoomssample); - _cmp(al, 255); - if (flags.z()) - return /* (loadedalready) */; - _cmp(al, data.byte(kCurrentsample)); - if (flags.z()) - return /* (loadedalready) */; - data.byte(kCurrentsample) = al; - al = data.byte(kCurrentsample); - cl = '0'; - twodigitnum(); - di = 1896; - _xchg(al, ah); - cs.word(di+10) = ax; - dx = di; - loadsecondsample(); -} - -void DreamGenContext::getridofreels() { - STACK_CHECK; - _cmp(data.byte(kRoomloaded), 0); - if (flags.z()) - return /* (dontgetrid) */; - es = data.word(kReel1); - deallocatemem(); - es = data.word(kReel2); - deallocatemem(); - es = data.word(kReel3); - deallocatemem(); -} - -void DreamGenContext::getridofall() { - STACK_CHECK; - es = data.word(kBackdrop); - deallocatemem(); - es = data.word(kSetframes); - deallocatemem(); - es = data.word(kReel1); - deallocatemem(); - es = data.word(kReel2); - deallocatemem(); - es = data.word(kReel3); - deallocatemem(); - es = data.word(kReels); - deallocatemem(); - es = data.word(kPeople); - deallocatemem(); - es = data.word(kSetdesc); - deallocatemem(); - es = data.word(kBlockdesc); - deallocatemem(); - es = data.word(kRoomdesc); - deallocatemem(); - es = data.word(kFreeframes); - deallocatemem(); - es = data.word(kFreedesc); - deallocatemem(); -} - -void DreamGenContext::restorereels() { - STACK_CHECK; - _cmp(data.byte(kRoomloaded), 0); - if (flags.z()) - return /* (dontrestore) */; - al = data.byte(kReallocation); - getroomdata(); - dx = bx; - openfile(); - readheader(); - dontloadseg(); - dontloadseg(); - dontloadseg(); - dontloadseg(); - allocateload(); - data.word(kReel1) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kReel2) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kReel3) = ax; - ds = ax; - dx = 0; - loadseg(); - closefile(); -} - -void DreamGenContext::restoreall() { - STACK_CHECK; - al = data.byte(kLocation); - getroomdata(); - dx = bx; - openfile(); - readheader(); - allocateload(); - ds = ax; - data.word(kBackdrop) = ax; - dx = (0); - loadseg(); - ds = data.word(kWorkspace); - dx = (0); - cx = 132*66; - al = 0; - fillspace(); - loadseg(); - sortoutmap(); - allocateload(); - data.word(kSetframes) = ax; - ds = ax; - dx = (0); - loadseg(); - dontloadseg(); - allocateload(); - data.word(kReel1) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kReel2) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kReel3) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kReels) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kPeople) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kSetdesc) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kBlockdesc) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kRoomdesc) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kFreeframes) = ax; - ds = ax; - dx = 0; - loadseg(); - dontloadseg(); - allocateload(); - data.word(kFreedesc) = ax; - ds = ax; - dx = (0); - loadseg(); - closefile(); - setallchanges(); -} - -void DreamGenContext::sortoutmap() { - STACK_CHECK; - push(es); - push(di); - ds = data.word(kWorkspace); - si = 0; - es = data.word(kMapdata); - di = 0; - cx = (60); -blimey: - push(cx); - push(si); - cx = (66); - _movsb(cx, true); - si = pop(); - cx = pop(); - _add(si, 132); - if (--cx) - goto blimey; - di = pop(); - es = pop(); -} - -void DreamGenContext::disablepath() { - STACK_CHECK; - push(cx); - _xchg(al, ah); - cx = -6; -looky2: - _add(cx, 6); - _sub(al, 10); - if (!flags.c()) - goto looky2; - al = ah; - _dec(cx); -lookx2: - _inc(cx); - _sub(al, 11); - if (!flags.c()) - goto lookx2; - al = cl; - ah = 0; - cx = 144; - _mul(cx); - es = data.word(kReels); - bx = (0); - _add(bx, ax); - ax = pop(); - ah = 0; - _add(ax, ax); - _add(ax, ax); - _add(ax, ax); - _add(bx, ax); - al = 0; - es.byte(bx+6) = al; -} - -void DreamGenContext::findroominloc() { - STACK_CHECK; - al = data.byte(kMapy); - cx = -6; -looky: - _add(cx, 6); - _sub(al, 10); - if (!flags.c()) - goto looky; - al = data.byte(kMapx); - _dec(cx); -lookx: - _inc(cx); - _sub(al, 11); - if (!flags.c()) - goto lookx; - data.byte(kRoomnum) = cl; -} - -void DreamGenContext::allocateload() { - STACK_CHECK; - push(es); - push(di); - bx = es.word(di); - cl = 4; - _shr(bx, cl); - allocatemem(); - di = pop(); - es = pop(); -} - -void DreamGenContext::getridoftemp() { - STACK_CHECK; - es = data.word(kTempgraphics); - deallocatemem(); -} - -void DreamGenContext::getridoftemptext() { - STACK_CHECK; - es = data.word(kTextfile1); - deallocatemem(); -} - -void DreamGenContext::getridoftemp2() { - STACK_CHECK; - es = data.word(kTempgraphics2); - deallocatemem(); -} - -void DreamGenContext::getridoftemp3() { - STACK_CHECK; - es = data.word(kTempgraphics3); - deallocatemem(); -} - -void DreamGenContext::getridoftempcharset() { - STACK_CHECK; - es = data.word(kTempcharset); - deallocatemem(); -} - -void DreamGenContext::getridoftempsp() { - STACK_CHECK; - es = data.word(kTempsprites); - deallocatemem(); -} - -void DreamGenContext::readsetdata() { - STACK_CHECK; - dx = 1857; - standardload(); - data.word(kCharset1) = ax; - dx = 1922; - standardload(); - data.word(kIcons1) = ax; - dx = 1935; - standardload(); - data.word(kIcons2) = ax; - dx = 1819; - standardload(); - data.word(kMainsprites) = ax; - dx = 2221; - standardload(); - data.word(kPuzzletext) = ax; - dx = 2273; - standardload(); - data.word(kCommandtext) = ax; - ax = data.word(kCharset1); - data.word(kCurrentset) = ax; - _cmp(data.byte(kSoundint), 255); - if (flags.z()) - return /* (novolumeload) */; - dx = 2286; - openfile(); - cx = 2048-256; - ds = data.word(kSoundbuffer); - dx = 16384; - readfromfile(); - closefile(); -} - - - void DreamGenContext::__start() { static const uint8 src[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x13, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15618,14 +5531,14 @@ void DreamGenContext::__start() { //0x0090: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x00a0: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, //0x00b0: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x00c0: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x00d0: .... .... .... .... - 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x00e0: .. .... .... .... + 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + //0x00e0: .. .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x00f0: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -15640,1690 +5553,141 @@ void DreamGenContext::__start() { //0x0140: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0150: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0160: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, //0x0170: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //0x0180: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //0x0190: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x01a0: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x01b0: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x01c0: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x01d0: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x01e0: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x01f0: .... .... .... .... - 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0200: .... .... .... .... - 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x14, 0x00, 0x02, 0x00, 0x01, 0x01, 0x37, - //0x0210: .... ..., .... ...7 - 0x00, 0x00, 0x00, 0x32, 0x14, 0x00, 0x18, 0x16, 0x00, 0x4a, 0x00, 0x01, 0x00, 0x00, 0x18, 0x21, - //0x0220: ...2 .... .J.. ...! - 0x0a, 0x4b, 0x00, 0x01, 0x00, 0x01, 0x01, 0x2c, 0x00, 0x1b, 0x00, 0x02, 0x00, 0x02, 0x01, 0x2c, - //0x0230: .K.. ..., .... ..., - 0x00, 0x60, 0x00, 0x03, 0x00, 0x04, 0x01, 0x2c, 0x00, 0x76, 0x00, 0x02, 0x00, 0x05, 0x01, 0x2c, - //0x0240: .`.. ..., .v.. ..., - 0x0a, 0x00, 0x00, 0x02, 0x00, 0x00, 0x05, 0x16, 0x14, 0x35, 0x00, 0x03, 0x00, 0x00, 0x05, 0x16, - //0x0250: .... .... .5.. .... - 0x14, 0x28, 0x00, 0x01, 0x00, 0x02, 0x05, 0x16, 0x14, 0x32, 0x00, 0x01, 0x00, 0x03, 0x02, 0x0b, - //0x0260: .(.. .... .2.. .... - 0x0a, 0xc0, 0x00, 0x01, 0x00, 0x00, 0x02, 0x0b, 0x0a, 0xb6, 0x00, 0x02, 0x00, 0x01, 0x08, 0x0b, - //0x0270: .... .... .... .... - 0x0a, 0x00, 0x00, 0x02, 0x00, 0x01, 0x17, 0x00, 0x32, 0x00, 0x00, 0x03, 0x00, 0x00, 0x1c, 0x0b, - //0x0280: .... .... 2... .... - 0x14, 0xfa, 0x00, 0x04, 0x00, 0x00, 0x17, 0x00, 0x32, 0x2b, 0x00, 0x02, 0x00, 0x08, 0x17, 0x0b, - //0x0290: .... .... 2+.. .... - 0x28, 0x82, 0x00, 0x02, 0x00, 0x01, 0x17, 0x16, 0x28, 0x7a, 0x00, 0x02, 0x00, 0x02, 0x17, 0x16, - //0x02a0: (... .... (z.. .... - 0x28, 0x69, 0x00, 0x02, 0x00, 0x03, 0x17, 0x16, 0x28, 0x51, 0x00, 0x02, 0x00, 0x04, 0x17, 0x0b, - //0x02b0: (i.. .... (Q.. .... - 0x28, 0x87, 0x00, 0x02, 0x00, 0x05, 0x17, 0x16, 0x28, 0x91, 0x00, 0x02, 0x00, 0x06, 0x04, 0x16, - //0x02c0: (... .... (... .... - 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0xc8, 0x00, 0x00, 0x00, 0x14, 0x2d, 0x16, - //0x02d0: .... ..-. .... ..-. - 0x1e, 0x27, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0x19, 0x00, 0x02, 0x00, 0x00, 0x08, 0x16, - //0x02e0: .'.. ..-. .... .... - 0x28, 0x20, 0x00, 0x02, 0x00, 0x00, 0x07, 0x0b, 0x14, 0x40, 0x00, 0x02, 0x00, 0x00, 0x16, 0x16, - //0x02f0: ( .. .... .@.. .... - 0x14, 0x52, 0x00, 0x02, 0x00, 0x00, 0x1b, 0x0b, 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x14, 0x00, - //0x0300: .R.. .... .... .... - 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x21, 0x28, 0x15, 0x00, 0x01, 0x00, 0x00, 0x1d, 0x0b, - //0x0310: .... ...! (... .... - 0x0a, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x16, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x19, 0x00, - //0x0320: .... .... .... .... - 0x32, 0x04, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x1e, 0x79, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, - //0x0330: 2... ..2. .y.. ..2. - 0x1e, 0x00, 0x00, 0x14, 0x00, 0x00, 0x34, 0x16, 0x1e, 0xc0, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, - //0x0340: .... ..4. .... ..4. - 0x1e, 0xe9, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x68, 0x00, 0x37, 0x00, 0x00, 0x35, 0x21, - //0x0350: .... ..2. (h.7 ..5! - 0x00, 0x63, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x00, 0x00, 0x03, 0x00, 0x00, 0x32, 0x16, - //0x0360: .c.. ..2. (... ..2. - 0x1e, 0xa2, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, 0x1e, 0x39, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, - //0x0370: .... ..4. .9.. ..4. - 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x36, 0x00, 0x00, 0x48, 0x00, 0x03, 0x00, 0x00, 0x37, 0x2c, - //0x0380: .... ..6. .H.. ..7, - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x0e, 0x16, - //0x0390: .... .... .... .... - 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x16, 0x00, 0x2c, 0x01, 0x01, 0x00, 0x00, 0x0a, 0x16, - //0x03a0: .... .... .,.. .... - 0x1e, 0xae, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x16, 0x14, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x0b, - //0x03b0: .... .... .... .... - 0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0b, 0x0b, 0x1e, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0b, 0x16, - //0x03c0: ...2 .... ...2 .... - 0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0e, 0x21, 0x28, 0x00, 0x00, 0x32, 0x14, 0x00, 0xff, 0x7c, - //0x03d0: ...2 ...! (..2 ...| - 0xc0, 0x80, 0xc0, 0x1c, 0xc0, 0x20, 0xc0, 0x00, 0xc1, 0x10, 0xc0, 0x18, 0xc0, 0xf4, 0xc0, 0x0c, - //0x03e0: .... . .. .... .... - 0xc0, 0x24, 0xc0, 0x28, 0xc0, 0x2c, 0xc0, 0x30, 0xc0, 0x54, 0xc0, 0x78, 0xc0, 0x50, 0xc0, 0x74, - //0x03f0: .$.( .,.0 .T.x .P.t - 0xc0, 0x34, 0xc0, 0x38, 0xc0, 0x40, 0xc0, 0x44, 0xc0, 0x48, 0xc0, 0x3c, 0xc0, 0x14, 0xc0, 0x88, - //0x0400: .4.8 .@.D .H.< .... - 0xc0, 0x8c, 0xc0, 0x90, 0xc0, 0x70, 0xc0, 0xfc, 0xc0, 0x6c, 0xc0, 0x58, 0xc0, 0x68, 0xc0, 0x04, - //0x0410: .... .p.. .l.X .h.. - 0xc1, 0x64, 0xc0, 0x60, 0xc0, 0x5c, 0xc0, 0x94, 0xc0, 0x04, 0xc0, 0xa4, 0xc0, 0x9c, 0xc0, 0xa0, - //0x0420: .d.` .... .... .... - 0xc0, 0xa8, 0xc0, 0xac, 0xc0, 0x98, 0xc0, 0xb0, 0xc0, 0xb4, 0xc0, 0xc8, 0xc0, 0xcc, 0xc0, 0xd4, - //0x0430: .... .... .... .... - 0xc0, 0xdc, 0xc0, 0xd8, 0xc0, 0x00, 0xc0, 0x08, 0xc0, 0x84, 0xc0, 0x84, 0xc0, 0x84, 0xc0, 0x84, - //0x0440: .... .... .... .... - 0xc0, 0x00, 0x3c, 0x21, 0x47, 0x0b, 0x52, 0x16, 0x5d, 0x01, 0x2c, 0x0a, 0x10, 0x04, 0x0b, 0x1e, - //0x0450: ..<! G.R. ].,. .... - 0x0e, 0x04, 0x16, 0x1e, 0x0e, 0x03, 0x21, 0x0a, 0x0e, 0x0a, 0x21, 0x1e, 0x0e, 0x0a, 0x16, 0x1e, - //0x0460: .... ..!. ..!. .... - 0x18, 0x09, 0x16, 0x0a, 0x0e, 0x02, 0x21, 0x00, 0x0e, 0x02, 0x16, 0x00, 0x0e, 0x06, 0x0b, 0x1e, - //0x0470: .... ..!. .... .... - 0x0e, 0x07, 0x0b, 0x14, 0x12, 0x07, 0x00, 0x14, 0x12, 0x07, 0x00, 0x1e, 0x12, 0x37, 0x2c, 0x00, - //0x0480: .... .... .... .7,. - 0x0e, 0x05, 0x16, 0x1e, 0x0e, 0x08, 0x00, 0x0a, 0x12, 0x08, 0x0b, 0x0a, 0x12, 0x08, 0x16, 0x0a, - //0x0490: .... .... .... .... - 0x12, 0x08, 0x21, 0x0a, 0x12, 0x08, 0x21, 0x14, 0x12, 0x08, 0x21, 0x1e, 0x12, 0x08, 0x21, 0x28, - //0x04a0: ..!. ..!. ..!. ..!( - 0x12, 0x08, 0x16, 0x28, 0x12, 0x08, 0x0b, 0x28, 0x12, 0x15, 0x2c, 0x14, 0x12, 0xff, 0x2e, 0x05, - //0x04b0: ...( ...( ..,. .... - 0x2f, 0x05, 0x33, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x46, 0x05, 0x2e, 0x05, 0x4d, 0x05, - //0x04c0: /.3. .... ..F. ..M. - 0x5d, 0x05, 0x64, 0x05, 0x68, 0x05, 0x6c, 0x05, 0x70, 0x05, 0x7d, 0x05, 0x2e, 0x05, 0x2e, 0x05, - //0x04d0: ].d. h.l. p.}. .... - 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x9f, 0x05, 0x2e, 0x05, 0xb5, 0x05, 0xd4, 0x05, 0x2e, 0x05, - //0x04e0: .... .... .... .... - 0xe1, 0x05, 0xf7, 0x05, 0x0d, 0x06, 0x26, 0x06, 0x39, 0x06, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, - //0x04f0: .... ..&. 9... .... - 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, - //0x0500: .... .... .... .... - 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x49, 0x06, 0x50, 0x06, 0x75, 0x06, 0x2e, 0x05, - //0x0510: .... .... I.P. u... - 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x82, 0x06, 0x86, 0x06, 0x2e, 0x05, 0x8d, 0x06, 0xff, 0x0f, - //0x0520: .... .... .... .... - 0x01, 0x01, 0xff, 0x0c, 0x05, 0x00, 0x0d, 0x15, 0x00, 0x0f, 0x23, 0x00, 0x11, 0x32, 0x00, 0x12, - //0x0530: .... .... ..#. .2.. - 0x67, 0x00, 0x13, 0x6c, 0x00, 0xff, 0x12, 0x13, 0x00, 0x13, 0x17, 0x00, 0xff, 0x0c, 0x33, 0x00, - //0x0540: g..l .... .... ..3. - 0x0d, 0x35, 0x00, 0x0e, 0x0e, 0x00, 0x0f, 0x14, 0x00, 0x00, 0x4e, 0x00, 0xff, 0x0c, 0x77, 0x00, - //0x0550: .5.. .... ..N. ..w. - 0x0c, 0x91, 0x00, 0xff, 0x0d, 0x10, 0x00, 0xff, 0x0d, 0x14, 0x00, 0xff, 0x0e, 0x10, 0x00, 0xff, - //0x0560: .... .... .... .... - 0x0f, 0x04, 0x00, 0x10, 0x08, 0x00, 0x11, 0x86, 0x00, 0x12, 0x99, 0x00, 0xff, 0x0d, 0x6c, 0x00, - //0x0570: .... .... .... ..l. - 0x0f, 0x46, 0x01, 0x0f, 0x4b, 0x01, 0x0f, 0x50, 0x01, 0x0f, 0x56, 0x01, 0x0f, 0x5c, 0x01, 0x0f, - //0x0580: .F.. K..P ..V. .... - 0x62, 0x01, 0x12, 0x9f, 0x00, 0x12, 0xb2, 0x00, 0x93, 0xd9, 0x00, 0x54, 0xe4, 0x00, 0xff, 0x0d, - //0x0590: b... .... ...T .... - 0x14, 0x00, 0x0d, 0x15, 0x00, 0x0f, 0x22, 0x00, 0x0d, 0x34, 0x00, 0x0d, 0x37, 0x00, 0x19, 0x39, - //0x05a0: .... ..". .4.. 7..9 - 0x00, 0x15, 0x49, 0x00, 0xff, 0x0d, 0xc4, 0x00, 0x0d, 0xea, 0x00, 0x0d, 0x9c, 0x00, 0x0e, 0x81, - //0x05b0: ..I. .... .... .... - 0x00, 0x0d, 0x7c, 0x00, 0x0f, 0xa2, 0x00, 0x0f, 0xc8, 0x00, 0x0f, 0xef, 0x00, 0x11, 0x63, 0x00, - //0x05c0: ..|. .... .... ..c. - 0x0c, 0x34, 0x00, 0xff, 0x0f, 0x38, 0x00, 0x10, 0x40, 0x00, 0x13, 0x16, 0x00, 0x14, 0x21, 0x00, - //0x05d0: .4.. .8.. @... ..!. - 0xff, 0x14, 0x0b, 0x00, 0x14, 0x0f, 0x00, 0x0f, 0x1c, 0x00, 0x0d, 0x50, 0x00, 0x15, 0x52, 0x00, - //0x05e0: .... .... ...P ..R. - 0x93, 0x57, 0x00, 0x57, 0x80, 0x00, 0xff, 0x0c, 0x0d, 0x00, 0x0e, 0x27, 0x00, 0x0c, 0x43, 0x00, - //0x05f0: .W.W .... ...' ..C. - 0x0c, 0x4b, 0x00, 0x0c, 0x53, 0x00, 0x0c, 0x5b, 0x00, 0x0f, 0x66, 0x00, 0xff, 0x16, 0x24, 0x00, - //0x0600: .K.. S..[ ..f. ..$. - 0x0d, 0x7d, 0x00, 0x12, 0x58, 0x00, 0x0f, 0x6b, 0x00, 0x0e, 0x7f, 0x00, 0x0e, 0x9a, 0x00, 0x93, - //0x0610: .}.. X..k .... .... - 0xaa, 0x00, 0x57, 0xe8, 0x00, 0xff, 0x15, 0x10, 0x00, 0x15, 0x48, 0x00, 0x15, 0xcd, 0x00, 0x16, - //0x0620: ..W. .... ..H. .... - 0x3f, 0x00, 0x97, 0x63, 0x00, 0x58, 0x9e, 0x00, 0xff, 0x0d, 0x15, 0x00, 0x0e, 0x18, 0x00, 0x93, - //0x0630: ?..c .X.. .... .... - 0x32, 0x00, 0x57, 0x4b, 0x00, 0x18, 0x80, 0x00, 0xff, 0x53, 0x2e, 0x00, 0x10, 0xa7, 0x00, 0xff, - //0x0640: 2.WK .... .S.. .... - 0x10, 0x13, 0x00, 0x0e, 0x24, 0x00, 0x10, 0x32, 0x00, 0x0e, 0x41, 0x00, 0x10, 0x51, 0x00, 0x0e, - //0x0650: .... $..2 ..A. .Q.. - 0x60, 0x00, 0x10, 0x72, 0x00, 0x0e, 0x81, 0x00, 0x10, 0x93, 0x00, 0x0e, 0xa2, 0x00, 0x10, 0xb1, - //0x0660: `..r .... .... .... - 0x00, 0x0e, 0xbf, 0x00, 0xff, 0x0d, 0x30, 0x00, 0x0e, 0x29, 0x00, 0x0f, 0x4e, 0x00, 0x10, 0x5c, - //0x0670: .... ..0. .).. N... - 0x00, 0xff, 0x10, 0x73, 0x00, 0xff, 0x15, 0x67, 0x00, 0x14, 0xc7, 0x00, 0xff, 0x11, 0x35, 0x00, - //0x0680: ...s ...g .... ..5. - 0x11, 0x36, 0x00, 0x11, 0x37, 0x00, 0x11, 0x38, 0x00, 0x11, 0x39, 0x00, 0x11, 0x3a, 0x00, 0x11, - //0x0690: .6.. 7..8 ..9. .:.. - 0x3b, 0x00, 0x11, 0x3d, 0x00, 0x11, 0x3f, 0x00, 0x11, 0x40, 0x00, 0x11, 0x41, 0x00, 0xff, 0x9c, - //0x06a0: ;..= ..?. .@.. A... - 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, - //0x06b0: .... .... .... .... - 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, - //0x06c0: .... .... .... .... - 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, - //0x06d0: .... .... .... .... - 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, - //0x06e0: .... .... .... .... - 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, - //0x06f0: .... .... .... .... - 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, - //0x0700: .... .... .... .... - 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9c, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x0710: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x53, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, - //0x0720: WEB. S00. DREA MWEB - 0x2e, 0x53, 0x30, 0x32, 0x00, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x2e, 0x44, 0x41, 0x54, - //0x0730: .S02 .INS TALL .DAT - 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x30, 0x00, 0x44, 0x52, - //0x0740: .DRE AMWE B.C0 0.DR - 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x0750: EAMW EB.C 01.D REAM - 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, - //0x0760: WEB. C02. DREA MWEB - 0x2e, 0x56, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x39, - //0x0770: .V00 .DRE AMWE B.V9 - 0x39, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x30, 0x00, 0x44, - //0x0780: 9.DR EAMW EB.G 00.D - 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, - //0x0790: REAM WEB. G01. DREA - 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, - //0x07a0: MWEB .G02 .DRE AMWE - 0x42, 0x2e, 0x47, 0x30, 0x38, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, - //0x07b0: B.G0 8.DR EAMW EB.G - 0x30, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x37, 0x00, - //0x07c0: 03.D REAM WEB. G07. - 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, - //0x07d0: DREA MWEB .G04 .DRE - 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, - //0x07e0: AMWE B.G0 5.DR EAMW - 0x45, 0x42, 0x2e, 0x47, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, - //0x07f0: EB.G 06.D REAM WEB. - 0x47, 0x31, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x30, 0x31, - //0x0800: G14. DREA MWEB .T01 - 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x30, 0x32, 0x00, 0x44, 0x52, - //0x0810: .DRE AMWE B.T0 2.DR - 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x0820: EAMW EB.T 10.D REAM - 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, - //0x0830: WEB. T11. DREA MWEB - 0x2e, 0x54, 0x31, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, - //0x0840: .T12 .DRE AMWE B.T1 - 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x30, 0x00, 0x44, - //0x0850: 3.DR EAMW EB.T 20.D - 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, - //0x0860: REAM WEB. T21. DREA - 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, - //0x0870: MWEB .T22 .DRE AMWE - 0x42, 0x2e, 0x54, 0x32, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, - //0x0880: B.T2 3.DR EAMW EB.T - 0x32, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x35, 0x30, 0x00, - //0x0890: 24.D REAM WEB. T50. - 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x35, 0x31, 0x00, 0x44, 0x52, 0x45, - //0x08a0: DREA MWEB .T51 .DRE - 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, - //0x08b0: AMWE B.T8 0.DR EAMW - 0x45, 0x42, 0x2e, 0x54, 0x38, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, - //0x08c0: EB.T 81.D REAM WEB. - 0x54, 0x38, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x33, - //0x08d0: T82. DREA MWEB .T83 - 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x34, 0x00, 0x44, 0x52, - //0x08e0: .DRE AMWE B.T8 4.DR - 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x4f, 0x4c, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x08f0: EAMW EB.V OL.D REAM - 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x39, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, - //0x0900: WEB. G09. DREA MWEB - 0x2e, 0x47, 0x31, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, - //0x0910: .G10 .DRE AMWE B.G1 - 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x32, 0x00, 0x44, - //0x0920: 1.DR EAMW EB.G 12.D - 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, - //0x0930: REAM WEB. G13. DREA - 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, - //0x0940: MWEB .G15 .DRE AMWE - 0x42, 0x2e, 0x49, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, - //0x0950: B.I0 0.DR EAMW EB.I - 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x32, 0x00, - //0x0960: 01.D REAM WEB. I02. - 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x33, 0x00, 0x44, 0x52, 0x45, - //0x0970: DREA MWEB .I03 .DRE - 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, - //0x0980: AMWE B.I0 4.DR EAMW - 0x45, 0x42, 0x2e, 0x49, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, - //0x0990: EB.I 05.D REAM WEB. - 0x49, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x37, - //0x09a0: I06. DREA MWEB .I07 - 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x50, 0x41, 0x4c, 0x00, 0x11, 0x01, - //0x09b0: .DRE AMWE B.PA L... - 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x44, 0xc3, 0x04, 0x01, 0x2c, 0x01, 0x00, 0x00, 0x2c, 0x00, - //0x09c0: @... ..D. ..,. ..,. - 0x80, 0xc5, 0xd2, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x2c, 0x00, 0xdc, 0xc3, 0x90, 0x00, 0xb0, 0x00, - //0x09d0: .... .... ,... .... - 0x40, 0x00, 0x60, 0x00, 0x80, 0xc3, 0x00, 0x00, 0x32, 0x00, 0x32, 0x00, 0xc8, 0x00, 0x84, 0xc3, - //0x09e0: @.`. .... 2.2. .... - 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, - //0x09f0: ..@. .... .... ..@. - 0x9d, 0x00, 0xc6, 0x00, 0x44, 0xc3, 0xff, 0x00, 0x26, 0x01, 0x00, 0x00, 0x18, 0x00, 0xc8, 0xc3, - //0x0a00: .... D... &... .... - 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x48, 0xc3, 0x50, 0x00, 0x00, 0x01, 0x9e, 0x00, - //0x0a10: ..-. (.8. H.P. .... - 0xca, 0x00, 0xe0, 0xc3, 0x50, 0x00, 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0x98, 0xc3, 0x00, 0x00, - //0x0a20: .... P.,. :... .... - 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, - //0x0a30: @... .... .... @... - 0xc6, 0x00, 0x44, 0xc3, 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x48, 0xc3, 0x50, 0x00, - //0x0a40: ..D. ..-. (.8. H.P. - 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0xbc, 0xc6, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, - //0x0a50: ,.:. .... ..@. .... - 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0xf0, 0x00, - //0x0a60: .... ..@. .... |... - 0x22, 0x01, 0x02, 0x00, 0x2c, 0x00, 0x94, 0xc4, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, - //0x0a70: "... ,... ..@. .... - 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0x00, 0x00, - //0x0a80: .... ..@. .... |... - 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xee, 0x00, 0x02, 0x01, 0x04, 0x00, - //0x0a90: @... .... .... .... - 0x2c, 0x00, 0xc8, 0xc4, 0x68, 0x00, 0x7c, 0x00, 0x04, 0x00, 0x2c, 0x00, 0xcc, 0xc4, 0x18, 0x01, - //0x0aa0: ,... h.|. ..,. .... - 0x34, 0x01, 0x04, 0x00, 0x2c, 0x00, 0xb0, 0xc4, 0x68, 0x00, 0xd8, 0x00, 0x8a, 0x00, 0xc0, 0x00, - //0x0ab0: 4... ,... h... .... - 0xd0, 0xc4, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0x00, 0x00, 0x40, 0x01, - //0x0ac0: .... @... ..|. ..@. - 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x45, 0x58, 0x49, 0x54, 0x20, 0x20, 0x20, 0x20, - //0x0ad0: .... .... EXIT - 0x20, 0x20, 0x48, 0x45, 0x4c, 0x50, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x49, 0x53, 0x54, - //0x0ae0: HE LP LIST - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x45, 0x41, 0x44, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - //0x0af0: RE AD - 0x4c, 0x4f, 0x47, 0x4f, 0x4e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4b, 0x45, 0x59, 0x53, 0x20, 0x20, - //0x0b00: LOGO N KE YS - 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, - //0x0b10: ..PU BLIC - 0x20, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, - //0x0b20: PU BLIC ... - 0x42, 0x4c, 0x41, 0x43, 0x4b, 0x44, 0x52, 0x41, 0x47, 0x4f, 0x4e, 0x20, 0x52, 0x59, 0x41, 0x4e, - //0x0b30: BLAC KDRA GON RYAN - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x48, 0x45, 0x4e, 0x44, 0x52, 0x49, - //0x0b40: . ..HE NDRI - 0x58, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x4f, 0x55, 0x49, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, - //0x0b50: X LO UIS - 0x20, 0x00, 0x00, 0x00, 0x53, 0x45, 0x50, 0x54, 0x49, 0x4d, 0x55, 0x53, 0x20, 0x20, 0x20, 0x20, - //0x0b60: ... SEPT IMUS - 0x42, 0x45, 0x43, 0x4b, 0x45, 0x54, 0x54, 0x20, 0x20, 0x20, 0x20, 0x00, 0xff, 0xff, 0x20, 0x20, - //0x0b70: BECK ETT . .. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x52, 0x4f, 0x4f, - //0x0b80: . "ROO - 0x54, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, - //0x0b90: T ." - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x4e, 0x45, 0x54, 0x57, 0xe8, 0xc4, 0x45, 0x4c, - //0x0ba0: . NETW ..EL - 0x56, 0x41, 0x8c, 0xc6, 0x45, 0x4c, 0x56, 0x42, 0x9c, 0xc6, 0x45, 0x4c, 0x56, 0x43, 0x94, 0xc6, - //0x0bb0: VA.. ELVB ..EL VC.. - 0x45, 0x4c, 0x56, 0x45, 0x98, 0xc6, 0x45, 0x4c, 0x56, 0x46, 0xa0, 0xc6, 0x43, 0x47, 0x41, 0x54, - //0x0bc0: ELVE ..EL VF.. CGAT - 0x30, 0xc7, 0x52, 0x45, 0x4d, 0x4f, 0xa8, 0xc6, 0x42, 0x55, 0x54, 0x41, 0x3c, 0xc7, 0x43, 0x42, - //0x0bd0: 0.RE MO.. BUTA <.CB - 0x4f, 0x58, 0x44, 0xc7, 0x4c, 0x49, 0x54, 0x45, 0x5c, 0xc6, 0x50, 0x4c, 0x41, 0x54, 0x40, 0xc7, - //0x0be0: OXD. LITE ..PL AT@. - 0x4c, 0x49, 0x46, 0x54, 0x7c, 0xc6, 0x57, 0x49, 0x52, 0x45, 0x84, 0xc6, 0x48, 0x4e, 0x44, 0x4c, - //0x0bf0: LIFT |.WI RE.. HNDL - 0x88, 0xc6, 0x48, 0x41, 0x43, 0x48, 0x80, 0xc6, 0x44, 0x4f, 0x4f, 0x52, 0xb4, 0xc6, 0x43, 0x53, - //0x0c00: ..HA CH.. DOOR ..CS - 0x48, 0x52, 0x70, 0xc6, 0x47, 0x55, 0x4e, 0x41, 0x34, 0xc7, 0x43, 0x52, 0x41, 0x41, 0x64, 0xc6, - //0x0c10: HRp. GUNA 4.CR AAd. - 0x43, 0x52, 0x42, 0x42, 0x68, 0xc6, 0x43, 0x52, 0x43, 0x43, 0x6c, 0xc6, 0x53, 0x45, 0x41, 0x54, - //0x0c20: CRBB h.CR CCl. SEAT - 0xf8, 0xc5, 0x4d, 0x45, 0x4e, 0x55, 0x98, 0xc7, 0x43, 0x4f, 0x4f, 0x4b, 0xac, 0xc6, 0x45, 0x4c, - //0x0c30: ..ME NU.. COOK ..EL - 0x43, 0x41, 0x4c, 0xc6, 0x45, 0x44, 0x43, 0x41, 0x50, 0xc6, 0x44, 0x44, 0x43, 0x41, 0x54, 0xc6, - //0x0c40: CAL. EDCA P.DD CAT. - 0x41, 0x4c, 0x54, 0x52, 0x04, 0xc6, 0x4c, 0x4f, 0x4b, 0x41, 0x3c, 0xc6, 0x4c, 0x4f, 0x4b, 0x42, - //0x0c50: ALTR ..LO KA<. LOKB - 0x40, 0xc6, 0x45, 0x4e, 0x54, 0x41, 0x10, 0xc6, 0x45, 0x4e, 0x54, 0x42, 0x24, 0xc6, 0x45, 0x4e, - //0x0c60: @.EN TA.. ENTB $.EN - 0x54, 0x45, 0x28, 0xc6, 0x45, 0x4e, 0x54, 0x43, 0x18, 0xc6, 0x45, 0x4e, 0x54, 0x44, 0x2c, 0xc6, - //0x0c70: TE(. ENTC ..EN TD,. - 0x45, 0x4e, 0x54, 0x48, 0x30, 0xc6, 0x57, 0x57, 0x41, 0x54, 0xf0, 0xc5, 0x50, 0x4f, 0x4f, 0x4c, - //0x0c80: ENTH 0.WW AT.. POOL - 0x58, 0xc6, 0x57, 0x53, 0x48, 0x44, 0xf4, 0xc5, 0x47, 0x52, 0x41, 0x46, 0x44, 0xc6, 0x54, 0x52, - //0x0c90: X.WS HD.. GRAF D.TR - 0x41, 0x50, 0x48, 0xc6, 0x43, 0x44, 0x50, 0x45, 0x28, 0xc7, 0x44, 0x4c, 0x4f, 0x4b, 0x08, 0xc6, - //0x0ca0: APH. CDPE (.DL OK.. - 0x48, 0x4f, 0x4c, 0x45, 0x00, 0xc6, 0x44, 0x52, 0x59, 0x52, 0x0c, 0xc6, 0x48, 0x4f, 0x4c, 0x59, - //0x0cb0: HOLE ..DR YR.. HOLY - 0xfc, 0xc5, 0x57, 0x41, 0x4c, 0x4c, 0x2c, 0xc7, 0x42, 0x4f, 0x4f, 0x4b, 0x08, 0xc8, 0x41, 0x58, - //0x0cc0: ..WA LL,. BOOK ..AX - 0x45, 0x44, 0xb0, 0xc6, 0x53, 0x48, 0x4c, 0x44, 0x38, 0xc7, 0x42, 0x43, 0x4e, 0x59, 0xe8, 0xc5, - //0x0cd0: ED.. SHLD 8.BC NY.. - 0x4c, 0x49, 0x44, 0x43, 0xe4, 0xc5, 0x4c, 0x49, 0x44, 0x55, 0xe0, 0xc5, 0x4c, 0x49, 0x44, 0x4f, - //0x0ce0: LIDC ..LI DU.. LIDO - 0xec, 0xc5, 0x50, 0x49, 0x50, 0x45, 0xa8, 0xc5, 0x42, 0x41, 0x4c, 0x43, 0x20, 0xc6, 0x57, 0x49, - //0x0cf0: ..PI PE.. BALC .WI - 0x4e, 0x44, 0x1c, 0xc6, 0x50, 0x41, 0x50, 0x52, 0xb4, 0xc7, 0x55, 0x57, 0x54, 0x41, 0xa0, 0xc5, - //0x0d00: ND.. PAPR ..UW TA.. - 0x55, 0x57, 0x54, 0x42, 0xa0, 0xc5, 0x53, 0x54, 0x41, 0x54, 0xd8, 0xc7, 0x54, 0x4c, 0x49, 0x44, - //0x0d10: UWTB ..ST AT.. TLID - 0x9c, 0xc5, 0x53, 0x4c, 0x41, 0x42, 0xd8, 0xc5, 0x43, 0x41, 0x52, 0x54, 0xdc, 0xc5, 0x46, 0x43, - //0x0d20: ..SL AB.. CART ..FC - 0x41, 0x52, 0xac, 0xc5, 0x53, 0x4c, 0x42, 0x41, 0xc0, 0xc5, 0x53, 0x4c, 0x42, 0x42, 0xc4, 0xc5, - //0x0d30: AR.. SLBA ..SL BB.. - 0x53, 0x4c, 0x42, 0x43, 0xcc, 0xc5, 0x53, 0x4c, 0x42, 0x44, 0xc8, 0xc5, 0x53, 0x4c, 0x42, 0x45, - //0x0d40: SLBC ..SL BD.. SLBE - 0xd0, 0xc5, 0x53, 0x4c, 0x42, 0x46, 0xd4, 0xc5, 0x50, 0x4c, 0x49, 0x4e, 0xb0, 0xc5, 0x4c, 0x41, - //0x0d50: ..SL BF.. PLIN ..LA - 0x44, 0x44, 0xb8, 0xc5, 0x4c, 0x41, 0x44, 0x42, 0xbc, 0xc5, 0x47, 0x55, 0x4d, 0x41, 0xb4, 0xc5, - //0x0d60: DD.. LADB ..GU MA.. - 0x53, 0x51, 0x45, 0x45, 0x88, 0xc5, 0x54, 0x41, 0x50, 0x50, 0x8c, 0xc5, 0x47, 0x55, 0x49, 0x54, - //0x0d70: SQEE ..TA PP.. GUIT - 0x90, 0xc5, 0x43, 0x4f, 0x4e, 0x54, 0x94, 0xc5, 0x42, 0x45, 0x4c, 0x4c, 0x98, 0xc5, 0x8c, 0x8c, - //0x0d80: ..CO NT.. BELL .... - 0x8c, 0x8c, 0x30, 0x30, 0x30, 0x30, 0x00, 0x30, 0x30, 0x00, 0x9d, 0x00, 0xb2, 0x00, 0x51, 0x00, - //0x0d90: ..00 00.0 0... ..Q. - 0x5e, 0x00, 0x58, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x5c, 0xc7, 0xc9, 0x00, - //0x0da0: ^.X. .... Q.^. .... - 0xde, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x60, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x5f, 0x00, 0x70, 0x00, - //0x0db0: ..Q. ^.`. .... _.p. - 0x64, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x5f, 0x00, 0x70, 0x00, 0x68, 0xc7, 0xc9, 0x00, 0xde, 0x00, - //0x0dc0: d... .._. p.h. .... - 0x5f, 0x00, 0x70, 0x00, 0x6c, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x71, 0x00, 0x82, 0x00, 0x70, 0xc7, - //0x0dd0: _.p. l... ..q. ..p. - 0xb3, 0x00, 0xc8, 0x00, 0x71, 0x00, 0x82, 0x00, 0x74, 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x71, 0x00, - //0x0de0: .... q... t... ..q. - 0x82, 0x00, 0x78, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x83, 0x00, 0x91, 0x00, 0x7c, 0xc7, 0xb3, 0x00, - //0x0df0: ..x. .... .... |... - 0xde, 0x00, 0x83, 0x00, 0x91, 0x00, 0x80, 0xc7, 0xdc, 0x00, 0xea, 0x00, 0x98, 0x00, 0xa6, 0x00, - //0x0e00: .... .... .... .... - 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xae, 0x00, - //0x0e10: P... @... .... .... - 0xbc, 0x00, 0x84, 0x00, 0x94, 0x00, 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, - //0x0e20: .... ..P. ..@. .... - 0xa0, 0xca, 0xff, 0xff, 0x18, 0x01, 0x40, 0x01, 0xa0, 0x00, 0xc8, 0x00, 0x50, 0xc7, 0x8f, 0x00, - //0x0e30: .... ..@. .... P... - 0x2c, 0x01, 0x06, 0x00, 0xc2, 0x00, 0xb8, 0xc7, 0x00, 0x00, 0x8f, 0x00, 0x06, 0x00, 0xc2, 0x00, - //0x0e40: ,... .... .... .... - 0xc0, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x68, 0x00, - //0x0e50: .... @... .... ..h. - 0x80, 0x00, 0x3a, 0x00, 0x48, 0x00, 0xdc, 0xc7, 0x40, 0x00, 0x74, 0x00, 0x4c, 0x00, 0x6a, 0x00, - //0x0e60: ..:. H... @.t. L.j. - 0xe0, 0xc7, 0x74, 0x00, 0xa8, 0x00, 0x4c, 0x00, 0x6a, 0x00, 0xe4, 0xc7, 0x40, 0x00, 0x74, 0x00, - //0x0e70: ..t. ..L. j... @.t. - 0x6a, 0x00, 0x88, 0x00, 0xe8, 0xc7, 0x74, 0x00, 0xa8, 0x00, 0x6a, 0x00, 0x88, 0x00, 0xec, 0xc7, - //0x0e80: j... ..t. ..j. .... - 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xba, 0x00, 0xca, 0x00, - //0x0e90: ..@. .... .... .... - 0x9d, 0x00, 0xad, 0x00, 0x1c, 0xc8, 0xf3, 0x00, 0x03, 0x01, 0x83, 0x00, 0x93, 0x00, 0x18, 0xc8, - //0x0ea0: .... .... .... .... - 0x0c, 0x01, 0x1c, 0x01, 0xa8, 0x00, 0xb8, 0x00, 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, - //0x0eb0: .... .... P... @... - 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, 0x80, 0x00, 0x34, 0xc8, - //0x0ec0: .... ..w. ..R. ..4. - 0x46, 0x00, 0x89, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x80, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x44, 0x00, - //0x0ed0: F... >.o. .... ..D. - 0x98, 0x00, 0x4c, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, - //0x0ee0: ..L. ..@. .... .... - 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x40, 0x00, - //0x0ef0: .... p... H... ..@. - 0x98, 0x00, 0x58, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, 0x00, 0x85, 0x00, 0x74, 0xc8, 0x00, 0x00, - //0x0f00: ..X. >... 8... t... - 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, - //0x0f10: @... .... ..w. ..R. - 0x80, 0x00, 0x44, 0xc8, 0x46, 0x00, 0x8b, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x50, 0xc8, 0xec, 0x00, - //0x0f20: ..D. F... >.o. P... - 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, - //0x0f30: ..p. ..H. ..@. .... - 0xa0, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0xbc, 0x00, - //0x0f40: .... .... p... H... - 0xfa, 0x00, 0x40, 0x00, 0x98, 0x00, 0x54, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, 0x00, 0x85, 0x00, - //0x0f50: ..@. ..T. >... 8... - 0x74, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x0d, 0x0a, - //0x0f60: t... @... .... .... - 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, - //0x0f70: ..Dr eamw eb h as a - 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, - //0x0f80: n Er ror: ..Un able - 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x20, 0x45, 0x78, 0x70, - //0x0f90: to allo cate Exp - 0x61, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x2e, 0x0d, 0x0a, 0x0d, - //0x0fa0: ande d Me mory .... - 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, - //0x0fb0: .$.. ..Dr eamw eb h - 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x53, 0x6f, - //0x0fc0: as a n Er ror: ..So - 0x75, 0x6e, 0x64, 0x20, 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x63, 0x61, 0x72, 0x64, - //0x0fd0: und Blas ter card - 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x61, 0x74, 0x20, 0x61, 0x64, - //0x0fe0: not fou nd a t ad - 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, 0x20, 0x48, 0x65, 0x78, 0x2e, 0x0d, 0x0a, - //0x0ff0: dres s 22 0 He x... - 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, - //0x1000: ..$. ...D ream web - 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x4f, - //0x1010: has an E rror :..O - 0x75, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x42, 0x61, 0x73, 0x65, 0x20, 0x4d, 0x65, 0x6d, 0x6f, 0x72, - //0x1020: ut o f Ba se M emor - 0x79, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, - //0x1030: y... ..$. ...D ream - 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, - //0x1040: web has an E rror - 0x3a, 0x0d, 0x0a, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x20, 0x44, 0x65, 0x61, 0x6c, 0x6c, 0x6f, - //0x1050: :..M emor y De allo - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x2e, 0x0d, - //0x1060: cati on p robl em.. - 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, - //0x1070: ...$ .... Drea mweb - 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, - //0x1080: has an Erro r:.. - 0x41, 0x74, 0x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x20, 0x35, 0x39, 0x30, 0x4b, 0x20, 0x6f, 0x66, - //0x1090: At l east 590 K of - 0x20, 0x62, 0x61, 0x73, 0x65, 0x20, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x20, 0x69, 0x73, 0x20, - //0x10a0: bas e me mory is - 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, - //0x10b0: requ ired .... .$.. - 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, - //0x10c0: ..Dr eamw eb h as a - 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, - //0x10d0: n Er ror: ..So und - 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, - //0x10e0: Blas ter not foun - 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x75, 0x70, 0x74, 0x20, 0x30, 0x0d, - //0x10f0: d on int erup t 0. - 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, - //0x1100: ...$ .... Drea mweb - 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, - //0x1110: has an Erro r:.. - 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, - //0x1120: Unab le t o se lect - 0x20, 0x45, 0x4d, 0x4d, 0x20, 0x70, 0x61, 0x67, 0x65, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, - //0x1130: EMM pag e... ..$. - 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, - //0x1140: ...D ream web has - 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x20, - //0x1150: an E rror :..F ile - 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x63, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, - //0x1160: not foun d.c. ...$ - 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x6c, 0x6f, 0x6f, 0x6b, 0x73, 0x20, 0x66, - //0x1170: Drea mweb loo ks f - 0x6f, 0x72, 0x20, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, - //0x1180: or S ound Bla ster - 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x0d, - //0x1190: inf orma tion in. - 0x0a, 0x74, 0x68, 0x65, 0x20, 0x42, 0x4c, 0x41, 0x53, 0x54, 0x45, 0x52, 0x20, 0x65, 0x6e, 0x76, - //0x11a0: .the BLA STER env - 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, - //0x11b0: iron ment var iabl - 0x65, 0x20, 0x28, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x41, 0x55, 0x54, 0x4f, 0x45, - //0x11c0: e (i n yo ur A UTOE - 0x58, 0x45, 0x43, 0x2e, 0x42, 0x41, 0x54, 0x29, 0x0d, 0x0a, 0x0d, 0x0a, 0x49, 0x66, 0x20, 0x74, - //0x11d0: XEC. BAT) .... If t - 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, - //0x11e0: his is n ot f ound - 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x37, 0x2c, 0x20, 0x44, 0x4d, 0x41, - //0x11f0: the n IR Q 7, DMA - 0x20, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x20, 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, - //0x1200: cha nnel 1 a nd b - 0x61, 0x73, 0x65, 0x0d, 0x0a, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, - //0x1210: ase. .add ress 220 - 0x68, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x2e, 0x0d, 0x0a, - //0x1220: h ar e as sume d... - 0x0d, 0x0a, 0x54, 0x6f, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6f, - //0x1230: ..To alt er a ny o - 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x73, - //0x1240: r al l of the se s - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, - //0x1250: etti ngs you can - 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x0d, 0x0a, 0x6f, 0x6e, - //0x1260: spec ify them ..on - 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x69, 0x6e, - //0x1270: the com mand lin - 0x65, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x0d, - //0x1280: e. F or e xamp le:. - 0x0a, 0x0d, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x20, 0x20, 0x20, 0x20, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1290: ...T ype D REAM - 0x57, 0x45, 0x42, 0x20, 0x49, 0x37, 0x20, 0x41, 0x32, 0x32, 0x30, 0x20, 0x44, 0x31, 0x20, 0x20, - //0x12a0: WEB I7 A 220 D1 - 0x20, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, - //0x12b0: to run Dre amwe - 0x62, 0x20, 0x6f, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x37, 0x2c, 0x20, 0x44, 0x4d, 0x41, 0x0d, - //0x12c0: b on IRQ 7, DMA. - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - //0x12d0: . - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - //0x12e0: - 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x20, 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x61, - //0x12f0: chan nel 1 an d ba - 0x73, 0x65, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, 0x68, 0x0d, - //0x1300: se a ddre ss 2 20h. - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, - //0x1310: . DRE AMWE - 0x42, 0x20, 0x49, 0x35, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - //0x1320: B I5 - 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, - //0x1330: to r un D ream web - 0x6f, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x35, 0x20, 0x61, 0x6e, 0x64, 0x0d, 0x0a, 0x20, 0x20, - //0x1340: on I RQ 5 and .. + //0x01b0: .... .... .... .... + 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x2c, 0x00, 0x14, 0x00, + //0x01c0: .... .... .... ,... + 0x02, 0x00, 0x01, 0x01, 0x37, 0x00, 0x00, 0x00, 0x32, 0x14, 0x00, 0x18, 0x16, 0x00, 0x4a, 0x00, + //0x01d0: .... 7... 2... ..J. + 0x01, 0x00, 0x00, 0x18, 0x21, 0x0a, 0x4b, 0x00, 0x01, 0x00, 0x01, 0x01, 0x2c, 0x00, 0x1b, 0x00, + //0x01e0: .... !.K. .... ,... + 0x02, 0x00, 0x02, 0x01, 0x2c, 0x00, 0x60, 0x00, 0x03, 0x00, 0x04, 0x01, 0x2c, 0x00, 0x76, 0x00, + //0x01f0: .... ,.`. .... ,.v. + 0x02, 0x00, 0x05, 0x01, 0x2c, 0x0a, 0x00, 0x00, 0x02, 0x00, 0x00, 0x05, 0x16, 0x14, 0x35, 0x00, + //0x0200: .... ,... .... ..5. + 0x03, 0x00, 0x00, 0x05, 0x16, 0x14, 0x28, 0x00, 0x01, 0x00, 0x02, 0x05, 0x16, 0x14, 0x32, 0x00, + //0x0210: .... ..(. .... ..2. + 0x01, 0x00, 0x03, 0x02, 0x0b, 0x0a, 0xc0, 0x00, 0x01, 0x00, 0x00, 0x02, 0x0b, 0x0a, 0xb6, 0x00, + //0x0220: .... .... .... .... + 0x02, 0x00, 0x01, 0x08, 0x0b, 0x0a, 0x00, 0x00, 0x02, 0x00, 0x01, 0x17, 0x00, 0x32, 0x00, 0x00, + //0x0230: .... .... .... .2.. + 0x03, 0x00, 0x00, 0x1c, 0x0b, 0x14, 0xfa, 0x00, 0x04, 0x00, 0x00, 0x17, 0x00, 0x32, 0x2b, 0x00, + //0x0240: .... .... .... .2+. + 0x02, 0x00, 0x08, 0x17, 0x0b, 0x28, 0x82, 0x00, 0x02, 0x00, 0x01, 0x17, 0x16, 0x28, 0x7a, 0x00, + //0x0250: .... .(.. .... .(z. + 0x02, 0x00, 0x02, 0x17, 0x16, 0x28, 0x69, 0x00, 0x02, 0x00, 0x03, 0x17, 0x16, 0x28, 0x51, 0x00, + //0x0260: .... .(i. .... .(Q. + 0x02, 0x00, 0x04, 0x17, 0x0b, 0x28, 0x87, 0x00, 0x02, 0x00, 0x05, 0x17, 0x16, 0x28, 0x91, 0x00, + //0x0270: .... .(.. .... .(.. + 0x02, 0x00, 0x06, 0x04, 0x16, 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0xc8, 0x00, + //0x0280: .... .... ...- .... + 0x00, 0x00, 0x14, 0x2d, 0x16, 0x1e, 0x27, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0x19, 0x00, + //0x0290: ...- ..'. ...- .... + 0x02, 0x00, 0x00, 0x08, 0x16, 0x28, 0x20, 0x00, 0x02, 0x00, 0x00, 0x07, 0x0b, 0x14, 0x40, 0x00, + //0x02a0: .... .( . .... ..@. + 0x02, 0x00, 0x00, 0x16, 0x16, 0x14, 0x52, 0x00, 0x02, 0x00, 0x00, 0x1b, 0x0b, 0x1e, 0x00, 0x00, + //0x02b0: .... ..R. .... .... + 0x02, 0x00, 0x00, 0x14, 0x00, 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x21, 0x28, 0x15, 0x00, + //0x02c0: .... .... .... !(.. + 0x01, 0x00, 0x00, 0x1d, 0x0b, 0x0a, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x16, 0x00, 0x02, 0x00, + //0x02d0: .... .... .... .... + 0x02, 0x00, 0x00, 0x19, 0x00, 0x32, 0x04, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x1e, 0x79, 0x00, + //0x02e0: .... .2.. ...2 ..y. + 0x02, 0x00, 0x00, 0x32, 0x16, 0x1e, 0x00, 0x00, 0x14, 0x00, 0x00, 0x34, 0x16, 0x1e, 0xc0, 0x00, + //0x02f0: ...2 .... ...4 .... + 0x02, 0x00, 0x00, 0x34, 0x16, 0x1e, 0xe9, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x68, 0x00, + //0x0300: ...4 .... ...2 .(h. + 0x37, 0x00, 0x00, 0x35, 0x21, 0x00, 0x63, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x00, 0x00, + //0x0310: 7..5 !.c. ...2 .(.. + 0x03, 0x00, 0x00, 0x32, 0x16, 0x1e, 0xa2, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, 0x1e, 0x39, 0x00, + //0x0320: ...2 .... ...4 ..9. + 0x02, 0x00, 0x00, 0x34, 0x16, 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x36, 0x00, 0x00, 0x48, 0x00, + //0x0330: ...4 .... ...6 ..H. + 0x03, 0x00, 0x00, 0x37, 0x2c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, + //0x0340: ...7 ,... .... .... + 0x1c, 0x00, 0x00, 0x0e, 0x16, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x16, 0x00, 0x2c, 0x01, + //0x0350: .... .... .... ..,. + 0x01, 0x00, 0x00, 0x0a, 0x16, 0x1e, 0xae, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x16, 0x14, 0x00, 0x00, + //0x0360: .... .... .... .... + 0x01, 0x00, 0x00, 0x0b, 0x0b, 0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0b, 0x0b, 0x1e, 0x00, 0x00, + //0x0370: .... .... 2... .... + 0x32, 0x14, 0x00, 0x0b, 0x16, 0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0e, 0x21, 0x28, 0x00, 0x00, + //0x0380: 2... .... 2... !(.. + 0x32, 0x14, 0x00, 0xff, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x39, 0x39, + //0x0390: 2... DREA MWEB .V99 + 0x00, 0x00, 0x01, 0x45, 0x58, 0x49, 0x54, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x48, 0x45, 0x4c, + //0x03a0: ...E XIT HEL + 0x50, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x49, 0x53, 0x54, 0x20, 0x20, 0x20, 0x20, 0x20, + //0x03b0: P L IST + 0x20, 0x52, 0x45, 0x41, 0x44, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x4f, 0x47, 0x4f, 0x4e, + //0x03c0: REA D L OGON + 0x20, 0x20, 0x20, 0x20, 0x20, 0x4b, 0x45, 0x59, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x01, + //0x03d0: KEY S . + 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x55, 0x42, + //0x03e0: .PUB LIC PUB + 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x42, 0x4c, 0x41, 0x43, 0x4b, + //0x03f0: LIC ...B LACK + 0x44, 0x52, 0x41, 0x47, 0x4f, 0x4e, 0x20, 0x52, 0x59, 0x41, 0x4e, 0x20, 0x20, 0x20, 0x20, 0x20, + //0x0400: DRAG ON R YAN + 0x20, 0x20, 0x00, 0x00, 0x00, 0x48, 0x45, 0x4e, 0x44, 0x52, 0x49, 0x58, 0x20, 0x20, 0x20, 0x20, + //0x0410: .. .HEN DRIX + 0x20, 0x4c, 0x4f, 0x55, 0x49, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x53, + //0x0420: LOU IS ...S + 0x45, 0x50, 0x54, 0x49, 0x4d, 0x55, 0x53, 0x20, 0x20, 0x20, 0x20, 0x42, 0x45, 0x43, 0x4b, 0x45, + //0x0430: EPTI MUS B ECKE + 0x54, 0x54, 0x20, 0x20, 0x20, 0x20, 0x00, 0xff, 0xff, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + //0x0440: TT .. . + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x52, 0x4f, 0x4f, 0x54, 0x20, 0x20, 0x20, 0x20, + //0x0450: ." ROOT + 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + //0x0460: ." + 0x20, 0x20, 0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x30, 0x30, 0x00, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, + //0x0470: .0 000. 00.. ...$ + 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x4f, 0x4e, 0x45, 0x20, + //0x0480: OBJE CT N AME ONE 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - //0x1350: - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x66, - //0x1360: def - 0x61, 0x75, 0x6c, 0x74, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x6f, 0x66, 0x20, - //0x1370: ault add ress of - 0x32, 0x32, 0x30, 0x68, 0x2c, 0x20, 0x44, 0x4d, 0x41, 0x20, 0x31, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, - //0x1380: 220h , DM A 1. ...$ - 0x0d, 0x0a, 0x0d, 0x0a, 0x54, 0x72, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x44, 0x72, 0x65, 0x61, - //0x1390: .... Try the Drea - 0x6d, 0x77, 0x65, 0x62, 0x20, 0x43, 0x44, 0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, - //0x13a0: mweb CD in y our - 0x73, 0x74, 0x65, 0x72, 0x65, 0x6f, 0x2e, 0x2e, 0x2e, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x0d, 0x0a, - //0x13b0: ster eo.. .... .... - 0x24, 0x81, 0x00, 0xb8, 0x00, 0x52, 0x00, 0x80, 0x00, 0xc0, 0xc8, 0x50, 0x00, 0x93, 0x00, 0x3e, - //0x13c0: $... .R.. ...P ...> - 0x00, 0x6f, 0x00, 0x80, 0xc8, 0xb7, 0x00, 0xfa, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0xc4, 0xc8, 0x00, - //0x13d0: .o.. .... .>.o .... - 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x53, 0x50, 0x45, 0x45, 0x43, - //0x13e0: .@.. .... ...S PEEC - 0x48, 0x52, 0x32, 0x34, 0x43, 0x30, 0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, 0x57, 0x00, 0x87, 0x83, - //0x13f0: HR24 C000 5.RA W... - 0x81, 0x82, 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x70, 0xc4, 0x00, 0x00, 0x32, 0x00, - //0x1400: ..,. F. . ..p. ..2. - 0x00, 0x00, 0xb4, 0x00, 0x7c, 0xc3, 0xe2, 0x00, 0xf4, 0x00, 0x0a, 0x00, 0x1a, 0x00, 0x28, 0xc8, - //0x1410: .... |... .... ..(. - 0xe2, 0x00, 0xf4, 0x00, 0x1a, 0x00, 0x28, 0x00, 0x2c, 0xc8, 0xf0, 0x00, 0x04, 0x01, 0x64, 0x00, - //0x1420: .... ..(. ,... ..d. - 0x7c, 0x00, 0xcc, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd4, 0xc9, 0xff, 0xff, - //0x1430: |... ..@. .... .... - 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x70, 0xc4, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, - //0x1440: ,.F. ... p... 2... - 0xb4, 0x00, 0x7c, 0xc3, 0x12, 0x01, 0x24, 0x01, 0x0a, 0x00, 0x1a, 0x00, 0x28, 0xc8, 0x12, 0x01, - //0x1450: ..|. ..$. .... (... - 0x24, 0x01, 0x1a, 0x00, 0x28, 0x00, 0x2c, 0xc8, 0xf0, 0x00, 0x04, 0x01, 0x64, 0x00, 0x7c, 0x00, - //0x1460: $... (.,. .... d.|. - 0xcc, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd4, 0xc9, 0xff, 0xff, 0x00, 0x21, - //0x1470: .... @... .... ...! - 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x00, 0x0f, 0xff, 0x00, 0x0b, 0x00, - //0x1480: .... .... .... .... - 0x0f, 0xff, 0x00, 0x0b, 0x0a, 0x0f, 0xff, 0x00, 0x00, 0x0a, 0x0f, 0xff, 0x01, 0x2c, 0x0a, 0x06, - //0x1490: .... .... .... .,.. - 0xff, 0x01, 0x2c, 0x00, 0x0d, 0xff, 0x02, 0x21, 0x00, 0x06, 0xff, 0x02, 0x16, 0x00, 0x05, 0xff, - //0x14a0: ..,. ...! .... .... - 0x02, 0x16, 0x0a, 0x10, 0xff, 0x02, 0x0b, 0x0a, 0x10, 0xff, 0x03, 0x2c, 0x00, 0x0f, 0xff, 0x03, - //0x14b0: .... .... ..., .... - 0x21, 0x0a, 0x06, 0xff, 0x03, 0x21, 0x00, 0x05, 0xff, 0x04, 0x0b, 0x1e, 0x06, 0xff, 0x04, 0x16, - //0x14c0: !... .!.. .... .... - 0x1e, 0x05, 0xff, 0x04, 0x16, 0x14, 0x0d, 0xff, 0x0a, 0x21, 0x1e, 0x06, 0xff, 0x0a, 0x16, 0x1e, - //0x14d0: .... .... .!.. .... - 0x06, 0xff, 0x09, 0x16, 0x0a, 0x06, 0xff, 0x09, 0x16, 0x14, 0x10, 0xff, 0x09, 0x16, 0x1e, 0x10, - //0x14e0: .... .... .... .... - 0xff, 0x09, 0x16, 0x28, 0x10, 0xff, 0x09, 0x16, 0x32, 0x10, 0xff, 0x06, 0x0b, 0x1e, 0x06, 0xff, - //0x14f0: ...( .... 2... .... - 0x06, 0x00, 0x0a, 0x0f, 0xff, 0x06, 0x00, 0x14, 0x0f, 0xff, 0x06, 0x0b, 0x14, 0x0f, 0xff, 0x06, - //0x1500: .... .... .... .... - 0x16, 0x14, 0x0f, 0xff, 0x07, 0x0b, 0x14, 0x06, 0xff, 0x07, 0x00, 0x14, 0x06, 0xff, 0x07, 0x00, - //0x1510: .... .... .... .... - 0x1e, 0x06, 0xff, 0x37, 0x2c, 0x00, 0x05, 0xff, 0x37, 0x2c, 0x0a, 0x05, 0xff, 0x05, 0x16, 0x1e, - //0x1520: ...7 ,... 7,.. .... - 0x06, 0xff, 0x05, 0x16, 0x14, 0x0f, 0xff, 0x05, 0x16, 0x0a, 0x0f, 0xff, 0x18, 0x16, 0x00, 0x0f, - //0x1530: .... .... .... .... - 0xff, 0x18, 0x21, 0x00, 0x0f, 0xff, 0x18, 0x2c, 0x00, 0x0f, 0xff, 0x18, 0x21, 0x0a, 0x0f, 0xff, - //0x1540: ..!. ..., .... !... - 0x08, 0x00, 0x0a, 0x06, 0xff, 0x08, 0x0b, 0x0a, 0x06, 0xff, 0x08, 0x16, 0x0a, 0x06, 0xff, 0x08, - //0x1550: .... .... .... .... - 0x21, 0x0a, 0x06, 0xff, 0x08, 0x21, 0x14, 0x06, 0xff, 0x08, 0x21, 0x1e, 0x06, 0xff, 0x08, 0x21, - //0x1560: !... .!.. ..!. ...! - 0x28, 0x06, 0xff, 0x08, 0x16, 0x28, 0x06, 0xff, 0x08, 0x0b, 0x28, 0x06, 0xff, 0x0b, 0x0b, 0x14, - //0x1570: (... .(.. ..(. .... - 0x0c, 0xff, 0x0b, 0x0b, 0x1e, 0x0c, 0xff, 0x0b, 0x16, 0x14, 0x0c, 0xff, 0x0b, 0x16, 0x1e, 0x0c, - //0x1580: .... .... .... .... - 0xff, 0x0c, 0x16, 0x14, 0x0c, 0xff, 0x0d, 0x16, 0x14, 0x0c, 0xff, 0x0d, 0x21, 0x14, 0x0c, 0xff, - //0x1590: .... .... .... !... - 0x0e, 0x2c, 0x14, 0x0c, 0xff, 0x0e, 0x21, 0x00, 0x0c, 0xff, 0x0e, 0x21, 0x0a, 0x0c, 0xff, 0x0e, - //0x15a0: .,.. ..!. ...! .... - 0x21, 0x14, 0x0c, 0xff, 0x0e, 0x21, 0x1e, 0x0c, 0xff, 0x0e, 0x21, 0x28, 0x0c, 0xff, 0x0e, 0x16, - //0x15b0: !... .!.. ..!( .... - 0x00, 0x10, 0xff, 0x13, 0x00, 0x00, 0x0c, 0xff, 0x14, 0x00, 0x14, 0x10, 0xff, 0x14, 0x00, 0x1e, - //0x15c0: .... .... .... .... - 0x10, 0xff, 0x14, 0x0b, 0x1e, 0x10, 0xff, 0x14, 0x00, 0x28, 0x10, 0xff, 0x14, 0x0b, 0x28, 0x10, - //0x15d0: .... .... .(.. ..(. - 0xff, 0x15, 0x0b, 0x0a, 0x0f, 0xff, 0x15, 0x0b, 0x14, 0x0f, 0xff, 0x15, 0x00, 0x14, 0x0f, 0xff, - //0x15e0: .... .... .... .... - 0x15, 0x16, 0x14, 0x0f, 0xff, 0x15, 0x21, 0x14, 0x0f, 0xff, 0x15, 0x2c, 0x14, 0x0f, 0xff, 0x15, - //0x15f0: .... ..!. ..., .... - 0x2c, 0x0a, 0x0f, 0xff, 0x16, 0x16, 0x0a, 0x10, 0xff, 0x16, 0x16, 0x14, 0x10, 0xff, 0x17, 0x16, - //0x1600: ,... .... .... .... - 0x1e, 0x0d, 0xff, 0x17, 0x16, 0x28, 0x0d, 0xff, 0x17, 0x21, 0x28, 0x0d, 0xff, 0x17, 0x0b, 0x28, - //0x1610: .... .(.. .!(. ...( - 0x0d, 0xff, 0x17, 0x00, 0x28, 0x0d, 0xff, 0x17, 0x00, 0x32, 0x0d, 0xff, 0x19, 0x0b, 0x28, 0x10, - //0x1620: .... (... .2.. ..(. - 0xff, 0x19, 0x0b, 0x32, 0x10, 0xff, 0x19, 0x00, 0x32, 0x10, 0xff, 0x1b, 0x0b, 0x14, 0x10, 0xff, - //0x1630: ...2 .... 2... .... - 0x1b, 0x0b, 0x1e, 0x10, 0xff, 0x1d, 0x0b, 0x0a, 0x10, 0xff, 0x2d, 0x16, 0x1e, 0x0c, 0xff, 0x2d, - //0x1640: .... .... ..-. ...- - 0x16, 0x28, 0x0c, 0xff, 0x2d, 0x16, 0x32, 0x0c, 0xff, 0x2e, 0x16, 0x28, 0x0c, 0xff, 0x2e, 0x0b, - //0x1650: .(.. -.2. ...( .... - 0x32, 0x0c, 0xff, 0x2e, 0x16, 0x32, 0x0c, 0xff, 0x2e, 0x21, 0x32, 0x0c, 0xff, 0x2f, 0x00, 0x00, - //0x1660: 2... .2.. .!2. ./.. - 0x0c, 0xff, 0x1a, 0x16, 0x14, 0x10, 0xff, 0x1a, 0x21, 0x0a, 0x10, 0xff, 0x1a, 0x21, 0x14, 0x10, - //0x1670: .... .... !... .!.. - 0xff, 0x1a, 0x21, 0x1e, 0x10, 0xff, 0x1a, 0x2c, 0x1e, 0x10, 0xff, 0x1a, 0x16, 0x1e, 0x10, 0xff, - //0x1680: ..!. ..., .... .... - 0x1a, 0x0b, 0x1e, 0x10, 0xff, 0x1a, 0x0b, 0x14, 0x10, 0xff, 0x1a, 0x00, 0x14, 0x10, 0xff, 0x1a, - //0x1690: .... .... .... .... - 0x0b, 0x28, 0x10, 0xff, 0x1a, 0x00, 0x28, 0x10, 0xff, 0x1a, 0x16, 0x28, 0x10, 0xff, 0x1a, 0x0b, - //0x16a0: .(.. ..(. ...( .... - 0x32, 0x10, 0xff, 0x1c, 0x00, 0x1e, 0x0f, 0xff, 0x1c, 0x00, 0x14, 0x0f, 0xff, 0x1c, 0x00, 0x28, - //0x16b0: 2... .... .... ...( - 0x0f, 0xff, 0x1c, 0x0b, 0x1e, 0x0f, 0xff, 0x1c, 0x0b, 0x14, 0x0f, 0xff, 0x1c, 0x16, 0x1e, 0x0f, - //0x16c0: .... .... .... .... - 0xff, 0x1c, 0x16, 0x14, 0x0f, 0xff, 0xff, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x20, 0x4e, 0x41, - //0x16d0: .... ...O BJEC T NA - 0x4d, 0x45, 0x20, 0x4f, 0x4e, 0x45, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - //0x16e0: ME O NE - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, - //0x16f0: . - 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - //0x1700: .... .... .... .... - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1710: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, - //0x1720: .... .... ..12 3456 - 0x37, 0x38, 0x39, 0x30, 0x2d, 0x00, 0x08, 0x00, 0x51, 0x57, 0x45, 0x52, 0x54, 0x59, 0x55, 0x49, - //0x1730: 7890 -... QWER TYUI - 0x4f, 0x50, 0x00, 0x00, 0x0d, 0x00, 0x41, 0x53, 0x44, 0x46, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x00, - //0x1740: OP.. ..AS DFGH JKL. - 0x00, 0x00, 0x00, 0x00, 0x5a, 0x58, 0x43, 0x56, 0x42, 0x4e, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1750: .... ZXCV BNM. .... - 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1760: . .. .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1770: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1780: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1790: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x3a, 0x00, 0x00, 0x00, - //0x17a0: .... .... ...D :... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x17b0: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x17c0: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x20, 0x44, 0x41, 0x54, 0x41, 0x20, 0x46, 0x49, 0x4c, 0x45, 0x20, 0x43, 0x4f, - //0x17d0: WEB DATA FIL E CO - 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x31, 0x39, 0x39, 0x32, 0x20, 0x43, 0x52, 0x45, - //0x17e0: PYRI GHT 1992 CRE - 0x41, 0x54, 0x49, 0x56, 0x45, 0x20, 0x52, 0x45, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x00, 0x00, 0x00, - //0x17f0: ATIV E RE ALIT Y... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1800: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1810: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1820: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x30, 0x00, 0x05, 0xff, 0x21, 0x0a, 0xff, 0xff, 0xff, 0x00, - //0x1830: WEB. R00. ..!. .... - 0x01, 0x06, 0x02, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1840: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x31, 0x00, 0x01, 0xff, 0x2c, 0x0a, 0xff, 0xff, 0xff, 0x00, - //0x1850: WEB. R01. ..,. .... - 0x07, 0x02, 0xff, 0xff, 0xff, 0xff, 0x06, 0xff, 0xff, 0xff, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1860: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x32, 0x00, 0x02, 0xff, 0x21, 0x00, 0xff, 0xff, 0xff, 0x00, - //0x1870: WEB. R02. ..!. .... - 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x03, 0xff, 0xff, 0xff, 0x02, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1880: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x33, 0x00, 0x05, 0xff, 0x21, 0x0a, 0xff, 0xff, 0xff, 0x00, - //0x1890: WEB. R03. ..!. .... - 0x02, 0x02, 0x00, 0x02, 0x04, 0xff, 0x00, 0xff, 0xff, 0xff, 0x03, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x18a0: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x34, 0x00, 0x17, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, - //0x18b0: WEB. R04. .... .... - 0x01, 0x04, 0x00, 0x05, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x04, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x18c0: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x35, 0x00, 0x05, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - //0x18d0: WEB. R05. .... .... - 0x01, 0x02, 0x00, 0x04, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x05, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x18e0: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x36, 0x00, 0x05, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, - //0x18f0: WEB. R06. .... .... - 0x01, 0x00, 0x00, 0x01, 0x02, 0xff, 0x00, 0xff, 0xff, 0xff, 0x06, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1900: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x37, 0x00, 0xff, 0xff, 0x00, 0x14, 0xff, 0xff, 0xff, 0x00, - //0x1910: WEB. R07. .... .... - 0x02, 0x02, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x07, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1920: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x38, 0x00, 0x08, 0xff, 0x00, 0x0a, 0xff, 0xff, 0xff, 0x00, - //0x1930: WEB. R08. .... .... - 0x01, 0x02, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0b, 0x28, 0x00, 0x08, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1940: .... .... (..D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x39, 0x00, 0x09, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, - //0x1950: WEB. R09. .... .... - 0x04, 0x06, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x09, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1960: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x30, 0x00, 0x0a, 0xff, 0x21, 0x1e, 0xff, 0xff, 0xff, 0x00, - //0x1970: WEB. R10. ..!. .... - 0x02, 0x00, 0xff, 0xff, 0x02, 0x02, 0x04, 0x16, 0x1e, 0xff, 0x0a, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1980: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x31, 0x00, 0x0b, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, - //0x1990: WEB. R11. .... .... - 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x19a0: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x32, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - //0x19b0: WEB. R12. .... .... - 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x19c0: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x33, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - //0x19d0: WEB. R13. .... .... - 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0d, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x19e0: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x34, 0x00, 0x0e, 0xff, 0x2c, 0x14, 0xff, 0xff, 0xff, 0x00, - //0x19f0: WEB. R14. ..,. .... - 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1a00: .... .... .... .... + //0x0490: + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, + //0x04a0: .... .... + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + //0x04b0: .... .... .... .... + 0x02, 0x44, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + //0x04c0: .D:. .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1a10: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1a20: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1a30: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1a40: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1a50: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1a60: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1a70: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1a80: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x39, 0x00, 0x13, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, - //0x1a90: WEB. R19. .... .... - 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1aa0: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x30, 0x00, 0x16, 0xff, 0x00, 0x14, 0xff, 0xff, 0xff, 0x00, - //0x1ab0: WEB. R20. .... .... - 0x01, 0x04, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x14, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1ac0: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x31, 0x00, 0x05, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, - //0x1ad0: WEB. R21. .... .... - 0x01, 0x04, 0x02, 0x0f, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x15, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1ae0: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, - //0x1af0: WEB. R22. .... .... - 0x00, 0x04, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1b00: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x33, 0x00, 0x17, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - //0x1b10: WEB. R23. .... .... - 0x01, 0x04, 0x02, 0x0f, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1b20: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x34, 0x00, 0x05, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, - //0x1b30: WEB. R24. ..,. .... - 0x01, 0x06, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x18, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1b40: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x35, 0x00, 0x16, 0xff, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x00, - //0x1b50: WEB. R25. ...( .... - 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x19, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1b60: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x36, 0x00, 0x09, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - //0x1b70: WEB. R26. .... .... - 0x04, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1b80: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x37, 0x00, 0x16, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, - //0x1b90: WEB. R27. .... .... - 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1b, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1ba0: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x38, 0x00, 0x05, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, - //0x1bb0: WEB. R28. .... .... - 0x00, 0x00, 0xff, 0xff, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1bc0: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x39, 0x00, 0x16, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, - //0x1bd0: WEB. R29. .... .... - 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1d, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1be0: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x35, 0x00, 0x05, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, - //0x1bf0: WEB. R05. .... .... - 0x01, 0x04, 0x01, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x05, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1c00: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x34, 0x00, 0x17, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - //0x1c10: WEB. R04. .... .... - 0x01, 0x04, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x04, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1c20: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x30, 0x00, 0x0a, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - //0x1c30: WEB. R10. .... .... - 0x03, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0a, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1c40: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x32, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - //0x1c50: WEB. R12. .... .... - 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1c60: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x33, 0x00, 0x05, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, - //0x1c70: WEB. R03. ..,. .... - 0x01, 0x06, 0x02, 0xff, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1c80: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x34, 0x00, 0x05, 0xff, 0x16, 0x00, 0xff, 0xff, 0xff, 0x00, - //0x1c90: WEB. R24. .... .... - 0x03, 0x06, 0x00, 0xff, 0xff, 0xff, 0xff, 0x21, 0x00, 0x03, 0x18, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1ca0: .... ...! ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - //0x1cb0: WEB. R22. .... .... - 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1cc0: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - //0x1cd0: WEB. R22. .... .... - 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1ce0: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x31, 0x00, 0x0b, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - //0x1cf0: WEB. R11. .... .... - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1d00: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x38, 0x00, 0x05, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, - //0x1d10: WEB. R28. .... .... - 0x00, 0x06, 0xff, 0xff, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1d20: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x31, 0x00, 0x05, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, - //0x1d30: WEB. R21. .... .... - 0x01, 0x04, 0x02, 0x0f, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x15, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1d40: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x36, 0x00, 0x09, 0xff, 0x00, 0x28, 0xff, 0xff, 0xff, 0x00, - //0x1d50: WEB. R26. ...( .... - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1d60: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x39, 0x00, 0x13, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, - //0x1d70: WEB. R19. .... .... - 0x02, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1d80: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x38, 0x00, 0x08, 0xff, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x00, - //0x1d90: WEB. R08. ...( .... - 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x08, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1da0: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x31, 0x00, 0x01, 0xff, 0x2c, 0x0a, 0xff, 0xff, 0xff, 0x00, - //0x1db0: WEB. R01. ..,. .... - 0x03, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1dc0: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x35, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - //0x1dd0: WEB. R45. #... .... - 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2d, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1de0: .... .... ..-D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x36, 0x00, 0x23, 0xff, 0x16, 0x28, 0xff, 0xff, 0xff, 0x00, - //0x1df0: WEB. R46. #..( .... - 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2e, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1e00: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x37, 0x00, 0x23, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, - //0x1e10: WEB. R47. #... .... - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2f, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1e20: .... .... ../D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x35, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - //0x1e30: WEB. R45. #... .... - 0x04, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2d, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1e40: .... .... ..-D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x36, 0x00, 0x23, 0xff, 0x16, 0x32, 0xff, 0xff, 0xff, 0x00, - //0x1e50: WEB. R46. #..2 .... - 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2e, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1e60: .... .... ...D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x30, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - //0x1e70: WEB. R50. #... .... - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x32, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1e80: .... .... ..2D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x31, 0x00, 0x23, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, - //0x1e90: WEB. R51. #... .... - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x33, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1ea0: .... .... ..3D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x32, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - //0x1eb0: WEB. R52. #... .... - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x34, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1ec0: .... .... ..4D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x33, 0x00, 0x23, 0xff, 0x21, 0x00, 0xff, 0xff, 0xff, 0x00, - //0x1ed0: WEB. R53. #.!. .... - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x35, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1ee0: .... .... ..5D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x34, 0x00, 0x23, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, - //0x1ef0: WEB. R54. #... .... - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x36, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x1f00: .... .... ..6D REAM - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x35, 0x00, 0x0e, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, - //0x1f10: WEB. R55. ..,. .... - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1f20: .... .... ..7. .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1f30: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, - //0x1f40: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, - //0x1f50: .... .... .... .... - 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1f60: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1f70: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1f80: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1f90: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1fa0: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1fb0: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1fc0: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x1fd0: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, - //0x1fe0: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x1ff0: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2000: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2010: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2020: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2030: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2040: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2050: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2060: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2070: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2080: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2090: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x20a0: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x20b0: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x20c0: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x20d0: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x20e0: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x20f0: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2100: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2110: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2120: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2130: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2140: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2150: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2160: .... .... .... .... - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x2170: .... .... .... .... - 0xff, 0xff, 0xff, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - //0x2180: .... .... .... .... - 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - //0x2190: .... .... .... .... - 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - //0x21a0: .... .... .... .... - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - //0x21b0: .... .... .... .... - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - //0x21c0: .... .... .... .... - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - //0x21d0: .... .... .... .... - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, - //0x21e0: .... .... .... .... - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, - //0x21f0: .... .... ..DR EAMW - 0x45, 0x42, 0x2e, 0x44, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, - //0x2200: EB.D 00.D REAM WEB. - 0x44, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x32, - //0x2210: D01. DREA MWEB .D02 - 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x33, 0x00, 0x44, 0x52, - //0x2220: .DRE AMWE B.D0 3.DR - 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - //0x2230: EAMW EB.D 04.D REAM - 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, - //0x2240: WEB. D05. DREA MWEB - 0x2e, 0x44, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x45, - //0x2250: .D06 .DRE AMWE B.DE - 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x2260: M... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x2270: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x2280: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x2290: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x22a0: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x22b0: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x22c0: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x22d0: .... .... .... .... + //0x04d0: .... .... .... .... + 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + //0x04e0: .... .... .... .... + 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, + //0x04f0: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x22e0: .... .... .... .... + //0x0500: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x22f0: .... .... .... .... + //0x0510: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x2300: .... .... .... .... + //0x0520: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x2310: .... .... .... .... + //0x0530: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x2320: .... .... .... .... + //0x0540: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x2330: .... .... .... .... + //0x0550: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x2340: .... .... .... .... + //0x0560: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x2350: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, }; + //0x0570: .... .... .... .... + 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, }; ds.assign(src, src + sizeof(src)); -dreamweb(); -} - -void DreamGenContext::__dispatch_call(uint16 addr) { - switch(addr) { - case addr_alleybarksound: alleybarksound(); break; - case addr_intromusic: intromusic(); break; - case addr_foghornsound: foghornsound(); break; - case addr_receptionist: receptionist(); break; - case addr_smokebloke: smokebloke(); break; - case addr_attendant: attendant(); break; - case addr_manasleep: manasleep(); break; - case addr_eden: eden(); break; - case addr_edeninbath: edeninbath(); break; - case addr_malefan: malefan(); break; - case addr_femalefan: femalefan(); break; - case addr_louis: louis(); break; - case addr_louischair: louischair(); break; - case addr_manasleep2: manasleep2(); break; - case addr_mansatstill: mansatstill(); break; - case addr_tattooman: tattooman(); break; - case addr_drinker: drinker(); break; - case addr_bartender: bartender(); break; - case addr_othersmoker: othersmoker(); break; - case addr_barwoman: barwoman(); break; - case addr_interviewer: interviewer(); break; - case addr_soldier1: soldier1(); break; - case addr_rockstar: rockstar(); break; - case addr_helicopter: helicopter(); break; - case addr_mugger: mugger(); break; - case addr_aide: aide(); break; - case addr_businessman: businessman(); break; - case addr_poolguard: poolguard(); break; - case addr_security: security(); break; - case addr_heavy: heavy(); break; - case addr_bossman: bossman(); break; - case addr_gamer: gamer(); break; - case addr_sparkydrip: sparkydrip(); break; - case addr_carparkdrip: carparkdrip(); break; - case addr_keeper: keeper(); break; - case addr_candles1: candles1(); break; - case addr_smallcandle: smallcandle(); break; - case addr_intromagic1: intromagic1(); break; - case addr_candles: candles(); break; - case addr_candles2: candles2(); break; - case addr_gates: gates(); break; - case addr_intromagic2: intromagic2(); break; - case addr_intromagic3: intromagic3(); break; - case addr_intromonks1: intromonks1(); break; - case addr_intromonks2: intromonks2(); break; - case addr_handclap: handclap(); break; - case addr_monks2text: monks2text(); break; - case addr_intro1text: intro1text(); break; - case addr_intro2text: intro2text(); break; - case addr_intro3text: intro3text(); break; - case addr_monkandryan: monkandryan(); break; - case addr_endgameseq: endgameseq(); break; - case addr_rollendcredits: rollendcredits(); break; - case addr_priest: priest(); break; - case addr_madmanstelly: madmanstelly(); break; - case addr_madman: madman(); break; - case addr_priesttext: priesttext(); break; - case addr_textforend: textforend(); break; - case addr_textformonk: textformonk(); break; - case addr_drunk: drunk(); break; - case addr_advisor: advisor(); break; - case addr_copper: copper(); break; - case addr_sparky: sparky(); break; - case addr_train: train(); break; - case addr_checkspeed: checkspeed(); break; - case addr_mainman: mainman(); break; - case addr_checkforexit: checkforexit(); break; - case addr_adjustdown: adjustdown(); break; - case addr_adjustup: adjustup(); break; - case addr_adjustleft: adjustleft(); break; - case addr_adjustright: adjustright(); break; - case addr_reminders: reminders(); break; - case addr_initrain: initrain(); break; - case addr_splitintolines: splitintolines(); break; - case addr_backobject: backobject(); break; - case addr_liftnoise: liftnoise(); break; - case addr_random: random(); break; - case addr_steady: steady(); break; - case addr_constant: constant(); break; - case addr_reelsonscreen: reelsonscreen(); break; - case addr_soundonreels: soundonreels(); break; - case addr_reconstruct: reconstruct(); break; - case addr_deleverything: deleverything(); break; - case addr_showpcx: showpcx(); break; - case addr_loadpalfromiff: loadpalfromiff(); break; - case addr_setmode: setmode(); break; - case addr_createpanel: createpanel(); break; - case addr_createpanel2: createpanel2(); break; - case addr_vsync: vsync(); break; - case addr_doshake: doshake(); break; - case addr_transfermap: transfermap(); break; - case addr_fadedos: fadedos(); break; - case addr_dofade: dofade(); break; - case addr_clearendpal: clearendpal(); break; - case addr_clearpalette: clearpalette(); break; - case addr_fadescreenup: fadescreenup(); break; - case addr_fadetowhite: fadetowhite(); break; - case addr_fadefromwhite: fadefromwhite(); break; - case addr_fadescreenups: fadescreenups(); break; - case addr_fadescreendownhalf: fadescreendownhalf(); break; - case addr_fadescreenuphalf: fadescreenuphalf(); break; - case addr_fadescreendown: fadescreendown(); break; - case addr_fadescreendowns: fadescreendowns(); break; - case addr_clearstartpal: clearstartpal(); break; - case addr_showgun: showgun(); break; - case addr_rollendcredits2: rollendcredits2(); break; - case addr_rollem: rollem(); break; - case addr_fadecalculation: fadecalculation(); break; - case addr_greyscalesum: greyscalesum(); break; - case addr_showgroup: showgroup(); break; - case addr_paltostartpal: paltostartpal(); break; - case addr_endpaltostart: endpaltostart(); break; - case addr_startpaltoend: startpaltoend(); break; - case addr_paltoendpal: paltoendpal(); break; - case addr_allpalette: allpalette(); break; - case addr_dumpcurrent: dumpcurrent(); break; - case addr_fadedownmon: fadedownmon(); break; - case addr_fadeupmon: fadeupmon(); break; - case addr_fadeupmonfirst: fadeupmonfirst(); break; - case addr_fadeupyellows: fadeupyellows(); break; - case addr_initialmoncols: initialmoncols(); break; - case addr_titles: titles(); break; - case addr_endgame: endgame(); break; - case addr_monkspeaking: monkspeaking(); break; - case addr_showmonk: showmonk(); break; - case addr_gettingshot: gettingshot(); break; - case addr_credits: credits(); break; - case addr_biblequote: biblequote(); break; - case addr_hangone: hangone(); break; - case addr_intro: intro(); break; - case addr_runintroseq: runintroseq(); break; - case addr_runendseq: runendseq(); break; - case addr_loadintroroom: loadintroroom(); break; - case addr_mode640x480: mode640x480(); break; - case addr_set16colpalette: set16colpalette(); break; - case addr_realcredits: realcredits(); break; - case addr_monprint: monprint(); break; - case addr_fillopen: fillopen(); break; - case addr_findallopen: findallopen(); break; - case addr_examineob: examineob(); break; - case addr_makemainscreen: makemainscreen(); break; - case addr_getbackfromob: getbackfromob(); break; - case addr_incryanpage: incryanpage(); break; - case addr_openinv: openinv(); break; - case addr_openob: openob(); break; - case addr_examicon: examicon(); break; - case addr_describeob: describeob(); break; - case addr_additionaltext: additionaltext(); break; - case addr_obsthatdothings: obsthatdothings(); break; - case addr_getobtextstart: getobtextstart(); break; - case addr_searchforsame: searchforsame(); break; - case addr_inventory: inventory(); break; - case addr_setpickup: setpickup(); break; - case addr_examinventory: examinventory(); break; - case addr_reexfrominv: reexfrominv(); break; - case addr_reexfromopen: reexfromopen(); break; - case addr_swapwithinv: swapwithinv(); break; - case addr_swapwithopen: swapwithopen(); break; - case addr_intoinv: intoinv(); break; - case addr_outofinv: outofinv(); break; - case addr_getfreead: getfreead(); break; - case addr_getexad: getexad(); break; - case addr_geteitherad: geteitherad(); break; - case addr_getanyad: getanyad(); break; - case addr_getanyaddir: getanyaddir(); break; - case addr_getopenedsize: getopenedsize(); break; - case addr_getsetad: getsetad(); break; - case addr_findinvpos: findinvpos(); break; - case addr_findopenpos: findopenpos(); break; - case addr_dropobject: dropobject(); break; - case addr_droperror: droperror(); break; - case addr_cantdrop: cantdrop(); break; - case addr_wornerror: wornerror(); break; - case addr_removeobfrominv: removeobfrominv(); break; - case addr_selectopenob: selectopenob(); break; - case addr_useopened: useopened(); break; - case addr_errormessage1: errormessage1(); break; - case addr_errormessage2: errormessage2(); break; - case addr_errormessage3: errormessage3(); break; - case addr_checkobjectsize: checkobjectsize(); break; - case addr_outofopen: outofopen(); break; - case addr_transfertoex: transfertoex(); break; - case addr_pickupconts: pickupconts(); break; - case addr_transfercontoex: transfercontoex(); break; - case addr_transfertext: transfertext(); break; - case addr_purgealocation: purgealocation(); break; - case addr_emergencypurge: emergencypurge(); break; - case addr_purgeanitem: purgeanitem(); break; - case addr_deleteexobject: deleteexobject(); break; - case addr_deleteexframe: deleteexframe(); break; - case addr_deleteextext: deleteextext(); break; - case addr_blockget: blockget(); break; - case addr_drawfloor: drawfloor(); break; - case addr_autolook: autolook(); break; - case addr_look: look(); break; - case addr_dolook: dolook(); break; - case addr_redrawmainscrn: redrawmainscrn(); break; - case addr_getback1: getback1(); break; - case addr_talk: talk(); break; - case addr_convicons: convicons(); break; - case addr_getpersframe: getpersframe(); break; - case addr_starttalk: starttalk(); break; - case addr_getpersontext: getpersontext(); break; - case addr_moretalk: moretalk(); break; - case addr_dosometalk: dosometalk(); break; - case addr_hangonpq: hangonpq(); break; - case addr_redes: redes(); break; - case addr_newplace: newplace(); break; - case addr_selectlocation: selectlocation(); break; - case addr_showcity: showcity(); break; - case addr_lookatplace: lookatplace(); break; - case addr_getundercentre: getundercentre(); break; - case addr_putundercentre: putundercentre(); break; - case addr_locationpic: locationpic(); break; - case addr_getdestinfo: getdestinfo(); break; - case addr_showarrows: showarrows(); break; - case addr_nextdest: nextdest(); break; - case addr_lastdest: lastdest(); break; - case addr_destselect: destselect(); break; - case addr_getlocation: getlocation(); break; - case addr_setlocation: setlocation(); break; - case addr_resetlocation: resetlocation(); break; - case addr_readdesticon: readdesticon(); break; - case addr_readcitypic: readcitypic(); break; - case addr_usemon: usemon(); break; - case addr_printoutermon: printoutermon(); break; - case addr_loadpersonal: loadpersonal(); break; - case addr_loadnews: loadnews(); break; - case addr_loadcart: loadcart(); break; - case addr_lookininterface: lookininterface(); break; - case addr_turnonpower: turnonpower(); break; - case addr_randomaccess: randomaccess(); break; - case addr_powerlighton: powerlighton(); break; - case addr_powerlightoff: powerlightoff(); break; - case addr_accesslighton: accesslighton(); break; - case addr_accesslightoff: accesslightoff(); break; - case addr_locklighton: locklighton(); break; - case addr_locklightoff: locklightoff(); break; - case addr_input: input(); break; - case addr_makecaps: makecaps(); break; - case addr_delchar: delchar(); break; - case addr_execcommand: execcommand(); break; - case addr_neterror: neterror(); break; - case addr_dircom: dircom(); break; - case addr_searchforfiles: searchforfiles(); break; - case addr_signon: signon(); break; - case addr_showkeys: showkeys(); break; - case addr_read: read(); break; - case addr_dirfile: dirfile(); break; - case addr_getkeyandlogo: getkeyandlogo(); break; - case addr_searchforstring: searchforstring(); break; - case addr_parser: parser(); break; - case addr_scrollmonitor: scrollmonitor(); break; - case addr_monitorlogo: monitorlogo(); break; - case addr_printlogo: printlogo(); break; - case addr_showcurrentfile: showcurrentfile(); break; - case addr_monmessage: monmessage(); break; - case addr_processtrigger: processtrigger(); break; - case addr_triggermessage: triggermessage(); break; - case addr_printcurs: printcurs(); break; - case addr_delcurs: delcurs(); break; - case addr_useobject: useobject(); break; - case addr_wheelsound: wheelsound(); break; - case addr_runtap: runtap(); break; - case addr_playguitar: playguitar(); break; - case addr_hotelcontrol: hotelcontrol(); break; - case addr_hotelbell: hotelbell(); break; - case addr_opentomb: opentomb(); break; - case addr_usetrainer: usetrainer(); break; - case addr_nothelderror: nothelderror(); break; - case addr_usepipe: usepipe(); break; - case addr_usefullcart: usefullcart(); break; - case addr_useplinth: useplinth(); break; - case addr_chewy: chewy(); break; - case addr_useladder: useladder(); break; - case addr_useladderb: useladderb(); break; - case addr_slabdoora: slabdoora(); break; - case addr_slabdoorb: slabdoorb(); break; - case addr_slabdoord: slabdoord(); break; - case addr_slabdoorc: slabdoorc(); break; - case addr_slabdoore: slabdoore(); break; - case addr_slabdoorf: slabdoorf(); break; - case addr_useslab: useslab(); break; - case addr_usecart: usecart(); break; - case addr_useclearbox: useclearbox(); break; - case addr_usecoveredbox: usecoveredbox(); break; - case addr_userailing: userailing(); break; - case addr_useopenbox: useopenbox(); break; - case addr_wearwatch: wearwatch(); break; - case addr_wearshades: wearshades(); break; - case addr_sitdowninbar: sitdowninbar(); break; - case addr_usechurchhole: usechurchhole(); break; - case addr_usehole: usehole(); break; - case addr_usealtar: usealtar(); break; - case addr_opentvdoor: opentvdoor(); break; - case addr_usedryer: usedryer(); break; - case addr_openlouis: openlouis(); break; - case addr_nextcolon: nextcolon(); break; - case addr_openyourneighbour: openyourneighbour(); break; - case addr_usewindow: usewindow(); break; - case addr_usebalcony: usebalcony(); break; - case addr_openryan: openryan(); break; - case addr_openpoolboss: openpoolboss(); break; - case addr_openeden: openeden(); break; - case addr_opensarters: opensarters(); break; - case addr_isitright: isitright(); break; - case addr_drawitall: drawitall(); break; - case addr_openhoteldoor: openhoteldoor(); break; - case addr_openhoteldoor2: openhoteldoor2(); break; - case addr_grafittidoor: grafittidoor(); break; - case addr_trapdoor: trapdoor(); break; - case addr_callhotellift: callhotellift(); break; - case addr_calledenslift: calledenslift(); break; - case addr_calledensdlift: calledensdlift(); break; - case addr_usepoolreader: usepoolreader(); break; - case addr_uselighter: uselighter(); break; - case addr_showseconduse: showseconduse(); break; - case addr_usecardreader1: usecardreader1(); break; - case addr_usecardreader2: usecardreader2(); break; - case addr_usecardreader3: usecardreader3(); break; - case addr_usecashcard: usecashcard(); break; - case addr_lookatcard: lookatcard(); break; - case addr_moneypoke: moneypoke(); break; - case addr_usecontrol: usecontrol(); break; - case addr_usehatch: usehatch(); break; - case addr_usewire: usewire(); break; - case addr_usehandle: usehandle(); break; - case addr_useelevator1: useelevator1(); break; - case addr_showfirstuse: showfirstuse(); break; - case addr_useelevator3: useelevator3(); break; - case addr_useelevator4: useelevator4(); break; - case addr_useelevator2: useelevator2(); break; - case addr_useelevator5: useelevator5(); break; - case addr_usekey: usekey(); break; - case addr_usestereo: usestereo(); break; - case addr_usecooker: usecooker(); break; - case addr_useaxe: useaxe(); break; - case addr_useelvdoor: useelvdoor(); break; - case addr_withwhat: withwhat(); break; - case addr_selectob: selectob(); break; - case addr_findsetobject: findsetobject(); break; - case addr_findexobject: findexobject(); break; - case addr_isryanholding: isryanholding(); break; - case addr_checkinside: checkinside(); break; - case addr_putbackobstuff: putbackobstuff(); break; - case addr_showpuztext: showpuztext(); break; - case addr_findpuztext: findpuztext(); break; - case addr_issetobonmap: issetobonmap(); break; - case addr_placefreeobject: placefreeobject(); break; - case addr_removefreeobject: removefreeobject(); break; - case addr_switchryanon: switchryanon(); break; - case addr_switchryanoff: switchryanoff(); break; - case addr_autoappear: autoappear(); break; - case addr_setuptimeduse: setuptimeduse(); break; - case addr_edenscdplayer: edenscdplayer(); break; - case addr_usewall: usewall(); break; - case addr_usechurchgate: usechurchgate(); break; - case addr_usegun: usegun(); break; - case addr_useshield: useshield(); break; - case addr_usebuttona: usebuttona(); break; - case addr_useplate: useplate(); break; - case addr_usewinch: usewinch(); break; - case addr_entercode: entercode(); break; - case addr_loadkeypad: loadkeypad(); break; - case addr_quitkey: quitkey(); break; - case addr_addtopresslist: addtopresslist(); break; - case addr_buttonone: buttonone(); break; - case addr_buttontwo: buttontwo(); break; - case addr_buttonthree: buttonthree(); break; - case addr_buttonfour: buttonfour(); break; - case addr_buttonfive: buttonfive(); break; - case addr_buttonsix: buttonsix(); break; - case addr_buttonseven: buttonseven(); break; - case addr_buttoneight: buttoneight(); break; - case addr_buttonnine: buttonnine(); break; - case addr_buttonnought: buttonnought(); break; - case addr_buttonenter: buttonenter(); break; - case addr_buttonpress: buttonpress(); break; - case addr_showouterpad: showouterpad(); break; - case addr_showkeypad: showkeypad(); break; - case addr_singlekey: singlekey(); break; - case addr_dumpkeypad: dumpkeypad(); break; - case addr_usemenu: usemenu(); break; - case addr_dumpmenu: dumpmenu(); break; - case addr_getundermenu: getundermenu(); break; - case addr_putundermenu: putundermenu(); break; - case addr_showoutermenu: showoutermenu(); break; - case addr_showmenu: showmenu(); break; - case addr_loadmenu: loadmenu(); break; - case addr_viewfolder: viewfolder(); break; - case addr_nextfolder: nextfolder(); break; - case addr_folderhints: folderhints(); break; - case addr_lastfolder: lastfolder(); break; - case addr_loadfolder: loadfolder(); break; - case addr_showfolder: showfolder(); break; - case addr_folderexit: folderexit(); break; - case addr_showleftpage: showleftpage(); break; - case addr_showrightpage: showrightpage(); break; - case addr_entersymbol: entersymbol(); break; - case addr_quitsymbol: quitsymbol(); break; - case addr_settopleft: settopleft(); break; - case addr_settopright: settopright(); break; - case addr_setbotleft: setbotleft(); break; - case addr_setbotright: setbotright(); break; - case addr_dumpsymbol: dumpsymbol(); break; - case addr_showsymbol: showsymbol(); break; - case addr_nextsymbol: nextsymbol(); break; - case addr_updatesymboltop: updatesymboltop(); break; - case addr_updatesymbolbot: updatesymbolbot(); break; - case addr_dumpsymbox: dumpsymbox(); break; - case addr_usediary: usediary(); break; - case addr_showdiary: showdiary(); break; - case addr_showdiarykeys: showdiarykeys(); break; - case addr_dumpdiarykeys: dumpdiarykeys(); break; - case addr_diarykeyp: diarykeyp(); break; - case addr_diarykeyn: diarykeyn(); break; - case addr_showdiarypage: showdiarypage(); break; - case addr_findtext1: findtext1(); break; - case addr_zoomonoff: zoomonoff(); break; - case addr_saveload: saveload(); break; - case addr_dosaveload: dosaveload(); break; - case addr_getbackfromops: getbackfromops(); break; - case addr_showmainops: showmainops(); break; - case addr_showdiscops: showdiscops(); break; - case addr_loadsavebox: loadsavebox(); break; - case addr_loadgame: loadgame(); break; - case addr_getbacktoops: getbacktoops(); break; - case addr_discops: discops(); break; - case addr_savegame: savegame(); break; - case addr_actualsave: actualsave(); break; - case addr_actualload: actualload(); break; - case addr_selectslot2: selectslot2(); break; - case addr_checkinput: checkinput(); break; - case addr_getnamepos: getnamepos(); break; - case addr_showopbox: showopbox(); break; - case addr_showloadops: showloadops(); break; - case addr_showsaveops: showsaveops(); break; - case addr_selectslot: selectslot(); break; - case addr_showslots: showslots(); break; - case addr_shownames: shownames(); break; - case addr_dosreturn: dosreturn(); break; - case addr_error: error(); break; - case addr_namestoold: namestoold(); break; - case addr_oldtonames: oldtonames(); break; - case addr_savefilewrite: savefilewrite(); break; - case addr_savefileread: savefileread(); break; - case addr_saveposition: saveposition(); break; - case addr_loadposition: loadposition(); break; - case addr_loadseg: loadseg(); break; - case addr_makeheader: makeheader(); break; - case addr_storeit: storeit(); break; - case addr_saveseg: saveseg(); break; - case addr_scanfornames: scanfornames(); break; - case addr_decide: decide(); break; - case addr_showdecisions: showdecisions(); break; - case addr_newgame: newgame(); break; - case addr_loadold: loadold(); break; - case addr_loadspeech: loadspeech(); break; - case addr_createname: createname(); break; - case addr_loadsample: loadsample(); break; - case addr_loadsecondsample: loadsecondsample(); break; - case addr_soundstartup: soundstartup(); break; - case addr_trysoundalloc: trysoundalloc(); break; - case addr_setsoundoff: setsoundoff(); break; - case addr_checksoundint: checksoundint(); break; - case addr_enablesoundint: enablesoundint(); break; - case addr_disablesoundint: disablesoundint(); break; - case addr_interupttest: interupttest(); break; - case addr_soundend: soundend(); break; - case addr_out22c: out22c(); break; - case addr_playchannel0: playchannel0(); break; - case addr_playchannel1: playchannel1(); break; - case addr_volumeadjust: volumeadjust(); break; - case addr_channel0only: channel0only(); break; - case addr_channel1only: channel1only(); break; - case addr_bothchannels: bothchannels(); break; - case addr_saveems: saveems(); break; - case addr_restoreems: restoreems(); break; - case addr_dmaend: dmaend(); break; - case addr_startdmablock: startdmablock(); break; - case addr_setuppit: setuppit(); break; - case addr_getridofpit: getridofpit(); break; - case addr_pitinterupt: pitinterupt(); break; - case addr_dreamweb: dreamweb(); break; - case addr_entrytexts: entrytexts(); break; - case addr_entryanims: entryanims(); break; - case addr_initialinv: initialinv(); break; - case addr_pickupob: pickupob(); break; - case addr_setupemm: setupemm(); break; - case addr_removeemm: removeemm(); break; - case addr_checkforemm: checkforemm(); break; - case addr_checkbasemem: checkbasemem(); break; - case addr_allocatebuffers: allocatebuffers(); break; - case addr_clearbuffers: clearbuffers(); break; - case addr_clearchanges: clearchanges(); break; - case addr_clearbeforeload: clearbeforeload(); break; - case addr_clearreels: clearreels(); break; - case addr_clearrest: clearrest(); break; - case addr_deallocatemem: deallocatemem(); break; - case addr_allocatemem: allocatemem(); break; - case addr_startup: startup(); break; - case addr_startup1: startup1(); break; - case addr_screenupdate: screenupdate(); break; - case addr_watchreel: watchreel(); break; - case addr_checkforshake: checkforshake(); break; - case addr_watchcount: watchcount(); break; - case addr_showtime: showtime(); break; - case addr_dumpwatch: dumpwatch(); break; - case addr_showbyte: showbyte(); break; - case addr_onedigit: onedigit(); break; - case addr_twodigitnum: twodigitnum(); break; - case addr_showword: showword(); break; - case addr_convnum: convnum(); break; - case addr_mainscreen: mainscreen(); break; - case addr_madmanrun: madmanrun(); break; - case addr_identifyob: identifyob(); break; - case addr_findpathofpoint: findpathofpoint(); break; - case addr_findfirstpath: findfirstpath(); break; - case addr_afternewroom: afternewroom(); break; - case addr_atmospheres: atmospheres(); break; - case addr_walkintoroom: walkintoroom(); break; - case addr_afterintroroom: afterintroroom(); break; - case addr_printmessage2: printmessage2(); break; - case addr_setwalk: setwalk(); break; - case addr_workoutframes: workoutframes(); break; - case addr_showicon: showicon(); break; - case addr_middlepanel: middlepanel(); break; - case addr_showman: showman(); break; - case addr_roomname: roomname(); break; - case addr_usecharset1: usecharset1(); break; - case addr_usetempcharset: usetempcharset(); break; - case addr_showexit: showexit(); break; - case addr_panelicons1: panelicons1(); break; - case addr_showwatch: showwatch(); break; - case addr_gettime: gettime(); break; - case addr_zoomicon: zoomicon(); break; - case addr_worktoscreenm: worktoscreenm(); break; - case addr_blank: blank(); break; - case addr_allpointer: allpointer(); break; - case addr_hangonw: hangonw(); break; - case addr_hangoncurs: hangoncurs(); break; - case addr_getunderzoom: getunderzoom(); break; - case addr_dumpzoom: dumpzoom(); break; - case addr_putunderzoom: putunderzoom(); break; - case addr_undertextline: undertextline(); break; - case addr_setmouse: setmouse(); break; - case addr_mousecall: mousecall(); break; - case addr_readkey: readkey(); break; - case addr_randomnum1: randomnum1(); break; - case addr_randomnum2: randomnum2(); break; - case addr_loadtraveltext: loadtraveltext(); break; - case addr_loadintotemp: loadintotemp(); break; - case addr_loadintotemp2: loadintotemp2(); break; - case addr_loadintotemp3: loadintotemp3(); break; - case addr_loadtempcharset: loadtempcharset(); break; - case addr_standardload: standardload(); break; - case addr_loadtemptext: loadtemptext(); break; - case addr_loadroom: loadroom(); break; - case addr_loadroomssample: loadroomssample(); break; - case addr_getridofreels: getridofreels(); break; - case addr_getridofall: getridofall(); break; - case addr_restorereels: restorereels(); break; - case addr_restoreall: restoreall(); break; - case addr_sortoutmap: sortoutmap(); break; - case addr_disablepath: disablepath(); break; - case addr_findroominloc: findroominloc(); break; - case addr_dontloadseg: dontloadseg(); break; - case addr_allocateload: allocateload(); break; - case addr_getridoftemp: getridoftemp(); break; - case addr_getridoftemptext: getridoftemptext(); break; - case addr_getridoftemp2: getridoftemp2(); break; - case addr_getridoftemp3: getridoftemp3(); break; - case addr_getridoftempcharset: getridoftempcharset(); break; - case addr_getridoftempsp: getridoftempsp(); break; - case addr_readsetdata: readsetdata(); break; - case addr_createfile: createfile(); break; - case addr_openfile: openfile(); break; - case addr_openfilefromc: openfilefromc(); break; - case addr_openfilenocheck: openfilenocheck(); break; - case addr_openforsave: openforsave(); break; - case addr_closefile: closefile(); break; - case addr_readfromfile: readfromfile(); break; - case addr_setkeyboardint: setkeyboardint(); break; - case addr_resetkeyboard: resetkeyboard(); break; - case addr_keyboardread: keyboardread(); break; - case addr_doload: doload(); break; - case addr_generalerror: generalerror(); break; - default: ::error("invalid call to %04x dispatched", (uint16)ax); - } + dreamweb(); } -} /*namespace*/ +} // End of namespace DreamGen diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 729b802b41..ae9bf3bb06 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -25,1977 +25,593 @@ * */ +#include "dreamweb/runtime.h" +#include "dreamweb/structs.h" +#include "dreamweb/dreambase.h" +namespace DreamGen { -#include "dreamweb/runtime.h" +static const uint16 offset_rootdir = 0x0457; +static const uint16 offset_money2poke = 0x0478; +static const uint16 offset_keys = 0x03df; +static const uint16 offset_money1poke = 0x0473; +static const uint16 offset_comlist = 0x03a3; +static const uint16 offset_openchangesize = 0x03a1; +static const uint16 offset_commandline = 0x0480; +static const uint16 offset_operand1 = 0x0449; +static const uint16 kStartvars = 0; +static const uint16 kProgresspoints = 1; +static const uint16 kWatchon = 2; +static const uint16 kShadeson = 3; +static const uint16 kSecondcount = 4; +static const uint16 kMinutecount = 5; +static const uint16 kHourcount = 6; +static const uint16 kZoomon = 7; +static const uint16 kLocation = 8; +static const uint16 kExpos = 9; +static const uint16 kExframepos = 10; +static const uint16 kExtextpos = 12; +static const uint16 kCard1money = 14; +static const uint16 kListpos = 16; +static const uint16 kRyanpage = 18; +static const uint16 kWatchingtime = 19; +static const uint16 kReeltowatch = 21; +static const uint16 kEndwatchreel = 23; +static const uint16 kSpeedcount = 25; +static const uint16 kWatchspeed = 26; +static const uint16 kReeltohold = 27; +static const uint16 kEndofholdreel = 29; +static const uint16 kWatchmode = 31; +static const uint16 kDestafterhold = 32; +static const uint16 kNewsitem = 33; +static const uint16 kLiftflag = 34; +static const uint16 kLiftpath = 35; +static const uint16 kLockstatus = 36; +static const uint16 kDoorpath = 37; +static const uint16 kCounttoopen = 38; +static const uint16 kCounttoclose = 39; +static const uint16 kRockstardead = 40; +static const uint16 kGeneraldead = 41; +static const uint16 kSartaindead = 42; +static const uint16 kAidedead = 43; +static const uint16 kBeenmugged = 44; +static const uint16 kGunpassflag = 45; +static const uint16 kCanmovealtar = 46; +static const uint16 kTalkedtoattendant = 47; +static const uint16 kTalkedtosparky = 48; +static const uint16 kTalkedtoboss = 49; +static const uint16 kTalkedtorecep = 50; +static const uint16 kCardpassflag = 51; +static const uint16 kMadmanflag = 52; +static const uint16 kKeeperflag = 53; +static const uint16 kLasttrigger = 54; +static const uint16 kMandead = 55; +static const uint16 kSeed = 56; +static const uint16 kNeedtotravel = 59; +static const uint16 kThroughdoor = 60; +static const uint16 kNewobs = 61; +static const uint16 kRyanon = 62; +static const uint16 kCombatcount = 63; +static const uint16 kLastweapon = 64; +static const uint16 kDreamnumber = 65; +static const uint16 kRoomafterdream = 66; +static const uint16 kShakecounter = 67; +static const uint16 kSpeechcount = 68; +static const uint16 kCharshift = 69; +static const uint16 kKerning = 71; +static const uint16 kBrightness = 72; +static const uint16 kRoomloaded = 73; +static const uint16 kDidzoom = 74; +static const uint16 kLinespacing = 75; +static const uint16 kTextaddressx = 77; +static const uint16 kTextaddressy = 79; +static const uint16 kTextlen = 81; +static const uint16 kLastxpos = 82; +static const uint16 kIcontop = 84; +static const uint16 kIconleft = 86; +static const uint16 kItemframe = 88; +static const uint16 kItemtotran = 89; +static const uint16 kRoomad = 90; +static const uint16 kOldsubject = 92; +static const uint16 kWithobject = 94; +static const uint16 kWithtype = 95; +static const uint16 kLookcounter = 96; +static const uint16 kCommand = 98; +static const uint16 kCommandtype = 99; +static const uint16 kOldcommandtype = 100; +static const uint16 kObjecttype = 101; +static const uint16 kGetback = 102; +static const uint16 kInvopen = 103; +static const uint16 kMainmode = 104; +static const uint16 kPickup = 105; +static const uint16 kLastinvpos = 106; +static const uint16 kExamagain = 107; +static const uint16 kNewtextline = 108; +static const uint16 kOpenedob = 109; +static const uint16 kOpenedtype = 110; +static const uint16 kOldmapadx = 111; +static const uint16 kOldmapady = 113; +static const uint16 kMapadx = 115; +static const uint16 kMapady = 117; +static const uint16 kMapoffsetx = 119; +static const uint16 kMapoffsety = 121; +static const uint16 kMapxstart = 123; +static const uint16 kMapystart = 125; +static const uint16 kMapxsize = 127; +static const uint16 kMapysize = 128; +static const uint16 kHavedoneobs = 129; +static const uint16 kManisoffscreen = 130; +static const uint16 kRainspace = 131; +static const uint16 kFacing = 132; +static const uint16 kLeavedirection = 133; +static const uint16 kTurntoface = 134; +static const uint16 kTurndirection = 135; +static const uint16 kMaintimer = 136; +static const uint16 kIntrocount = 138; +static const uint16 kArrowad = 139; +static const uint16 kCurrentkey = 141; +static const uint16 kOldkey = 142; +static const uint16 kUseddirection = 143; +static const uint16 kCurrentkey2 = 144; +static const uint16 kTimercount = 145; +static const uint16 kOldtimercount = 146; +static const uint16 kMapx = 147; +static const uint16 kMapy = 148; +static const uint16 kNewscreen = 149; +static const uint16 kRyanx = 150; +static const uint16 kRyany = 151; +static const uint16 kLastflag = 152; +static const uint16 kLastflagex = 153; +static const uint16 kFlagx = 154; +static const uint16 kFlagy = 155; +static const uint16 kCurrentex = 156; +static const uint16 kCurrentfree = 157; +static const uint16 kFramesad = 158; +static const uint16 kDataad = 160; +static const uint16 kFrsegment = 162; +static const uint16 kObjectx = 164; +static const uint16 kObjecty = 166; +static const uint16 kOffsetx = 168; +static const uint16 kOffsety = 170; +static const uint16 kSavesize = 172; +static const uint16 kSavesource = 174; +static const uint16 kSavex = 176; +static const uint16 kSavey = 177; +static const uint16 kCurrentob = 178; +static const uint16 kPrioritydep = 179; +static const uint16 kDestpos = 180; +static const uint16 kReallocation = 181; +static const uint16 kRoomnum = 182; +static const uint16 kNowinnewroom = 183; +static const uint16 kResetmanxy = 184; +static const uint16 kNewlocation = 185; +static const uint16 kAutolocation = 186; +static const uint16 kMustload = 187; +static const uint16 kAnswered = 188; +static const uint16 kSaidno = 189; +static const uint16 kDoorcheck1 = 190; +static const uint16 kDoorcheck2 = 191; +static const uint16 kDoorcheck3 = 192; +static const uint16 kDoorcheck4 = 193; +static const uint16 kMousex = 194; +static const uint16 kMousey = 196; +static const uint16 kMousebutton = 198; +static const uint16 kMousebutton1 = 200; +static const uint16 kMousebutton2 = 202; +static const uint16 kMousebutton3 = 204; +static const uint16 kMousebutton4 = 206; +static const uint16 kOldbutton = 208; +static const uint16 kOldx = 210; +static const uint16 kOldy = 212; +static const uint16 kLastbutton = 214; +static const uint16 kOldpointerx = 216; +static const uint16 kOldpointery = 218; +static const uint16 kDelherex = 220; +static const uint16 kDelherey = 222; +static const uint16 kPointerxs = 224; +static const uint16 kPointerys = 225; +static const uint16 kDelxs = 226; +static const uint16 kDelys = 227; +static const uint16 kPointerframe = 228; +static const uint16 kPointerpower = 229; +static const uint16 kAuxpointerframe = 230; +static const uint16 kPointermode = 231; +static const uint16 kPointerspeed = 232; +static const uint16 kPointercount = 233; +static const uint16 kInmaparea = 234; +static const uint16 kSlotdata = 235; +static const uint16 kThisslot = 236; +static const uint16 kSlotflags = 237; +static const uint16 kTalkmode = 238; +static const uint16 kTalkpos = 239; +static const uint16 kCharacter = 240; +static const uint16 kPersondata = 241; +static const uint16 kTalknum = 243; +static const uint16 kNumberinroom = 244; +static const uint16 kCurrentcel = 245; +static const uint16 kOldselection = 246; +static const uint16 kStopwalking = 247; +static const uint16 kMouseon = 248; +static const uint16 kPlayed = 249; +static const uint16 kTimer1 = 251; +static const uint16 kTimer2 = 252; +static const uint16 kTimer3 = 253; +static const uint16 kWholetimer = 254; +static const uint16 kTimer1to = 256; +static const uint16 kTimer2to = 257; +static const uint16 kTimer3to = 258; +static const uint16 kWatchdump = 259; +static const uint16 kLogonum = 260; +static const uint16 kOldlogonum = 261; +static const uint16 kNewlogonum = 262; +static const uint16 kNetseg = 263; +static const uint16 kNetpoint = 265; +static const uint16 kKeynum = 267; +static const uint16 kCursorstate = 268; +static const uint16 kPressed = 269; +static const uint16 kPresspointer = 270; +static const uint16 kGraphicpress = 272; +static const uint16 kPresscount = 273; +static const uint16 kKeypadax = 274; +static const uint16 kKeypadcx = 276; +static const uint16 kLightcount = 278; +static const uint16 kFolderpage = 279; +static const uint16 kDiarypage = 280; +static const uint16 kMenucount = 281; +static const uint16 kSymboltopx = 282; +static const uint16 kSymboltopnum = 283; +static const uint16 kSymboltopdir = 284; +static const uint16 kSymbolbotx = 285; +static const uint16 kSymbolbotnum = 286; +static const uint16 kSymbolbotdir = 287; +static const uint16 kSymboltolight = 288; +static const uint16 kSymbol1 = 289; +static const uint16 kSymbol2 = 290; +static const uint16 kSymbol3 = 291; +static const uint16 kSymbolnum = 292; +static const uint16 kDumpx = 293; +static const uint16 kDumpy = 295; +static const uint16 kWalkandexam = 297; +static const uint16 kWalkexamtype = 298; +static const uint16 kWalkexamnum = 299; +static const uint16 kCursloc = 300; +static const uint16 kCurslocx = 302; +static const uint16 kCurslocy = 304; +static const uint16 kCurpos = 306; +static const uint16 kMonadx = 308; +static const uint16 kMonady = 310; +static const uint16 kGotfrom = 312; +static const uint16 kMonsource = 314; +static const uint16 kNumtodo = 316; +static const uint16 kTimecount = 318; +static const uint16 kCounttotimed = 320; +static const uint16 kTimedseg = 322; +static const uint16 kTimedoffset = 324; +static const uint16 kTimedy = 326; +static const uint16 kTimedx = 327; +static const uint16 kNeedtodumptimed = 328; +static const uint16 kLoadingorsave = 329; +static const uint16 kCurrentslot = 330; +static const uint16 kCursorpos = 331; +static const uint16 kColourpos = 332; +static const uint16 kFadedirection = 333; +static const uint16 kNumtofade = 334; +static const uint16 kFadecount = 335; +static const uint16 kAddtogreen = 336; +static const uint16 kAddtored = 337; +static const uint16 kAddtoblue = 338; +static const uint16 kLastsoundreel = 339; +static const uint16 kSpeechloaded = 341; +static const uint16 kSpeechlength = 342; +static const uint16 kVolume = 344; +static const uint16 kVolumeto = 345; +static const uint16 kVolumedirection = 346; +static const uint16 kVolumecount = 347; +static const uint16 kPlayblock = 348; +static const uint16 kWongame = 349; +static const uint16 kLasthardkey = 350; +static const uint16 kBufferin = 351; +static const uint16 kBufferout = 353; +static const uint16 kExtras = 355; +static const uint16 kWorkspace = 357; +static const uint16 kMapstore = 359; +static const uint16 kCharset1 = 361; +static const uint16 kBuffers = 363; +static const uint16 kMainsprites = 365; +static const uint16 kBackdrop = 367; +static const uint16 kMapdata = 369; +static const uint16 kSounddata = 371; +static const uint16 kSounddata2 = 373; +static const uint16 kRecordspace = 375; +static const uint16 kFreedat = 377; +static const uint16 kSetdat = 379; +static const uint16 kReel1 = 381; +static const uint16 kReel2 = 383; +static const uint16 kReel3 = 385; +static const uint16 kRoomdesc = 387; +static const uint16 kFreedesc = 389; +static const uint16 kSetdesc = 391; +static const uint16 kBlockdesc = 393; +static const uint16 kSetframes = 395; +static const uint16 kFreeframes = 397; +static const uint16 kPeople = 399; +static const uint16 kReels = 401; +static const uint16 kCommandtext = 403; +static const uint16 kPuzzletext = 405; +static const uint16 kTraveltext = 407; +static const uint16 kTempgraphics = 409; +static const uint16 kTempgraphics2 = 411; +static const uint16 kTempgraphics3 = 413; +static const uint16 kTempsprites = 415; +static const uint16 kTextfile1 = 417; +static const uint16 kTextfile2 = 419; +static const uint16 kTextfile3 = 421; +static const uint16 kBlinkframe = 423; +static const uint16 kBlinkcount = 424; +static const uint16 kReasseschanges = 425; +static const uint16 kPointerspath = 426; +static const uint16 kManspath = 427; +static const uint16 kPointerfirstpath = 428; +static const uint16 kFinaldest = 429; +static const uint16 kDestination = 430; +static const uint16 kLinestartx = 431; +static const uint16 kLinestarty = 433; +static const uint16 kLineendx = 435; +static const uint16 kLineendy = 437; +static const uint16 kIncrement1 = 439; +static const uint16 kIncrement2 = 441; +static const uint16 kLineroutine = 443; +static const uint16 kLinepointer = 444; +static const uint16 kLinedirection = 445; +static const uint16 kLinelength = 446; +static const uint16 kLiftsoundcount = 447; +static const uint16 kCh0blockstocopy = 448; +static const uint16 kCh0playing = 450; +static const uint16 kCh0repeat = 451; +static const uint16 kCh1playing = 452; +static const uint16 kCh1blockstocopy = 453; +static const uint16 kSoundbufferwrite = 455; +static const uint16 kCurrentsample = 457; +static const uint16 kRoomssample = 458; +static const uint16 kReelroutines = 459; +static const uint16 kBasicsample = 916; +static const uint16 kCurrentfile = 1125; +static const uint16 kRoomscango = 1249; +static const uint16 kRoompics = 1265; +static const uint16 kOplist = 1280; +static const uint16 kInputline = 1283; +static const uint16 kPresslist = 1411; +static const uint16 kQuitrequested = 1417; +static const uint16 kSubtitles = 1418; +static const uint16 kForeignrelease = 1419; +static const uint16 kBlocktextdat = (0); +static const uint16 kPersonframes = (0); +static const uint16 kDebuglevel1 = (0); +static const uint16 kDebuglevel2 = (0); +static const uint16 kPlayback = (0); +static const uint16 kMap = (0); +static const uint16 kSettextdat = (0); +static const uint16 kSpanish = (0); +static const uint16 kFramedata = (0); +static const uint16 kRecording = (0); +static const uint16 kFlags = (0); +static const uint16 kGerman = (0); +static const uint16 kTextunder = (0); +static const uint16 kPathdata = (0); +static const uint16 kDemo = (0); +static const uint16 kExframedata = (0); +static const uint16 kIntextdat = (0); +static const uint16 kFreetextdat = (0); +static const uint16 kFrframedata = (0); +static const uint16 kSettext = (0+(130*2)); +static const uint16 kOpeninvlist = (0+(228*13)); +static const uint16 kRyaninvlist = (0+(228*13)+32); +static const uint16 kPointerback = (0+(228*13)+32+60); +static const uint16 kMapflags = (0+(228*13)+32+60+(32*32)); +static const uint16 kStartpal = (0+(228*13)+32+60+(32*32)+(11*10*3)); +static const uint16 kEndpal = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); +static const uint16 kMaingamepal = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); +static const uint16 kSpritetable = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); +static const uint16 kSetlist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)); +static const uint16 kFreelist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); +static const uint16 kExlist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); +static const uint16 kPeoplelist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); +static const uint16 kZoomspace = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); +static const uint16 kPrintedlist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)); +static const uint16 kListofchanges = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); +static const uint16 kUndertimedtext = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)); +static const uint16 kRainlist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)); +static const uint16 kInitialreelrouts = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)); +static const uint16 kInitialvars = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+916-459); +static const uint16 kLengthofbuffer = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+916-459+68-0); +static const uint16 kReellist = (0+(36*144)); +static const uint16 kIntext = (0+(38*2)); +static const uint16 kLengthofmap = (0+(66*60)); +static const uint16 kFreetext = (0+(82*2)); +static const uint16 kBlocktext = (0+(98*2)); +static const uint16 kBlocks = (0+192); +static const uint16 kFrframes = (0+2080); +static const uint16 kExframes = (0+2080); +static const uint16 kFrames = (0+2080); +static const uint16 kExdata = (0+2080+30000); +static const uint16 kExtextdat = (0+2080+30000+(16*114)); +static const uint16 kExtext = (0+2080+30000+(16*114)+((114+2)*2)); +static const uint16 kLengthofextra = (0+2080+30000+(16*114)+((114+2)*2)+18000); +static const uint16 kPersontxtdat = (0+24); +static const uint16 kPersontext = (0+24+(1026*2)); +static const uint16 kInputport = (0x63); +static const uint16 kForeign = (1); +static const uint16 kCd = (1); +static const uint16 kNumexobjects = (114); +static const uint16 kUndertextsizey = (13); +static const uint16 kZoomy = (132); +static const uint16 kFreedatlen = (16*80); +static const uint16 kExtextlen = (18000); +static const uint16 kLenofmapstore = (22*8*20*8); +static const uint16 kUndertextsizex = (228); +static const uint16 kNumchanges = (250); +static const uint16 kUndertimedysize = (30); +static const uint16 kExframeslen = (30000); +static const uint16 kTablesize = (32); +static const uint16 kScreenwidth = (320); +static const uint16 kKeypadx = (36+112); +static const uint16 kItempicsize = (44); +static const uint16 kDiaryy = (48+12); +static const uint16 kOpsy = (52); +static const uint16 kSymboly = (56); +static const uint16 kInventy = (58); +static const uint16 kMenuy = (60); +static const uint16 kOpsx = (60); +static const uint16 kMaplength = (60); +static const uint16 kSymbolx = (64); +static const uint16 kSetdatlen = (64*128); +static const uint16 kMapwidth = (66); +static const uint16 kTextstart = (66*2); +static const uint16 kMaplen = (66*60); +static const uint16 kDiaryx = (68+24); +static const uint16 kLengthofvars = (68-0); +static const uint16 kKeypady = (72); +static const uint16 kZoomx = (8); +static const uint16 kInventx = (80); +static const uint16 kMenux = (80+40); +static const uint16 kLenofreelrouts = (916-459); +static const uint16 kHeaderlen = (96); -namespace DreamGen { -#include "structs.h" -class DreamGenContext : public Context { + +class DreamGenContext : public DreamBase, public Context { public: + DreamGenContext(DreamWeb::DreamWebEngine *en) : DreamBase(en), Context(this) {} + void __start(); - void __dispatch_call(uint16 addr); #include "stubs.h" // Allow hand-reversed functions to have a signature different than void f() - static const uint16 addr_dreamweb = 0xc948; - static const uint16 addr_keyboardread = 0xcbb4; - static const uint16 addr_resetkeyboard = 0xcbb0; - static const uint16 addr_setkeyboardint = 0xcbac; - static const uint16 addr_readfromfile = 0xcba8; - static const uint16 addr_closefile = 0xcba4; - static const uint16 addr_openforsave = 0xcba0; - static const uint16 addr_openfilenocheck = 0xcb9c; - static const uint16 addr_openfilefromc = 0xcb94; - static const uint16 addr_openfile = 0xcb90; - static const uint16 addr_createfile = 0xcb8c; - static const uint16 addr_readsetdata = 0xcb88; - static const uint16 addr_getridoftempsp = 0xcb84; - static const uint16 addr_getridoftempcharset = 0xcb80; - static const uint16 addr_getridoftemp3 = 0xcb7c; - static const uint16 addr_getridoftemp2 = 0xcb78; - static const uint16 addr_getridoftemptext = 0xcb74; - static const uint16 addr_getridoftemp = 0xcb70; - static const uint16 addr_allocateload = 0xcb68; - static const uint16 addr_dontloadseg = 0xcb64; - static const uint16 addr_findroominloc = 0xcb58; - static const uint16 addr_disablepath = 0xcb50; - static const uint16 addr_sortoutmap = 0xcb48; - static const uint16 addr_restoreall = 0xcb44; - static const uint16 addr_restorereels = 0xcb40; - static const uint16 addr_getridofall = 0xcb3c; - static const uint16 addr_getridofreels = 0xcb38; - static const uint16 addr_loadroomssample = 0xcb34; - static const uint16 addr_loadroom = 0xcb30; - static const uint16 addr_loadtemptext = 0xcb2c; - static const uint16 addr_standardload = 0xcb28; - static const uint16 addr_loadtempcharset = 0xcb24; - static const uint16 addr_loadintotemp3 = 0xcb20; - static const uint16 addr_loadintotemp2 = 0xcb1c; - static const uint16 addr_loadintotemp = 0xcb18; - static const uint16 addr_loadtraveltext = 0xcb14; - static const uint16 addr_randomnum2 = 0xcb08; - static const uint16 addr_randomnum1 = 0xcb04; - static const uint16 addr_readkey = 0xcafc; - static const uint16 addr_mousecall = 0xcae8; - static const uint16 addr_setmouse = 0xcae0; - static const uint16 addr_undertextline = 0xcad0; - static const uint16 addr_putunderzoom = 0xcabc; - static const uint16 addr_dumpzoom = 0xcab8; - static const uint16 addr_getunderzoom = 0xcab4; - static const uint16 addr_hangoncurs = 0xcab0; - static const uint16 addr_hangonw = 0xcaac; - static const uint16 addr_allpointer = 0xcaa4; - static const uint16 addr_blank = 0xcaa0; - static const uint16 addr_worktoscreenm = 0xca9c; - static const uint16 addr_zoomicon = 0xca90; - static const uint16 addr_gettime = 0xca8c; - static const uint16 addr_showwatch = 0xca88; - static const uint16 addr_panelicons1 = 0xca84; - static const uint16 addr_showexit = 0xca80; - static const uint16 addr_usetempcharset = 0xca7c; - static const uint16 addr_usecharset1 = 0xca78; - static const uint16 addr_roomname = 0xca74; - static const uint16 addr_showman = 0xca6c; - static const uint16 addr_middlepanel = 0xca68; - static const uint16 addr_showicon = 0xca64; - static const uint16 addr_workoutframes = 0xca54; - static const uint16 addr_setwalk = 0xca44; - static const uint16 addr_printmessage2 = 0xca30; - static const uint16 addr_afterintroroom = 0xca14; - static const uint16 addr_walkintoroom = 0xca10; - static const uint16 addr_atmospheres = 0xca0c; - static const uint16 addr_afternewroom = 0xca08; - static const uint16 addr_findfirstpath = 0xc9f0; - static const uint16 addr_findpathofpoint = 0xc9ec; - static const uint16 addr_identifyob = 0xc9d4; - static const uint16 addr_madmanrun = 0xc9cc; - static const uint16 addr_mainscreen = 0xc9c8; - static const uint16 addr_convnum = 0xc9c4; - static const uint16 addr_showword = 0xc9c0; - static const uint16 addr_twodigitnum = 0xc9bc; - static const uint16 addr_onedigit = 0xc9b8; - static const uint16 addr_showbyte = 0xc9b4; - static const uint16 addr_dumpwatch = 0xc9b0; - static const uint16 addr_showtime = 0xc9ac; - static const uint16 addr_watchcount = 0xc9a8; - static const uint16 addr_checkforshake = 0xc9a4; - static const uint16 addr_watchreel = 0xc9a0; - static const uint16 addr_screenupdate = 0xc99c; - static const uint16 addr_startup1 = 0xc998; - static const uint16 addr_startup = 0xc994; - static const uint16 addr_allocatemem = 0xc988; - static const uint16 addr_deallocatemem = 0xc984; - static const uint16 addr_clearrest = 0xc980; - static const uint16 addr_clearreels = 0xc97c; - static const uint16 addr_clearbeforeload = 0xc978; - static const uint16 addr_clearchanges = 0xc974; - static const uint16 addr_clearbuffers = 0xc970; - static const uint16 addr_allocatebuffers = 0xc96c; - static const uint16 addr_checkbasemem = 0xc968; - static const uint16 addr_checkforemm = 0xc964; - static const uint16 addr_removeemm = 0xc960; - static const uint16 addr_setupemm = 0xc95c; - static const uint16 addr_pickupob = 0xc958; - static const uint16 addr_initialinv = 0xc954; - static const uint16 addr_entryanims = 0xc950; - static const uint16 addr_entrytexts = 0xc94c; - static const uint16 addr_pitinterupt = 0xc944; - static const uint16 addr_getridofpit = 0xc940; - static const uint16 addr_setuppit = 0xc93c; - static const uint16 addr_startdmablock = 0xc938; - static const uint16 addr_dmaend = 0xc934; - static const uint16 addr_restoreems = 0xc92c; - static const uint16 addr_saveems = 0xc928; - static const uint16 addr_bothchannels = 0xc924; - static const uint16 addr_channel1only = 0xc91c; - static const uint16 addr_channel0only = 0xc918; - static const uint16 addr_volumeadjust = 0xc908; - static const uint16 addr_playchannel1 = 0xc900; - static const uint16 addr_playchannel0 = 0xc8fc; - static const uint16 addr_out22c = 0xc8f8; - static const uint16 addr_soundend = 0xc8f4; - static const uint16 addr_interupttest = 0xc8f0; - static const uint16 addr_disablesoundint = 0xc8ec; - static const uint16 addr_enablesoundint = 0xc8e8; - static const uint16 addr_checksoundint = 0xc8e4; - static const uint16 addr_setsoundoff = 0xc8e0; - static const uint16 addr_trysoundalloc = 0xc8dc; - static const uint16 addr_soundstartup = 0xc8d8; - static const uint16 addr_loadsecondsample = 0xc8d4; - static const uint16 addr_loadsample = 0xc8d0; - static const uint16 addr_createname = 0xc8cc; - static const uint16 addr_loadspeech = 0xc8c8; - static const uint16 addr_loadold = 0xc8c4; - static const uint16 addr_doload = 0xcbb8; - static const uint16 addr_newgame = 0xc8c0; - static const uint16 addr_showdecisions = 0xc8bc; - static const uint16 addr_decide = 0xc8b8; - static const uint16 addr_scanfornames = 0xc8b4; - static const uint16 addr_saveseg = 0xc8ac; - static const uint16 addr_storeit = 0xc8a8; - static const uint16 addr_makeheader = 0xc8a4; - static const uint16 addr_loadseg = 0xc8a0; - static const uint16 addr_loadposition = 0xc89c; - static const uint16 addr_saveposition = 0xc898; - static const uint16 addr_savefileread = 0xc894; - static const uint16 addr_savefilewrite = 0xc890; - static const uint16 addr_oldtonames = 0xc88c; - static const uint16 addr_namestoold = 0xc888; - static const uint16 addr_error = 0xc884; - static const uint16 addr_generalerror = 0xcbbc; - static const uint16 addr_dosreturn = 0xc880; - static const uint16 addr_shownames = 0xc87c; - static const uint16 addr_showslots = 0xc878; - static const uint16 addr_selectslot = 0xc874; - static const uint16 addr_showsaveops = 0xc870; - static const uint16 addr_showloadops = 0xc86c; - static const uint16 addr_showopbox = 0xc868; - static const uint16 addr_getnamepos = 0xc864; - static const uint16 addr_checkinput = 0xc860; - static const uint16 addr_selectslot2 = 0xc85c; - static const uint16 addr_actualload = 0xc858; - static const uint16 addr_actualsave = 0xc854; - static const uint16 addr_savegame = 0xc850; - static const uint16 addr_discops = 0xc84c; - static const uint16 addr_getbacktoops = 0xc848; - static const uint16 addr_loadgame = 0xc844; - static const uint16 addr_loadsavebox = 0xc840; - static const uint16 addr_showdiscops = 0xc83c; - static const uint16 addr_showmainops = 0xc838; - static const uint16 addr_getbackfromops = 0xc834; - static const uint16 addr_dosaveload = 0xc830; - static const uint16 addr_saveload = 0xc82c; - static const uint16 addr_zoomonoff = 0xc828; - static const uint16 addr_findtext1 = 0xc824; - static const uint16 addr_showdiarypage = 0xc820; - static const uint16 addr_diarykeyn = 0xc81c; - static const uint16 addr_diarykeyp = 0xc818; - static const uint16 addr_dumpdiarykeys = 0xc814; - static const uint16 addr_showdiarykeys = 0xc810; - static const uint16 addr_showdiary = 0xc80c; - static const uint16 addr_usediary = 0xc808; - static const uint16 addr_dumpsymbox = 0xc804; - static const uint16 addr_updatesymbolbot = 0xc800; - static const uint16 addr_updatesymboltop = 0xc7fc; - static const uint16 addr_nextsymbol = 0xc7f8; - static const uint16 addr_showsymbol = 0xc7f4; - static const uint16 addr_dumpsymbol = 0xc7f0; - static const uint16 addr_setbotright = 0xc7ec; - static const uint16 addr_setbotleft = 0xc7e8; - static const uint16 addr_settopright = 0xc7e4; - static const uint16 addr_settopleft = 0xc7e0; - static const uint16 addr_quitsymbol = 0xc7dc; - static const uint16 addr_entersymbol = 0xc7d8; - static const uint16 addr_showrightpage = 0xc7d4; - static const uint16 addr_showleftpage = 0xc7d0; - static const uint16 addr_folderexit = 0xc7cc; - static const uint16 addr_showfolder = 0xc7c8; - static const uint16 addr_loadfolder = 0xc7c4; - static const uint16 addr_lastfolder = 0xc7c0; - static const uint16 addr_folderhints = 0xc7bc; - static const uint16 addr_nextfolder = 0xc7b8; - static const uint16 addr_viewfolder = 0xc7b4; - static const uint16 addr_loadmenu = 0xc7b0; - static const uint16 addr_showmenu = 0xc7ac; - static const uint16 addr_showoutermenu = 0xc7a8; - static const uint16 addr_putundermenu = 0xc7a4; - static const uint16 addr_getundermenu = 0xc7a0; - static const uint16 addr_dumpmenu = 0xc79c; - static const uint16 addr_usemenu = 0xc798; - static const uint16 addr_dumpkeypad = 0xc794; - static const uint16 addr_singlekey = 0xc790; - static const uint16 addr_showkeypad = 0xc78c; - static const uint16 addr_showouterpad = 0xc788; - static const uint16 addr_buttonpress = 0xc784; - static const uint16 addr_buttonenter = 0xc780; - static const uint16 addr_buttonnought = 0xc77c; - static const uint16 addr_buttonnine = 0xc778; - static const uint16 addr_buttoneight = 0xc774; - static const uint16 addr_buttonseven = 0xc770; - static const uint16 addr_buttonsix = 0xc76c; - static const uint16 addr_buttonfive = 0xc768; - static const uint16 addr_buttonfour = 0xc764; - static const uint16 addr_buttonthree = 0xc760; - static const uint16 addr_buttontwo = 0xc75c; - static const uint16 addr_buttonone = 0xc758; - static const uint16 addr_addtopresslist = 0xc754; - static const uint16 addr_quitkey = 0xc750; - static const uint16 addr_loadkeypad = 0xc74c; - static const uint16 addr_entercode = 0xc748; - static const uint16 addr_usewinch = 0xc744; - static const uint16 addr_useplate = 0xc740; - static const uint16 addr_usebuttona = 0xc73c; - static const uint16 addr_useshield = 0xc738; - static const uint16 addr_usegun = 0xc734; - static const uint16 addr_usechurchgate = 0xc730; - static const uint16 addr_usewall = 0xc72c; - static const uint16 addr_edenscdplayer = 0xc728; - static const uint16 addr_setuptimeduse = 0xc71c; - static const uint16 addr_autoappear = 0xc70c; - static const uint16 addr_switchryanoff = 0xc700; - static const uint16 addr_switchryanon = 0xc6fc; - static const uint16 addr_removefreeobject = 0xc6f4; - static const uint16 addr_placefreeobject = 0xc6f0; - static const uint16 addr_issetobonmap = 0xc6ec; - static const uint16 addr_findpuztext = 0xc6e0; - static const uint16 addr_showpuztext = 0xc6dc; - static const uint16 addr_putbackobstuff = 0xc6d8; - static const uint16 addr_checkinside = 0xc6d0; - static const uint16 addr_isryanholding = 0xc6cc; - static const uint16 addr_findexobject = 0xc6c8; - static const uint16 addr_findsetobject = 0xc6c4; - static const uint16 addr_selectob = 0xc6bc; - static const uint16 addr_withwhat = 0xc6b8; - static const uint16 addr_useelvdoor = 0xc6b4; - static const uint16 addr_useaxe = 0xc6b0; - static const uint16 addr_usecooker = 0xc6ac; - static const uint16 addr_usestereo = 0xc6a8; - static const uint16 addr_usekey = 0xc6a4; - static const uint16 addr_useelevator5 = 0xc6a0; - static const uint16 addr_useelevator2 = 0xc69c; - static const uint16 addr_useelevator4 = 0xc698; - static const uint16 addr_useelevator3 = 0xc694; - static const uint16 addr_showfirstuse = 0xc690; - static const uint16 addr_useelevator1 = 0xc68c; - static const uint16 addr_usehandle = 0xc688; - static const uint16 addr_usewire = 0xc684; - static const uint16 addr_usehatch = 0xc680; - static const uint16 addr_usecontrol = 0xc67c; - static const uint16 addr_moneypoke = 0xc678; - static const uint16 addr_lookatcard = 0xc674; - static const uint16 addr_usecashcard = 0xc670; - static const uint16 addr_usecardreader3 = 0xc66c; - static const uint16 addr_usecardreader2 = 0xc668; - static const uint16 addr_usecardreader1 = 0xc664; - static const uint16 addr_showseconduse = 0xc660; - static const uint16 addr_uselighter = 0xc65c; - static const uint16 addr_usepoolreader = 0xc658; - static const uint16 addr_calledensdlift = 0xc654; - static const uint16 addr_calledenslift = 0xc650; - static const uint16 addr_callhotellift = 0xc64c; - static const uint16 addr_trapdoor = 0xc648; - static const uint16 addr_grafittidoor = 0xc644; - static const uint16 addr_openhoteldoor2 = 0xc640; - static const uint16 addr_openhoteldoor = 0xc63c; - static const uint16 addr_drawitall = 0xc638; - static const uint16 addr_isitright = 0xc634; - static const uint16 addr_opensarters = 0xc630; - static const uint16 addr_openeden = 0xc62c; - static const uint16 addr_openpoolboss = 0xc628; - static const uint16 addr_openryan = 0xc624; - static const uint16 addr_usebalcony = 0xc620; - static const uint16 addr_usewindow = 0xc61c; - static const uint16 addr_openyourneighbour = 0xc618; - static const uint16 addr_nextcolon = 0xc614; - static const uint16 addr_openlouis = 0xc610; - static const uint16 addr_usedryer = 0xc60c; - static const uint16 addr_opentvdoor = 0xc608; - static const uint16 addr_usealtar = 0xc604; - static const uint16 addr_usehole = 0xc600; - static const uint16 addr_usechurchhole = 0xc5fc; - static const uint16 addr_sitdowninbar = 0xc5f8; - static const uint16 addr_wearshades = 0xc5f4; - static const uint16 addr_wearwatch = 0xc5f0; - static const uint16 addr_useopenbox = 0xc5ec; - static const uint16 addr_userailing = 0xc5e8; - static const uint16 addr_usecoveredbox = 0xc5e4; - static const uint16 addr_useclearbox = 0xc5e0; - static const uint16 addr_usecart = 0xc5dc; - static const uint16 addr_useslab = 0xc5d8; - static const uint16 addr_slabdoorf = 0xc5d4; - static const uint16 addr_slabdoore = 0xc5d0; - static const uint16 addr_slabdoorc = 0xc5cc; - static const uint16 addr_slabdoord = 0xc5c8; - static const uint16 addr_slabdoorb = 0xc5c4; - static const uint16 addr_slabdoora = 0xc5c0; - static const uint16 addr_useladderb = 0xc5bc; - static const uint16 addr_useladder = 0xc5b8; - static const uint16 addr_chewy = 0xc5b4; - static const uint16 addr_useplinth = 0xc5b0; - static const uint16 addr_usefullcart = 0xc5ac; - static const uint16 addr_usepipe = 0xc5a8; - static const uint16 addr_nothelderror = 0xc5a4; - static const uint16 addr_usetrainer = 0xc5a0; - static const uint16 addr_opentomb = 0xc59c; - static const uint16 addr_hotelbell = 0xc598; - static const uint16 addr_hotelcontrol = 0xc594; - static const uint16 addr_playguitar = 0xc590; - static const uint16 addr_runtap = 0xc58c; - static const uint16 addr_wheelsound = 0xc588; - static const uint16 addr_useobject = 0xc580; - static const uint16 addr_delcurs = 0xc57c; - static const uint16 addr_printcurs = 0xc578; - static const uint16 addr_triggermessage = 0xc574; - static const uint16 addr_processtrigger = 0xc570; - static const uint16 addr_monmessage = 0xc56c; - static const uint16 addr_showcurrentfile = 0xc568; - static const uint16 addr_printlogo = 0xc564; - static const uint16 addr_monitorlogo = 0xc560; - static const uint16 addr_scrollmonitor = 0xc558; - static const uint16 addr_parser = 0xc554; - static const uint16 addr_searchforstring = 0xc550; - static const uint16 addr_getkeyandlogo = 0xc54c; - static const uint16 addr_dirfile = 0xc548; - static const uint16 addr_read = 0xc544; - static const uint16 addr_showkeys = 0xc540; - static const uint16 addr_signon = 0xc53c; - static const uint16 addr_searchforfiles = 0xc538; - static const uint16 addr_dircom = 0xc534; - static const uint16 addr_neterror = 0xc530; - static const uint16 addr_execcommand = 0xc52c; - static const uint16 addr_delchar = 0xc528; - static const uint16 addr_makecaps = 0xc524; - static const uint16 addr_input = 0xc520; - static const uint16 addr_locklightoff = 0xc51c; - static const uint16 addr_locklighton = 0xc518; - static const uint16 addr_accesslightoff = 0xc514; - static const uint16 addr_accesslighton = 0xc510; - static const uint16 addr_powerlightoff = 0xc50c; - static const uint16 addr_powerlighton = 0xc508; - static const uint16 addr_randomaccess = 0xc504; - static const uint16 addr_turnonpower = 0xc500; - static const uint16 addr_lookininterface = 0xc4fc; - static const uint16 addr_loadcart = 0xc4f8; - static const uint16 addr_loadnews = 0xc4f4; - static const uint16 addr_loadpersonal = 0xc4f0; - static const uint16 addr_printoutermon = 0xc4ec; - static const uint16 addr_usemon = 0xc4e8; - static const uint16 addr_readcitypic = 0xc4e4; - static const uint16 addr_readdesticon = 0xc4e0; - static const uint16 addr_resetlocation = 0xc4dc; - static const uint16 addr_setlocation = 0xc4d8; - static const uint16 addr_getlocation = 0xc4d4; - static const uint16 addr_destselect = 0xc4d0; - static const uint16 addr_lastdest = 0xc4cc; - static const uint16 addr_nextdest = 0xc4c8; - static const uint16 addr_showarrows = 0xc4c4; - static const uint16 addr_getdestinfo = 0xc4c0; - static const uint16 addr_locationpic = 0xc4bc; - static const uint16 addr_putundercentre = 0xc4b8; - static const uint16 addr_getundercentre = 0xc4b4; - static const uint16 addr_lookatplace = 0xc4b0; - static const uint16 addr_showcity = 0xc4ac; - static const uint16 addr_selectlocation = 0xc4a8; - static const uint16 addr_newplace = 0xc4a4; - static const uint16 addr_redes = 0xc4a0; - static const uint16 addr_hangonpq = 0xc49c; - static const uint16 addr_dosometalk = 0xc498; - static const uint16 addr_moretalk = 0xc494; - static const uint16 addr_getpersontext = 0xc490; - static const uint16 addr_starttalk = 0xc48c; - static const uint16 addr_getpersframe = 0xc488; - static const uint16 addr_convicons = 0xc484; - static const uint16 addr_talk = 0xc480; - static const uint16 addr_getback1 = 0xc47c; - static const uint16 addr_redrawmainscrn = 0xc478; - static const uint16 addr_dolook = 0xc474; - static const uint16 addr_look = 0xc470; - static const uint16 addr_autolook = 0xc46c; - static const uint16 addr_drawfloor = 0xc428; - static const uint16 addr_blockget = 0xc424; - static const uint16 addr_deleteextext = 0xc420; - static const uint16 addr_deleteexframe = 0xc41c; - static const uint16 addr_deleteexobject = 0xc418; - static const uint16 addr_purgeanitem = 0xc414; - static const uint16 addr_emergencypurge = 0xc410; - static const uint16 addr_purgealocation = 0xc40c; - static const uint16 addr_transfertext = 0xc404; - static const uint16 addr_transfercontoex = 0xc400; - static const uint16 addr_pickupconts = 0xc3fc; - static const uint16 addr_transfertoex = 0xc3f8; - static const uint16 addr_outofopen = 0xc3f4; - static const uint16 addr_checkobjectsize = 0xc3f0; - static const uint16 addr_errormessage3 = 0xc3ec; - static const uint16 addr_errormessage2 = 0xc3e8; - static const uint16 addr_errormessage1 = 0xc3e4; - static const uint16 addr_useopened = 0xc3e0; - static const uint16 addr_selectopenob = 0xc3dc; - static const uint16 addr_removeobfrominv = 0xc3d8; - static const uint16 addr_wornerror = 0xc3d4; - static const uint16 addr_cantdrop = 0xc3d0; - static const uint16 addr_droperror = 0xc3cc; - static const uint16 addr_dropobject = 0xc3c8; - static const uint16 addr_findopenpos = 0xc3c4; - static const uint16 addr_findinvpos = 0xc3c0; - static const uint16 addr_getsetad = 0xc3bc; - static const uint16 addr_getopenedsize = 0xc3b8; - static const uint16 addr_getanyaddir = 0xc3b4; - static const uint16 addr_getanyad = 0xc3b0; - static const uint16 addr_geteitherad = 0xc3ac; - static const uint16 addr_getexad = 0xc3a8; - static const uint16 addr_getfreead = 0xc3a4; - static const uint16 addr_outofinv = 0xc3a0; - static const uint16 addr_intoinv = 0xc398; - static const uint16 addr_swapwithopen = 0xc394; - static const uint16 addr_swapwithinv = 0xc390; - static const uint16 addr_reexfromopen = 0xc38c; - static const uint16 addr_reexfrominv = 0xc388; - static const uint16 addr_examinventory = 0xc384; - static const uint16 addr_setpickup = 0xc380; - static const uint16 addr_inventory = 0xc37c; - static const uint16 addr_searchforsame = 0xc374; - static const uint16 addr_getobtextstart = 0xc370; - static const uint16 addr_obsthatdothings = 0xc36c; - static const uint16 addr_additionaltext = 0xc368; - static const uint16 addr_describeob = 0xc364; - static const uint16 addr_examicon = 0xc35c; - static const uint16 addr_openob = 0xc354; - static const uint16 addr_openinv = 0xc34c; - static const uint16 addr_incryanpage = 0xc348; - static const uint16 addr_getbackfromob = 0xc344; - static const uint16 addr_makemainscreen = 0xc340; - static const uint16 addr_examineob = 0xc33c; - static const uint16 addr_findallopen = 0xc32c; - static const uint16 addr_fillopen = 0xc324; - static const uint16 addr_monprint = 0xc314; - static const uint16 addr_realcredits = 0xc2f8; - static const uint16 addr_set16colpalette = 0xc2f4; - static const uint16 addr_mode640x480 = 0xc2f0; - static const uint16 addr_loadintroroom = 0xc2ec; - static const uint16 addr_runendseq = 0xc2e8; - static const uint16 addr_runintroseq = 0xc2e4; - static const uint16 addr_intro = 0xc2e0; - static const uint16 addr_hangone = 0xc2dc; - static const uint16 addr_biblequote = 0xc2d8; - static const uint16 addr_credits = 0xc2d4; - static const uint16 addr_gettingshot = 0xc2d0; - static const uint16 addr_showmonk = 0xc2cc; - static const uint16 addr_monkspeaking = 0xc2c8; - static const uint16 addr_endgame = 0xc2c4; - static const uint16 addr_titles = 0xc2c0; - static const uint16 addr_initialmoncols = 0xc2bc; - static const uint16 addr_fadeupyellows = 0xc2b8; - static const uint16 addr_fadeupmonfirst = 0xc2b4; - static const uint16 addr_fadeupmon = 0xc2b0; - static const uint16 addr_fadedownmon = 0xc2ac; - static const uint16 addr_dumpcurrent = 0xc2a8; - static const uint16 addr_allpalette = 0xc2a4; - static const uint16 addr_paltoendpal = 0xc2a0; - static const uint16 addr_startpaltoend = 0xc29c; - static const uint16 addr_endpaltostart = 0xc298; - static const uint16 addr_paltostartpal = 0xc294; - static const uint16 addr_showgroup = 0xc290; - static const uint16 addr_greyscalesum = 0xc28c; - static const uint16 addr_fadecalculation = 0xc288; - static const uint16 addr_rollem = 0xc284; - static const uint16 addr_rollendcredits2 = 0xc280; - static const uint16 addr_showgun = 0xc27c; - static const uint16 addr_clearstartpal = 0xc278; - static const uint16 addr_fadescreendowns = 0xc274; - static const uint16 addr_fadescreendown = 0xc270; - static const uint16 addr_fadescreenuphalf = 0xc26c; - static const uint16 addr_fadescreendownhalf = 0xc268; - static const uint16 addr_fadescreenups = 0xc264; - static const uint16 addr_fadefromwhite = 0xc260; - static const uint16 addr_fadetowhite = 0xc25c; - static const uint16 addr_fadescreenup = 0xc258; - static const uint16 addr_clearpalette = 0xc254; - static const uint16 addr_clearendpal = 0xc250; - static const uint16 addr_dofade = 0xc24c; - static const uint16 addr_fadedos = 0xc248; - static const uint16 addr_transfermap = 0xc244; - static const uint16 addr_doshake = 0xc20c; - static const uint16 addr_vsync = 0xc208; - static const uint16 addr_createpanel2 = 0xc200; - static const uint16 addr_createpanel = 0xc1fc; - static const uint16 addr_setmode = 0xc1dc; - static const uint16 addr_loadpalfromiff = 0xc1d8; - static const uint16 addr_showpcx = 0xc1cc; - static const uint16 addr_deleverything = 0xc1c0; - static const uint16 addr_reconstruct = 0xc1ac; - static const uint16 addr_soundonreels = 0xc1a8; - static const uint16 addr_reelsonscreen = 0xc1a0; - static const uint16 addr_constant = 0xc184; - static const uint16 addr_steady = 0xc180; - static const uint16 addr_random = 0xc17c; - static const uint16 addr_liftnoise = 0xc178; - static const uint16 addr_backobject = 0xc170; - static const uint16 addr_splitintolines = 0xc164; - static const uint16 addr_initrain = 0xc160; - static const uint16 addr_reminders = 0xc15c; - static const uint16 addr_adjustright = 0xc158; - static const uint16 addr_adjustleft = 0xc154; - static const uint16 addr_adjustup = 0xc150; - static const uint16 addr_adjustdown = 0xc14c; - static const uint16 addr_checkforexit = 0xc148; - static const uint16 addr_mainman = 0xc138; - static const uint16 addr_checkspeed = 0xc110; - static const uint16 addr_train = 0xc104; - static const uint16 addr_sparky = 0xc100; - static const uint16 addr_copper = 0xc0fc; - static const uint16 addr_advisor = 0xc0f8; - static const uint16 addr_drunk = 0xc0f4; - static const uint16 addr_textformonk = 0xc0f0; - static const uint16 addr_textforend = 0xc0ec; - static const uint16 addr_priesttext = 0xc0e8; - static const uint16 addr_madman = 0xc0dc; - static const uint16 addr_madmanstelly = 0xc0d8; - static const uint16 addr_priest = 0xc0d4; - static const uint16 addr_rollendcredits = 0xc0d0; - static const uint16 addr_endgameseq = 0xc0cc; - static const uint16 addr_monkandryan = 0xc0c8; - static const uint16 addr_intro3text = 0xc0c4; - static const uint16 addr_intro2text = 0xc0c0; - static const uint16 addr_intro1text = 0xc0bc; - static const uint16 addr_monks2text = 0xc0b8; - static const uint16 addr_handclap = 0xc0b4; - static const uint16 addr_intromonks2 = 0xc0b0; - static const uint16 addr_intromonks1 = 0xc0ac; - static const uint16 addr_intromagic3 = 0xc0a8; - static const uint16 addr_intromagic2 = 0xc0a4; - static const uint16 addr_gates = 0xc0a0; - static const uint16 addr_candles2 = 0xc09c; - static const uint16 addr_candles = 0xc098; - static const uint16 addr_intromagic1 = 0xc094; - static const uint16 addr_smallcandle = 0xc090; - static const uint16 addr_candles1 = 0xc08c; - static const uint16 addr_keeper = 0xc088; - static const uint16 addr_carparkdrip = 0xc084; - static const uint16 addr_sparkydrip = 0xc080; - static const uint16 addr_gamer = 0xc07c; - static const uint16 addr_bossman = 0xc078; - static const uint16 addr_heavy = 0xc074; - static const uint16 addr_security = 0xc070; - static const uint16 addr_poolguard = 0xc06c; - static const uint16 addr_businessman = 0xc068; - static const uint16 addr_aide = 0xc064; - static const uint16 addr_mugger = 0xc060; - static const uint16 addr_helicopter = 0xc05c; - static const uint16 addr_rockstar = 0xc058; - static const uint16 addr_soldier1 = 0xc054; - static const uint16 addr_interviewer = 0xc050; - static const uint16 addr_barwoman = 0xc04c; - static const uint16 addr_othersmoker = 0xc048; - static const uint16 addr_bartender = 0xc044; - static const uint16 addr_drinker = 0xc040; - static const uint16 addr_tattooman = 0xc03c; - static const uint16 addr_mansatstill = 0xc038; - static const uint16 addr_manasleep2 = 0xc034; - static const uint16 addr_louischair = 0xc030; - static const uint16 addr_louis = 0xc02c; - static const uint16 addr_femalefan = 0xc028; - static const uint16 addr_malefan = 0xc024; - static const uint16 addr_edeninbath = 0xc020; - static const uint16 addr_eden = 0xc01c; - static const uint16 addr_manasleep = 0xc018; - static const uint16 addr_attendant = 0xc014; - static const uint16 addr_smokebloke = 0xc010; - static const uint16 addr_receptionist = 0xc00c; - static const uint16 addr_foghornsound = 0xc008; - static const uint16 addr_intromusic = 0xc004; - static const uint16 addr_alleybarksound = 0xc000; - static const uint16 offset_quitlist = 0x0a84; - static const uint16 offset_savelist = 0x0f44; - static const uint16 offset_mainlist = 0x1402; - static const uint16 offset_gameerror8 = 0x113f; - static const uint16 offset_gameerror5 = 0x1074; - static const uint16 offset_error2patch = 0x0ff6; - static const uint16 offset_openchangesize = 0x0a1c; - static const uint16 offset_keys = 0x0b14; - static const uint16 offset_mainlist2 = 0x1440; - static const uint16 offset_gameerror2 = 0x0fb2; - static const uint16 offset_loadlist = 0x0ef0; - static const uint16 offset_gameerror6 = 0x10be; - static const uint16 offset_speechfile = 0x13f1; - static const uint16 offset_atmospherelist = 0x147e; - static const uint16 offset_gameerror4 = 0x1037; - static const uint16 offset_gameerror1 = 0x0f6e; - static const uint16 offset_examlist = 0x09be; - static const uint16 offset_gameinfo = 0x1170; - static const uint16 offset_opslist = 0x0ec6; - static const uint16 offset_invlist1 = 0x09fc; - static const uint16 offset_money2poke = 0x0d97; - static const uint16 offset_talklist = 0x0a64; - static const uint16 offset_menulist = 0x0e1e; - static const uint16 offset_comlist = 0x0ad8; - static const uint16 offset_withlist1 = 0x0a3a; - static const uint16 offset_money1poke = 0x0d92; - static const uint16 offset_gameerror7 = 0x1104; - static const uint16 offset_discopslist = 0x0f1a; - static const uint16 offset_commandline = 0x16d7; - static const uint16 offset_destlist = 0x0a9a; - static const uint16 offset_shaketable = 0x06af; - static const uint16 offset_error6patch = 0x10fe; - static const uint16 offset_keybuffer = 0x1718; - static const uint16 offset_speechfilename = 0x13eb; - static const uint16 offset_rootdir = 0x0b8c; - static const uint16 offset_gameerror3 = 0x1003; - static const uint16 offset_rainlocations = 0x0459; - static const uint16 offset_diarylist = 0x0e9c; - static const uint16 offset_decidelist = 0x13c1; - static const uint16 offset_symbollist = 0x0e5e; - static const uint16 offset_folderlist = 0x0e34; - static const uint16 offset_facelist = 0x0451; - static const uint16 offset_operand1 = 0x0b7e; - static const uint16 offset_keypadlist = 0x0d9a; - static const uint16 kStartvars = 0; - static const uint16 kProgresspoints = 1; - static const uint16 kWatchon = 2; - static const uint16 kShadeson = 3; - static const uint16 kSecondcount = 4; - static const uint16 kMinutecount = 5; - static const uint16 kHourcount = 6; - static const uint16 kZoomon = 7; - static const uint16 kLocation = 8; - static const uint16 kExpos = 9; - static const uint16 kExframepos = 10; - static const uint16 kExtextpos = 12; - static const uint16 kCard1money = 14; - static const uint16 kListpos = 16; - static const uint16 kRyanpage = 18; - static const uint16 kWatchingtime = 19; - static const uint16 kReeltowatch = 21; - static const uint16 kEndwatchreel = 23; - static const uint16 kSpeedcount = 25; - static const uint16 kWatchspeed = 26; - static const uint16 kReeltohold = 27; - static const uint16 kEndofholdreel = 29; - static const uint16 kWatchmode = 31; - static const uint16 kDestafterhold = 32; - static const uint16 kNewsitem = 33; - static const uint16 kLiftflag = 34; - static const uint16 kLiftpath = 35; - static const uint16 kLockstatus = 36; - static const uint16 kDoorpath = 37; - static const uint16 kCounttoopen = 38; - static const uint16 kCounttoclose = 39; - static const uint16 kRockstardead = 40; - static const uint16 kGeneraldead = 41; - static const uint16 kSartaindead = 42; - static const uint16 kAidedead = 43; - static const uint16 kBeenmugged = 44; - static const uint16 kGunpassflag = 45; - static const uint16 kCanmovealtar = 46; - static const uint16 kTalkedtoattendant = 47; - static const uint16 kTalkedtosparky = 48; - static const uint16 kTalkedtoboss = 49; - static const uint16 kTalkedtorecep = 50; - static const uint16 kCardpassflag = 51; - static const uint16 kMadmanflag = 52; - static const uint16 kKeeperflag = 53; - static const uint16 kLasttrigger = 54; - static const uint16 kMandead = 55; - static const uint16 kSeed = 56; - static const uint16 kNeedtotravel = 59; - static const uint16 kThroughdoor = 60; - static const uint16 kNewobs = 61; - static const uint16 kRyanon = 62; - static const uint16 kCombatcount = 63; - static const uint16 kLastweapon = 64; - static const uint16 kDreamnumber = 65; - static const uint16 kRoomafterdream = 66; - static const uint16 kShakecounter = 67; - static const uint16 kSpeechcount = 68; - static const uint16 kCharshift = 69; - static const uint16 kKerning = 71; - static const uint16 kBrightness = 72; - static const uint16 kRoomloaded = 73; - static const uint16 kDidzoom = 74; - static const uint16 kLinespacing = 75; - static const uint16 kTextaddressx = 77; - static const uint16 kTextaddressy = 79; - static const uint16 kTextlen = 81; - static const uint16 kLastxpos = 82; - static const uint16 kIcontop = 84; - static const uint16 kIconleft = 86; - static const uint16 kItemframe = 88; - static const uint16 kItemtotran = 89; - static const uint16 kRoomad = 90; - static const uint16 kOldsubject = 92; - static const uint16 kWithobject = 94; - static const uint16 kWithtype = 95; - static const uint16 kLookcounter = 96; - static const uint16 kCommand = 98; - static const uint16 kCommandtype = 99; - static const uint16 kOldcommandtype = 100; - static const uint16 kObjecttype = 101; - static const uint16 kGetback = 102; - static const uint16 kInvopen = 103; - static const uint16 kMainmode = 104; - static const uint16 kPickup = 105; - static const uint16 kLastinvpos = 106; - static const uint16 kExamagain = 107; - static const uint16 kNewtextline = 108; - static const uint16 kOpenedob = 109; - static const uint16 kOpenedtype = 110; - static const uint16 kOldmapadx = 111; - static const uint16 kOldmapady = 113; - static const uint16 kMapadx = 115; - static const uint16 kMapady = 117; - static const uint16 kMapoffsetx = 119; - static const uint16 kMapoffsety = 121; - static const uint16 kMapxstart = 123; - static const uint16 kMapystart = 125; - static const uint16 kMapxsize = 127; - static const uint16 kMapysize = 128; - static const uint16 kHavedoneobs = 129; - static const uint16 kManisoffscreen = 130; - static const uint16 kRainspace = 131; - static const uint16 kFacing = 132; - static const uint16 kLeavedirection = 133; - static const uint16 kTurntoface = 134; - static const uint16 kTurndirection = 135; - static const uint16 kMaintimer = 136; - static const uint16 kIntrocount = 138; - static const uint16 kArrowad = 139; - static const uint16 kCurrentkey = 141; - static const uint16 kOldkey = 142; - static const uint16 kUseddirection = 143; - static const uint16 kCurrentkey2 = 144; - static const uint16 kTimercount = 145; - static const uint16 kOldtimercount = 146; - static const uint16 kMapx = 147; - static const uint16 kMapy = 148; - static const uint16 kNewscreen = 149; - static const uint16 kRyanx = 150; - static const uint16 kRyany = 151; - static const uint16 kLastflag = 152; - static const uint16 kLastflagex = 153; - static const uint16 kFlagx = 154; - static const uint16 kFlagy = 155; - static const uint16 kCurrentex = 156; - static const uint16 kCurrentfree = 157; - static const uint16 kCurrentframe = 158; - static const uint16 kFramesad = 160; - static const uint16 kDataad = 162; - static const uint16 kFrsegment = 164; - static const uint16 kObjectx = 166; - static const uint16 kObjecty = 168; - static const uint16 kOffsetx = 170; - static const uint16 kOffsety = 172; - static const uint16 kSavesize = 174; - static const uint16 kSavesource = 176; - static const uint16 kSavex = 178; - static const uint16 kSavey = 179; - static const uint16 kCurrentob = 180; - static const uint16 kPrioritydep = 181; - static const uint16 kDestpos = 182; - static const uint16 kReallocation = 183; - static const uint16 kRoomnum = 184; - static const uint16 kNowinnewroom = 185; - static const uint16 kResetmanxy = 186; - static const uint16 kNewlocation = 187; - static const uint16 kAutolocation = 188; - static const uint16 kMustload = 189; - static const uint16 kAnswered = 190; - static const uint16 kSaidno = 191; - static const uint16 kDoorcheck1 = 192; - static const uint16 kDoorcheck2 = 193; - static const uint16 kDoorcheck3 = 194; - static const uint16 kDoorcheck4 = 195; - static const uint16 kMousex = 196; - static const uint16 kMousey = 198; - static const uint16 kMousebutton = 200; - static const uint16 kMousebutton1 = 202; - static const uint16 kMousebutton2 = 204; - static const uint16 kMousebutton3 = 206; - static const uint16 kMousebutton4 = 208; - static const uint16 kOldbutton = 210; - static const uint16 kOldx = 212; - static const uint16 kOldy = 214; - static const uint16 kLastbutton = 216; - static const uint16 kOldpointerx = 218; - static const uint16 kOldpointery = 220; - static const uint16 kDelherex = 222; - static const uint16 kDelherey = 224; - static const uint16 kPointerxs = 226; - static const uint16 kPointerys = 227; - static const uint16 kDelxs = 228; - static const uint16 kDelys = 229; - static const uint16 kPointerframe = 230; - static const uint16 kPointerpower = 231; - static const uint16 kAuxpointerframe = 232; - static const uint16 kPointermode = 233; - static const uint16 kPointerspeed = 234; - static const uint16 kPointercount = 235; - static const uint16 kInmaparea = 236; - static const uint16 kReelpointer = 237; - static const uint16 kSlotdata = 239; - static const uint16 kThisslot = 240; - static const uint16 kSlotflags = 241; - static const uint16 kTakeoff = 242; - static const uint16 kTalkmode = 244; - static const uint16 kTalkpos = 245; - static const uint16 kCharacter = 246; - static const uint16 kPersondata = 247; - static const uint16 kTalknum = 249; - static const uint16 kNumberinroom = 250; - static const uint16 kCurrentcel = 251; - static const uint16 kOldselection = 252; - static const uint16 kStopwalking = 253; - static const uint16 kMouseon = 254; - static const uint16 kPlayed = 255; - static const uint16 kTimer1 = 257; - static const uint16 kTimer2 = 258; - static const uint16 kTimer3 = 259; - static const uint16 kWholetimer = 260; - static const uint16 kTimer1to = 262; - static const uint16 kTimer2to = 263; - static const uint16 kTimer3to = 264; - static const uint16 kWatchdump = 265; - static const uint16 kCurrentset = 266; - static const uint16 kLogonum = 268; - static const uint16 kOldlogonum = 269; - static const uint16 kNewlogonum = 270; - static const uint16 kNetseg = 271; - static const uint16 kNetpoint = 273; - static const uint16 kKeynum = 275; - static const uint16 kCursorstate = 276; - static const uint16 kPressed = 277; - static const uint16 kPresspointer = 278; - static const uint16 kGraphicpress = 280; - static const uint16 kPresscount = 281; - static const uint16 kKeypadax = 282; - static const uint16 kKeypadcx = 284; - static const uint16 kLightcount = 286; - static const uint16 kFolderpage = 287; - static const uint16 kDiarypage = 288; - static const uint16 kMenucount = 289; - static const uint16 kSymboltopx = 290; - static const uint16 kSymboltopnum = 291; - static const uint16 kSymboltopdir = 292; - static const uint16 kSymbolbotx = 293; - static const uint16 kSymbolbotnum = 294; - static const uint16 kSymbolbotdir = 295; - static const uint16 kSymboltolight = 296; - static const uint16 kSymbol1 = 297; - static const uint16 kSymbol2 = 298; - static const uint16 kSymbol3 = 299; - static const uint16 kSymbolnum = 300; - static const uint16 kDumpx = 301; - static const uint16 kDumpy = 303; - static const uint16 kWalkandexam = 305; - static const uint16 kWalkexamtype = 306; - static const uint16 kWalkexamnum = 307; - static const uint16 kCursloc = 308; - static const uint16 kCurslocx = 310; - static const uint16 kCurslocy = 312; - static const uint16 kCurpos = 314; - static const uint16 kMonadx = 316; - static const uint16 kMonady = 318; - static const uint16 kGotfrom = 320; - static const uint16 kMonsource = 322; - static const uint16 kNumtodo = 324; - static const uint16 kTimecount = 326; - static const uint16 kCounttotimed = 328; - static const uint16 kTimedseg = 330; - static const uint16 kTimedoffset = 332; - static const uint16 kTimedy = 334; - static const uint16 kTimedx = 335; - static const uint16 kNeedtodumptimed = 336; - static const uint16 kHandle = 337; - static const uint16 kLoadingorsave = 339; - static const uint16 kCurrentslot = 340; - static const uint16 kCursorpos = 341; - static const uint16 kColourpos = 342; - static const uint16 kFadedirection = 343; - static const uint16 kNumtofade = 344; - static const uint16 kFadecount = 345; - static const uint16 kAddtogreen = 346; - static const uint16 kAddtored = 347; - static const uint16 kAddtoblue = 348; - static const uint16 kLastsoundreel = 349; - static const uint16 kSoundbuffer = 351; - static const uint16 kSoundbufferad = 353; - static const uint16 kSoundbufferpage = 355; - static const uint16 kSoundtimes = 356; - static const uint16 kNeedsoundbuff = 357; - static const uint16 kOldint9seg = 358; - static const uint16 kOldint9add = 360; - static const uint16 kOldint8seg = 362; - static const uint16 kOldint8add = 364; - static const uint16 kOldsoundintseg = 366; - static const uint16 kOldsoundintadd = 368; - static const uint16 kSoundbaseadd = 370; - static const uint16 kDsp_status = 372; - static const uint16 kDsp_write = 374; - static const uint16 kDmaaddress = 376; - static const uint16 kSoundint = 377; - static const uint16 kSounddmachannel = 378; - static const uint16 kSampleplaying = 379; - static const uint16 kTestresult = 380; - static const uint16 kCurrentirq = 381; - static const uint16 kSpeechloaded = 382; - static const uint16 kSpeechlength = 383; - static const uint16 kVolume = 385; - static const uint16 kVolumeto = 386; - static const uint16 kVolumedirection = 387; - static const uint16 kVolumecount = 388; - static const uint16 kPlayblock = 389; - static const uint16 kWongame = 390; - static const uint16 kLasthardkey = 391; - static const uint16 kBufferin = 392; - static const uint16 kBufferout = 394; - static const uint16 kExtras = 396; - static const uint16 kWorkspace = 398; - static const uint16 kMapstore = 400; - static const uint16 kCharset1 = 402; - static const uint16 kTempcharset = 404; - static const uint16 kIcons1 = 406; - static const uint16 kIcons2 = 408; - static const uint16 kBuffers = 410; - static const uint16 kMainsprites = 412; - static const uint16 kBackdrop = 414; - static const uint16 kMapdata = 416; - static const uint16 kSounddata = 418; - static const uint16 kSounddata2 = 420; - static const uint16 kRecordspace = 422; - static const uint16 kFreedat = 424; - static const uint16 kSetdat = 426; - static const uint16 kReel1 = 428; - static const uint16 kReel2 = 430; - static const uint16 kReel3 = 432; - static const uint16 kRoomdesc = 434; - static const uint16 kFreedesc = 436; - static const uint16 kSetdesc = 438; - static const uint16 kBlockdesc = 440; - static const uint16 kSetframes = 442; - static const uint16 kFreeframes = 444; - static const uint16 kPeople = 446; - static const uint16 kReels = 448; - static const uint16 kCommandtext = 450; - static const uint16 kPuzzletext = 452; - static const uint16 kTraveltext = 454; - static const uint16 kTempgraphics = 456; - static const uint16 kTempgraphics2 = 458; - static const uint16 kTempgraphics3 = 460; - static const uint16 kTempsprites = 462; - static const uint16 kTextfile1 = 464; - static const uint16 kTextfile2 = 466; - static const uint16 kTextfile3 = 468; - static const uint16 kBlinkframe = 470; - static const uint16 kBlinkcount = 471; - static const uint16 kReasseschanges = 472; - static const uint16 kPointerspath = 473; - static const uint16 kManspath = 474; - static const uint16 kPointerfirstpath = 475; - static const uint16 kFinaldest = 476; - static const uint16 kDestination = 477; - static const uint16 kLinestartx = 478; - static const uint16 kLinestarty = 480; - static const uint16 kLineendx = 482; - static const uint16 kLineendy = 484; - static const uint16 kIncrement1 = 486; - static const uint16 kIncrement2 = 488; - static const uint16 kLineroutine = 490; - static const uint16 kLinepointer = 491; - static const uint16 kLinedirection = 492; - static const uint16 kLinelength = 493; - static const uint16 kLiftsoundcount = 494; - static const uint16 kEmmhandle = 495; - static const uint16 kEmmpageframe = 497; - static const uint16 kEmmhardwarepage = 499; - static const uint16 kCh0emmpage = 500; - static const uint16 kCh0offset = 502; - static const uint16 kCh0blockstocopy = 504; - static const uint16 kCh0playing = 506; - static const uint16 kCh0repeat = 507; - static const uint16 kCh0oldemmpage = 508; - static const uint16 kCh0oldoffset = 510; - static const uint16 kCh0oldblockstocopy = 512; - static const uint16 kCh1playing = 514; - static const uint16 kCh1emmpage = 515; - static const uint16 kCh1offset = 517; - static const uint16 kCh1blockstocopy = 519; - static const uint16 kCh1blocksplayed = 521; - static const uint16 kSoundbufferwrite = 523; - static const uint16 kSoundemmpage = 525; - static const uint16 kSpeechemmpage = 527; - static const uint16 kCurrentsample = 529; - static const uint16 kRoomssample = 530; - static const uint16 kGameerror = 531; - static const uint16 kHowmuchalloc = 532; - static const uint16 kReelroutines = 534; - static const uint16 kReelcalls = 991; - static const uint16 kRoombyroom = 1214; - static const uint16 kR0 = 1326; - static const uint16 kR1 = 1327; - static const uint16 kR2 = 1331; - static const uint16 kR6 = 1350; - static const uint16 kR8 = 1357; - static const uint16 kR9 = 1373; - static const uint16 kR10 = 1380; - static const uint16 kR11 = 1384; - static const uint16 kR12 = 1388; - static const uint16 kR13 = 1392; - static const uint16 kR14 = 1405; - static const uint16 kR20 = 1439; - static const uint16 kR22 = 1461; - static const uint16 kR23 = 1492; - static const uint16 kR25 = 1505; - static const uint16 kR26 = 1527; - static const uint16 kR27 = 1549; - static const uint16 kR28 = 1574; - static const uint16 kR29 = 1593; - static const uint16 kR45 = 1609; - static const uint16 kR46 = 1616; - static const uint16 kR47 = 1653; - static const uint16 kR52 = 1666; - static const uint16 kR53 = 1670; - static const uint16 kR55 = 1677; - static const uint16 kSpritename1 = 1819; - static const uint16 kSpritename3 = 1832; - static const uint16 kIdname = 1845; - static const uint16 kCharacterset1 = 1857; - static const uint16 kCharacterset2 = 1870; - static const uint16 kCharacterset3 = 1883; - static const uint16 kSamplename = 1896; - static const uint16 kBasicsample = 1909; - static const uint16 kIcongraphics0 = 1922; - static const uint16 kIcongraphics1 = 1935; - static const uint16 kExtragraphics1 = 1948; - static const uint16 kIcongraphics8 = 1961; - static const uint16 kMongraphicname = 1974; - static const uint16 kMongraphics2 = 1987; - static const uint16 kCityname = 2000; - static const uint16 kTravelgraphic1 = 2013; - static const uint16 kTravelgraphic2 = 2026; - static const uint16 kDiarygraphic = 2039; - static const uint16 kMonitorfile1 = 2052; - static const uint16 kMonitorfile2 = 2065; - static const uint16 kMonitorfile10 = 2078; - static const uint16 kMonitorfile11 = 2091; - static const uint16 kMonitorfile12 = 2104; - static const uint16 kMonitorfile13 = 2117; - static const uint16 kMonitorfile20 = 2130; - static const uint16 kMonitorfile21 = 2143; - static const uint16 kMonitorfile22 = 2156; - static const uint16 kMonitorfile23 = 2169; - static const uint16 kMonitorfile24 = 2182; - static const uint16 kFoldertext = 2195; - static const uint16 kDiarytext = 2208; - static const uint16 kPuzzletextname = 2221; - static const uint16 kTraveltextname = 2234; - static const uint16 kIntrotextname = 2247; - static const uint16 kEndtextname = 2260; - static const uint16 kCommandtextname = 2273; - static const uint16 kVolumetabname = 2286; - static const uint16 kFoldergraphic1 = 2299; - static const uint16 kFoldergraphic2 = 2312; - static const uint16 kFoldergraphic3 = 2325; - static const uint16 kSymbolgraphic = 2338; - static const uint16 kGungraphic = 2351; - static const uint16 kMonkface = 2364; - static const uint16 kTitle0graphics = 2377; - static const uint16 kTitle1graphics = 2390; - static const uint16 kTitle2graphics = 2403; - static const uint16 kTitle3graphics = 2416; - static const uint16 kTitle4graphics = 2429; - static const uint16 kTitle5graphics = 2442; - static const uint16 kTitle6graphics = 2455; - static const uint16 kTitle7graphics = 2468; - static const uint16 kPalettescreen = 2481; - static const uint16 kCurrentfile = 2970; - static const uint16 kDmaaddresses = 5118; - static const uint16 kFileheader = 6091; - static const uint16 kFiledata = 6141; - static const uint16 kExtradata = 6181; - static const uint16 kRoomdata = 6187; - static const uint16 kMadeuproomdat = 7979; - static const uint16 kRoomscango = 8011; - static const uint16 kRoompics = 8027; - static const uint16 kOplist = 8042; - static const uint16 kInputline = 8045; - static const uint16 kLinedata = 8173; - static const uint16 kPresslist = 8573; - static const uint16 kSavenames = 8579; - static const uint16 kSavefiles = 8698; - static const uint16 kRecname = 8789; - static const uint16 kQuitrequested = 8802; - static const uint16 kSubtitles = 8803; - static const uint16 kForeignrelease = 8804; - static const uint16 kStak = 8805; - static const uint16 kBlocktextdat = (0); - static const uint16 kPersonframes = (0); - static const uint16 kDebuglevel1 = (0); - static const uint16 kDebuglevel2 = (0); - static const uint16 kPlayback = (0); - static const uint16 kMap = (0); - static const uint16 kSettextdat = (0); - static const uint16 kSpanish = (0); - static const uint16 kFramedata = (0); - static const uint16 kRecording = (0); - static const uint16 kFlags = (0); - static const uint16 kGerman = (0); - static const uint16 kTextunder = (0); - static const uint16 kPathdata = (0); - static const uint16 kDemo = (0); - static const uint16 kExframedata = (0); - static const uint16 kIntextdat = (0); - static const uint16 kFreetextdat = (0); - static const uint16 kFrframedata = (0); - static const uint16 kSettext = (0+(130*2)); - static const uint16 kOpeninvlist = (0+(228*13)); - static const uint16 kRyaninvlist = (0+(228*13)+32); - static const uint16 kPointerback = (0+(228*13)+32+60); - static const uint16 kMapflags = (0+(228*13)+32+60+(32*32)); - static const uint16 kStartpal = (0+(228*13)+32+60+(32*32)+(11*10*3)); - static const uint16 kEndpal = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); - static const uint16 kMaingamepal = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); - static const uint16 kSpritetable = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); - static const uint16 kSetlist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)); - static const uint16 kFreelist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); - static const uint16 kExlist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); - static const uint16 kPeoplelist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); - static const uint16 kZoomspace = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); - static const uint16 kPrintedlist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)); - static const uint16 kListofchanges = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); - static const uint16 kUndertimedtext = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)); - static const uint16 kRainlist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)); - static const uint16 kInitialreelrouts = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)); - static const uint16 kInitialvars = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+991-534); - static const uint16 kLengthofbuffer = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+991-534+68-0); - static const uint16 kReellist = (0+(36*144)); - static const uint16 kIntext = (0+(38*2)); - static const uint16 kLengthofmap = (0+(66*60)); - static const uint16 kFreetext = (0+(82*2)); - static const uint16 kBlocktext = (0+(98*2)); - static const uint16 kBlocks = (0+192); - static const uint16 kFrframes = (0+2080); - static const uint16 kExframes = (0+2080); - static const uint16 kFrames = (0+2080); - static const uint16 kExdata = (0+2080+30000); - static const uint16 kExtextdat = (0+2080+30000+(16*114)); - static const uint16 kExtext = (0+2080+30000+(16*114)+((114+2)*2)); - static const uint16 kLengthofextra = (0+2080+30000+(16*114)+((114+2)*2)+18000); - static const uint16 kPersontxtdat = (0+24); - static const uint16 kPersontext = (0+24+(1026*2)); - static const uint16 kInputport = (0x63); - static const uint16 kForeign = (1); - static const uint16 kCd = (1); - static const uint16 kNumexobjects = (114); - static const uint16 kUndertextsizey = (13); - static const uint16 kZoomy = (132); - static const uint16 kFreedatlen = (16*80); - static const uint16 kExtextlen = (18000); - static const uint16 kLenofmapstore = (22*8*20*8); - static const uint16 kUndertextsizex = (228); - static const uint16 kNumchanges = (250); - static const uint16 kUndertimedysize = (30); - static const uint16 kExframeslen = (30000); - static const uint16 kTablesize = (32); - static const uint16 kScreenwidth = (320); - static const uint16 kKeypadx = (36+112); - static const uint16 kItempicsize = (44); - static const uint16 kDiaryy = (48+12); - static const uint16 kOpsy = (52); - static const uint16 kSymboly = (56); - static const uint16 kInventy = (58); - static const uint16 kMenuy = (60); - static const uint16 kOpsx = (60); - static const uint16 kMaplength = (60); - static const uint16 kHeaderlen = (6187-6091); - static const uint16 kSymbolx = (64); - static const uint16 kSetdatlen = (64*128); - static const uint16 kMapwidth = (66); - static const uint16 kTextstart = (66*2); - static const uint16 kMaplen = (66*60); - static const uint16 kDiaryx = (68+24); - static const uint16 kLengthofvars = (68-0); - static const uint16 kKeypady = (72); - static const uint16 kZoomx = (8); - static const uint16 kInventx = (80); - static const uint16 kMenux = (80+40); - static const uint16 kLenofreelrouts = (991-534); - - void bothchannels(); - void usewire(); - void getnamepos(); - void loadtemptext(); - void clearstartpal(); - void femalefan(); - //void showgamereel(); - void identifyob(); - void trysoundalloc(); - void uselighter(); - void showmenu(); - void usepoolreader(); - void startdmablock(); - void useopenbox(); - void clearbuffers(); - //void getyad(); - void neterror(); - void storeit(); - //void lockeddoorway(); - //void isitworn(); - //void putundertimed(); - //void dumpmap(); - //void multidump(); - void channel0only(); - void worktoscreenm(); - //void obicons(); - void removeemm(); - //void frameoutbh(); - void getobtextstart(); - void loadfolder(); - void decide(); - //void dumppointer(); - void reelsonscreen(); - void getridofreels(); - void readkey(); - void louis(); - void entrytexts(); - //void getreelstart(); - void buttonenter(); - void checkinput(); - //void crosshair(); - void setmode(); - void getbackfromops(); - //void frameoutv(); - void showbyte(); - void screenupdate(); - //void addlength(); - void wornerror(); - void putundercentre(); - void checkobjectsize(); - //void commandonly(); - void titles(); - void deallocatemem(); - void mainscreen(); - void watchreel(); - void showfolder(); - //void turnanypathoff(); - void openfilefromc(); - void gettime(); - //void clearwork(); - void loadtraveltext(); - //void worktoscreen(); - //void getexpos(); - void fadedos(); - //void fillspace(); - void selectlocation(); - //void multiget(); - //void autosetwalk(); - void fadeupmonfirst(); - void drawfloor(); - void loadkeypad(); - //void findsource(); - void clearendpal(); - void findtext1(); - void isryanholding(); - void showslots(); - void usecashcard(); - void usewall(); - void opentomb(); - //void makename(); - void buttonfour(); - void restoreall(); - //void lockmon(); - //void dochange(); - void getanyaddir(); - //void dumpblink(); - void showsaveops(); - void intromonks1(); - void resetlocation(); - void oldtonames(); - void showdiscops(); - void advisor(); - void additionaltext(); - //void compare(); - void othersmoker(); - void dofade(); - //void setuptimedtemp(); - //void blocknametext(); - void useelevator5(); - void useelevator4(); - void useelevator1(); - //void findormake(); - void useelevator3(); - void useelevator2(); - void buttonone(); - void keyboardread(); - //void deltextline(); - void entercode(); - void getopenedsize(); - void getpersframe(); - void doshake(); - void resetkeyboard(); - //void showpanel(); - void soundstartup(); - void slabdoora(); - void fadeupyellows(); - void slabdoorc(); - void slabdoorb(); - void slabdoore(); - void slabdoord(); - void adjustup(); - void slabdoorf(); - void loadintotemp(); - void loadintroroom(); - void saveseg(); - //void showblink(); - void mousecall(); - void train(); - void watchcount(); - void fadedownmon(); - void loadcart(); - //void calcfrframe(); + void identifyOb(); + void runEndSeq(); + void useOpenBox(); + void clearBuffers(); + void getObTextStart(); + void entryTexts(); + void putUnderCentre(); + void checkObjectSize(); + void findText1(); + void isRyanHolding(); + void showSlots(); + void useCashCard(); + void moneyPoke(); + void doSomeTalk(); + void resetLocation(); + void getOpenedSize(); + void adjustUp(); + void fadeScreenDownHalf(); + void fadeDownMon(); void bartender(); - void eden(); - void showdiary(); - void purgealocation(); - //void updatepeople(); - //void addtopeoplelist(); - void hangoncurs(); - //void getblockofpixel(); - //void kernchars(); - void printcurs(); - //void convertkey(); - void outofopen(); - //void dealwithspecial(); - //void eraseoldobs(); - void dircom(); - //void liftsprite(); - void dumpkeypad(); - void showsymbol(); - void endgameseq(); - //void cancelch0(); - void setbotleft(); - void findfirstpath(); - //void cancelch1(); - void loadold(); - void loadtempcharset(); - void useslab(); - void dumpzoom(); - //void aboutturn(); - void usealtar(); - void createpanel2(); - void turnonpower(); - void manasleep2(); - void moretalk(); - //void printslow(); - void loadroom(); - void starttalk(); - void delchar(); - void getanyad(); - void endgame(); - void monprint(); - void usepipe(); - //void startloading(); - void getunderzoom(); - void candles(); - void backobject(); - void rollendcredits2(); + void outOfOpen(); + void dirCom(); + void endGameSeq(); + void findFirstPath(); + void useSLab(); + void useAltar(); + void startTalk(); + void getAnyAd(); + void usePipe(); void reminders(); - void selectslot2(); - void runtap(); - //void domix(); - //void paneltomap(); - //void obname(); - void getridoftemp3(); - void getridoftemp2(); - void usebalcony(); - void runendseq(); - void dumpdiarykeys(); - void disablesoundint(); - void priesttext(); - //void showallex(); - void openpoolboss(); - void buttontwo(); - //void usetimedtext(); - //void delsprite(); - //void getroomspaths(); - //void dumptextline(); - void fadescreendownhalf(); - void useplate(); - void candles1(); - void lookininterface(); - void manasleep(); - //void isitdescribed(); - void hotelbell(); - void loadspeech(); - void interupttest(); - //void cls(); - //void printsprites(); - //void checkifperson(); - //void showallobs(); - //void getnumber(); - void adjustleft(); - void calledenslift(); - void useclearbox(); - void entryanims(); - void nextfolder(); - void getfreead(); - void showarrows(); - void walkintoroom(); - void usehatch(); - void printoutermon(); - void setuppit(); - void showpcx(); - void showdecisions(); - void checkspeed(); - //void printchar(); - void showkeypad(); - //void obtoinv(); - //void getroomdata(); - void removeobfrominv(); - void usecoveredbox(); - void openyourneighbour(); - void fadescreenuphalf(); - void getridoftempcharset(); + void runTap(); + void dumpDiaryKeys(); + void checkForExit(); + void lookInInterface(); + void inToInv(); + void adjustLeft(); + void deleteExText(); + void entryAnims(); + void getFreeAd(); + void removeObFromInv(); void heavy(); - void endpaltostart(); - void showkeys(); - void usekey(); - void locklighton(); - void useladderb(); - //void spriteupdate(); - void usetempcharset(); - void discops(); - //void printdirect(); - //void delthisone(); - //void makebackob(); - void middlepanel(); - void dumpwatch(); - void saveload(); - void monitorlogo(); - void loadposition(); - void entersymbol(); - void showword(); - void dirfile(); - //void bresenhams(); - //void walktotext(); - void pickupconts(); - void locklightoff(); - void wearwatch(); - void runintroseq(); - //void doblocks(); - void opensarters(); - //void delpointer(); - void attendant(); - void nextsymbol(); - void monks2text(); - void clearpalette(); - void cantdrop(); - //void maptopanel(); - //void calcmapad(); - void getridofall(); - void copper(); - void folderhints(); - void openhoteldoor(); - //void removesetobject(); - //void dumptimedtext(); - //void frameoutfx(); - void blank(); - void drinker(); - void nextcolon(); - void placefreeobject(); - void allpalette(); - //void loopchannel0(); - void initrain(); - void showleftpage(); - void rockstar(); - void adjustright(); - void putunderzoom(); - void vsync(); - //void finishedwalking(); - void findinvpos(); - void dumpmenu(); - //void examineobtext(); - void liftnoise(); - void workoutframes(); - void getbackfromob(); - void dumpsymbox(); - void loadgame(); - void getridoftemp(); - void showcity(); - void dumpsymbol(); - void disablepath(); - void buttonsix(); - void intro2text(); - void showouterpad(); - void getkeyandlogo(); - void selectob(); - //void checkcoords(); - //void usetext(); - void chewy(); - void accesslighton(); - void useplinth(); - //void adjustlen(); - //void quickquit(); - //void showpointer(); - void usecooker(); - void loadmenu(); - void checkforemm(); - //void checkifpathison(); - //void finalframe(); + void useKey(); + void dirFile(); + void pickupConts(); + void nextColon(); + void findInvPos(); + void getKeyAndLogo(); + void selectOb(); void receptionist(); - void selectslot(); - void openfilenocheck(); - //void readoneblock(); - void fadeupmon(); - void paltoendpal(); - void fadetowhite(); - void loadsavebox(); - void soundend(); - void redes(); - void errormessage1(); - void clearchanges(); - void errormessage3(); - //void deletetaken(); - void putundermenu(); - void intromonks2(); - void intromagic2(); - void intromagic3(); - void edeninbath(); - void intromagic1(); - void showdiarypage(); - void useshield(); - void getbacktoops(); - void rollendcredits(); - void intro1text(); - void transfertoex(); - void playchannel1(); - void playchannel0(); - void usemon(); - void steady(); - //void pixelcheckset(); - void reexfrominv(); - void examinventory(); - void talk(); - void usedryer(); - //void dumpeverything(); - //void readmouse2(); - //void zoom(); - void outofinv(); - void viewfolder(); - //void walking(); - void diarykeyp(); - //void readabyte(); - //void showframe(); - void random(); - void mainman(); - void mansatstill(); - void channel1only(); - void checkbasemem(); - void lastfolder(); - void transfermap(); - //void showreelframe(); - void showmonk(); - void diarykeyn(); - void set16colpalette(); - void convicons(); - void interviewer(); - void sparky(); - void purgeanitem(); - void madman(); - void createpanel(); - //void turnpathon(); - void enablesoundint(); - void madmanstelly(); - void constant(); - void loadroomssample(); - void sparkydrip(); - void paltostartpal(); - void bossman(); - void getridofpit(); - void convnum(); - //void checkifset(); - void nothelderror(); - //void readheader(); - void getsetad(); - void textformonk(); - void reconstruct(); - void soldier1(); - //void animpointer(); - void getundercentre(); - void checkforexit(); - void loadseg(); - void makeheader(); - void setkeyboardint(); - void priest(); - //void readmouse(); - void powerlighton(); - void savefilewrite(); + void selectSlot(); + void fadeUpMon(); + void showDiaryPage(); + void reExFromInv(); + void businessMan(); + void outOfInv(); + void transferMap(); + void purgeAnItem(); + void purgeALocation(); + void notHeldError(); + void getSetAd(); + void getUnderCentre(); + void showKeys(); void printmessage2(); - //void showallfree(); - void loadnews(); - void rollem(); - //void makeworn(); - void hangonpq(); - void startup(); - void savegame(); - void startpaltoend(); - void showicon(); - void findopenpos(); - void describeob(); - void deleteexframe(); - void folderexit(); - void dosreturn(); - void wheelsound(); - void actualsave(); - void autolook(); - void playguitar(); - void transfertext(); - void searchforsame(); - void showmainops(); - void getback1(); - void setlocation(); - void fadefromwhite(); - void checksoundint(); - void usewindow(); - void wearshades(); - void onedigit(); - void pitinterupt(); - void deleverything(); - void fadescreendown(); - //void findxyfrompath(); - void namestoold(); - //void getxad(); - void openinv(); - void lookatplace(); - void useaxe(); - void examineob(); - void buttonnought(); - void useelvdoor(); - void putbackobstuff(); - void useladder(); - void realcredits(); - void handclap(); - void smokebloke(); - void afterintroroom(); - //void printundermon(); - void buttonnine(); - void findallopen(); - void loadintotemp3(); - void loadintotemp2(); - void gamer(); - void poolguard(); - void readfromfile(); - void initialinv(); - void quitsymbol(); - //void modifychar(); - //void initman(); - void settopright(); - void findsetobject(); - void singlekey(); - //void seecommandtail(); - //void getundertimed(); - void hangone(); - void carparkdrip(); - void usediary(); - void deleteexobject(); - //void frameoutnm(); - void moneypoke(); - void destselect(); - void restoreems(); - void lastdest(); - void removefreeobject(); - void trapdoor(); - void openlouis(); - void buttonthree(); - void getundermenu(); - //void randomnumber(); - void lookatcard(); + void findOpenPos(); + void describeOb(); + void deleteExFrame(); + void searchForSame(); + void rollEm(); + void poolGuard(); + void lookAtPlace(); + void useAxe(); + void findAllOpen(); + void fillOpen(); + void findSetObject(); + void deleteExObject(); + void removeFreeObject(); + void lookAtCard(); void helicopter(); - void scrollmonitor(); - void setsoundoff(); - void setpickup(); - //void doorway(); - void dropobject(); - void isitright(); - void reexfromopen(); - //void fillryan(); - void drawitall(); - void usestereo(); - void showcurrentfile(); - //void turnpathoff(); - //void copyname(); - void look(); - void setmouse(); - //void checkone(); - //void transferinv(); - void candles2(); - void pickupob(); - void error(); - void showopbox(); - void clearbeforeload(); - void biblequote(); - void doload(); - void showexit(); - void blockget(); - void usetrainer(); - //void allocatework(); - void addtopresslist(); - //void walkandexamine(); - void dmaend(); - //void quickquit2(); - void twodigitnum(); - //void madmantext(); - void dumpcurrent(); - void textforend(); - void showdiarykeys(); - void dontloadseg(); - //void madmode(); - void intro3text(); - void allocatemem(); - void sortoutmap(); - //void showrain(); - void useopened(); - void inventory(); - void powerlightoff(); - void fillopen(); - void showoutermenu(); - void signon(); - void deleteextext(); - void foghornsound(); - void showrightpage(); - void showloadops(); - void examicon(); - void showgun(); - void switchryanon(); - //void personnametext(); - void louischair(); - void saveems(); - void locationpic(); - //void getflagunderp(); - void dolook(); - void opentvdoor(); - void triggermessage(); - void smallcandle(); - //void plotreel(); - void swapwithopen(); - //void makesprite(); + void getEitherAd(); + void setPickup(); + void dropObject(); + void openOb(); + void drawItAll(); + void useStereo(); + void showDiaryKeys(); + void useOpened(); + void signOn(); + void locationPic(); + void triggerMessage(); + void swapWithOpen(); void dreamweb(); - void droperror(); - void edenscdplayer(); - void calledensdlift(); - void checkinside(); - void gates(); - void newgame(); - void showwatch(); - //void turnanypathon(); - void restorereels(); - void setwalk(); - //void useroutine(); - void zoomicon(); - //void findlen(); - void findpathofpoint(); - void issetobonmap(); - void getdestinfo(); - void drunk(); - void getridoftemptext(); - void setuptimeduse(); - void grafittidoor(); - void input(); - void nextdest(); - //void getdimension(); - void makecaps(); + void checkInside(); + void findPathOfPoint(); + void getDestInfo(); + void setupTimedUse(); + void makeCaps(); void read(); - void fadescreenups(); - //void checkdest(); - //void hangon(); - void loadpalfromiff(); - //void facerightway(); - void startup1(); - void hotelcontrol(); + void additionalText(); void mugger(); - void atmospheres(); - void out22c(); - void loadpersonal(); - void gettingshot(); - void settopleft(); - void searchforstring(); - //void clearsprites(); - //void obpicture(); - void selectopenob(); - //void widedoor(); - void security(); - //void printasprite(); - void buttonfive(); - void soundonreels(); - void usegun(); - void autoappear(); - //void findnextcolon(); - //void readmouse4(); - void openryan(); - void callhotellift(); - void showman(); - void usefullcart(); - void newplace(); - //void movemap(); - void loadsample(); - void usecardreader1(); - void usecardreader2(); - void usecardreader3(); - void tattooman(); - void usehandle(); - void openfile(); - void usecharset1(); - //void makenextblock(); - void showpuztext(); - //void addalong(); - //void width160(); - void incryanpage(); - //void dodoor(); - void greyscalesum(); - void buttoneight(); - void findexobject(); - void errormessage2(); - void usechurchhole(); - void searchforfiles(); - void monkspeaking(); - void fadecalculation(); - //void waitframes(); - void clearrest(); - //void getreelframeax(); - void barwoman(); - void roomname(); - void credits(); - void madmanrun(); - void randomnum1(); - void keeper(); - void afternewroom(); - void getexad(); - void openforsave(); - void closefile(); - void delcurs(); - void randomaccess(); - void splitintolines(); - //void checkifex(); - //void findobname(); - void initialmoncols(); - void checkforshake(); - void usebuttona(); - void fadescreenup(); - //void getnextword(); - void generalerror(); - void actualload(); - void allocateload(); - void saveposition(); - void mode640x480(); - void openeden(); - void execcommand(); - void obsthatdothings(); - void updatesymbolbot(); - void findpuztext(); - void usechurchgate(); - void monkandryan(); - void allocatebuffers(); - void swapwithinv(); - void usecontrol(); - void buttonseven(); - void redrawmainscrn(); - void showgroup(); - //void findallryan(); - //void channel0tran(); - void buttonpress(); - //void parseblaster(); - //void readmouse1(); - void makemainscreen(); - void usewinch(); - void setbotright(); - //void readmouse3(); - void showfirstuse(); - void setupemm(); - void aide(); - //void getmapad(); - void getlocation(); - void geteitherad(); - //void placesetobject(); - //void drawflags(); - void zoomonoff(); - void updatesymboltop(); - //void showryanpage(); - void printlogo(); - void allpointer(); - void showseconduse(); - void clearreels(); - void malefan(); - void dosaveload(); - void createname(); - void readcitypic(); - void getpersontext(); - void intoinv(); - void showtime(); + void searchForString(); + void selectOpenOb(); + void useGun(); + void useHandle(); + void incRyanPage(); + void findExObject(); + void clearChanges(); + void searchForFiles(); + void getExAd(); + void initialMonCols(); + void execCommand(); + void updateSymbolBot(); + void findPuzText(); + void swapWithInv(); + void useControl(); + void adjustRight(); + void transferToEx(); + void updateSymbolTop(); + void getPersonText(); void parser(); - void hangonw(); - void intro(); - //void hangonp(); - void fadescreendowns(); - void openhoteldoor2(); - void getridoftempsp(); - void scanfornames(); - //void setallchanges(); - void readsetdata(); - //void printboth(); - void standardload(); - void undertextline(); - void findroominloc(); - void sitdowninbar(); - void shownames(); - void savefileread(); - void emergencypurge(); - void usemenu(); - void alleybarksound(); - void dosometalk(); - void usecart(); - void intromusic(); - void quitkey(); - void processtrigger(); - void monmessage(); - void readdesticon(); - void randomnum2(); - void loadsecondsample(); - void transfercontoex(); - //void multiput(); - //void printmessage(); - void businessman(); - void switchryanoff(); - //void commandwithob(); - void panelicons1(); - void adjustdown(); - void withwhat(); - void openob(); - void createfile(); - void userailing(); - void accesslightoff(); - void usehole(); - void useobject(); - void volumeadjust(); - //void checkiffree(); + void emergencyPurge(); + void processTrigger(); + void transferConToEx(); + void adjustDown(); + void withWhat(); }; -} + +} // End of namespace DreamGen #endif diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 0e43f18db6..b4fc1b7b77 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -30,9 +30,6 @@ #include "common/timer.h" #include "common/util.h" -#include "audio/mixer.h" -#include "audio/decoders/raw.h" - #include "graphics/palette.h" #include "graphics/surface.h" @@ -42,9 +39,8 @@ namespace DreamWeb { DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc) : - Engine(syst), _gameDescription(gameDesc), _rnd("dreamweb") { + Engine(syst), _gameDescription(gameDesc), _rnd("dreamweb"), _context(this), _base(_context) { - _context.engine = this; // Setup mixer _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); @@ -55,7 +51,6 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam _console = 0; DebugMan.addDebugChannel(kDebugAnimation, "Animation", "Animation Debug Flag"); DebugMan.addDebugChannel(kDebugSaveLoad, "SaveLoad", "Track Save/Load Function"); - _outSaveFile = 0; _inSaveFile = 0; _speed = 1; _turbo = false; @@ -63,10 +58,18 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam _channel0 = 0; _channel1 = 0; + _icons1 = NULL; + _icons2 = NULL; + _tempCharset = NULL; + _language = gameDesc->desc.language; } DreamWebEngine::~DreamWebEngine() { + assert(_icons1 == NULL); + assert(_icons2 == NULL); + assert(_tempCharset == NULL); + DebugMan.clearAllDebugChannels(); delete _console; } @@ -93,19 +96,18 @@ void DreamWebEngine::waitForVSync() { setVSyncInterrupt(false); } - _context.doshake(); - _context.dofade(); + _base.doShake(); + _base.doFade(); _system->updateScreen(); } void DreamWebEngine::quit() { - _context.data.byte(DreamGen::DreamGenContext::kQuitrequested) = 1; - _context.data.byte(DreamGen::DreamGenContext::kLasthardkey) = 1; + _base.data.byte(DreamGen::kQuitrequested) = 1; + _base.data.byte(DreamGen::kLasthardkey) = 1; } void DreamWebEngine::processEvents() { - Common::EventManager *event_manager = _system->getEventManager(); - if (event_manager->shouldQuit()) { + if (_eventMan->shouldQuit()) { quit(); return; } @@ -113,7 +115,7 @@ void DreamWebEngine::processEvents() { soundHandler(); Common::Event event; int softKey, hardKey; - while (event_manager->pollEvent(event)) { + while (_eventMan->pollEvent(event)) { switch(event.type) { case Common::EVENT_RTL: quit(); @@ -136,8 +138,8 @@ void DreamWebEngine::processEvents() { break; case Common::KEYCODE_c: //skip statue puzzle - _context.data.byte(DreamGen::DreamGenContext::kSymbolbotnum) = 3; - _context.data.byte(DreamGen::DreamGenContext::kSymboltopnum) = 5; + _base.data.byte(DreamGen::kSymbolbotnum) = 3; + _base.data.byte(DreamGen::kSymboltopnum) = 5; break; default: @@ -167,7 +169,7 @@ void DreamWebEngine::processEvents() { break; } - _context.data.byte(DreamGen::DreamGenContext::kLasthardkey) = hardKey; + _base.data.byte(DreamGen::kLasthardkey) = hardKey; // The rest of the keys are converted to ASCII. This // is fairly restrictive, and eventually we may want @@ -203,18 +205,17 @@ void DreamWebEngine::processEvents() { } } - Common::Error DreamWebEngine::run() { syncSoundSettings(); _console = new DreamWebConsole(this); ConfMan.registerDefault("dreamweb_originalsaveload", "true"); - getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 70, this, "dreamwebVSync"); + _timer->installTimerProc(vSyncInterrupt, 1000000 / 70, this, "dreamwebVSync"); _context.__start(); - _context.data.byte(DreamGen::DreamGenContext::kQuitrequested) = 0; + _base.data.byte(DreamGen::kQuitrequested) = 0; - getTimerManager()->removeTimerProc(vSyncInterrupt); + _timer->removeTimerProc(vSyncInterrupt); return Common::kNoError; } @@ -222,8 +223,8 @@ Common::Error DreamWebEngine::run() { void DreamWebEngine::setSpeed(uint speed) { debug(0, "setting speed %u", speed); _speed = speed; - getTimerManager()->removeTimerProc(vSyncInterrupt); - getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 70 / speed, this, "dreamwebVSync"); + _timer->removeTimerProc(vSyncInterrupt); + _timer->installTimerProc(vSyncInterrupt, 1000000 / 70 / speed, this, "dreamwebVSync"); } void DreamWebEngine::openFile(const Common::String &name) { @@ -231,7 +232,10 @@ void DreamWebEngine::openFile(const Common::String &name) { closeFile(); if (_file.open(name)) return; - _inSaveFile = _system->getSavefileManager()->openForLoading(name); + // File not found? See if there is a save state with this name + // FIXME: Is this really needed? If yes, document why; if not, + // remove all traces of _inSaveFile. + _inSaveFile = _saveFileMan->openForLoading(name); if (_inSaveFile) return; error("cannot open file %s", name.c_str()); @@ -258,55 +262,32 @@ void DreamWebEngine::closeFile() { _file.close(); delete _inSaveFile; _inSaveFile = 0; - delete _outSaveFile; - _outSaveFile = 0; -} - -void DreamWebEngine::openSaveFileForWriting(const Common::String &name) { - processEvents(); - delete _outSaveFile; - _outSaveFile = _system->getSavefileManager()->openForSaving(name); -} - -bool DreamWebEngine::openSaveFileForReading(const Common::String &name) { - processEvents(); - delete _inSaveFile; - _inSaveFile = _system->getSavefileManager()->openForLoading(name); - return _inSaveFile != 0; -} - -uint DreamWebEngine::writeToSaveFile(const uint8 *data, uint size) { - processEvents(); - if (!_outSaveFile) - error("save file was not opened for writing"); - return _outSaveFile->write(data, size); } -uint DreamWebEngine::readFromSaveFile(uint8 *data, uint size) { - processEvents(); - if (!_inSaveFile) - error("save file was not opened for reading"); - return _inSaveFile->read(data, size); +Common::String DreamWebEngine::getSavegameFilename(int slot) const { + // TODO: Are saves from all versions of Dreamweb compatible with each other? + // Then we can can consider keeping the filenames as DREAMWEB.Dnn. + // Otherwise, this must be changed to be target dependent. + //Common::String filename = _targetName + Common::String::format(".d%02d", savegameId); + Common::String filename = Common::String::format("DREAMWEB.D%02d", slot); + return filename; } - void DreamWebEngine::keyPressed(uint16 ascii) { debug(2, "key pressed = %04x", ascii); - uint8* keybuf = _context.data.ptr(5912, 16); //fixme: some hardcoded offsets are not added as consts - uint16 in = (_context.data.word(DreamGen::DreamGenContext::kBufferin) + 1) & 0x0f; - uint16 out = _context.data.word(DreamGen::DreamGenContext::kBufferout); + uint16 in = (_base.data.word(DreamGen::kBufferin) + 1) & 0x0f; + uint16 out = _base.data.word(DreamGen::kBufferout); if (in == out) { warning("keyboard buffer is full"); return; } - _context.data.word(DreamGen::DreamGenContext::kBufferin) = in; - keybuf[in] = ascii; + _base.data.word(DreamGen::kBufferin) = in; + DreamGen::g_keyBuffer[in] = ascii; } void DreamWebEngine::mouseCall(uint16 *x, uint16 *y, uint16 *state) { processEvents(); - Common::EventManager *eventMan = _system->getEventManager(); - Common::Point pos = eventMan->getMousePos(); + Common::Point pos = _eventMan->getMousePos(); if (pos.x > 298) pos.x = 298; if (pos.x < 15) @@ -318,54 +299,26 @@ void DreamWebEngine::mouseCall(uint16 *x, uint16 *y, uint16 *state) { *x = pos.x; *y = pos.y; - unsigned newState = eventMan->getButtonState(); + unsigned newState = _eventMan->getButtonState(); *state = (newState == _oldMouseState? 0 : newState); _oldMouseState = newState; } -void DreamWebEngine::fadeDos() { - _context.ds = _context.es = _context.data.word(DreamGen::DreamGenContext::kBuffers); - return; //fixme later - waitForVSync(); - //processEvents will be called from vsync - uint8 *dst = _context.es.ptr(DreamGen::DreamGenContext::kStartpal, 768); - getPalette(dst, 0, 64); - for(int fade = 0; fade < 64; ++fade) { - for(int c = 0; c < 768; ++c) { //original sources decrement 768 values -> 256 colors - if (dst[c]) { - --dst[c]; - } - } - setPalette(dst, 0, 64); - waitForVSync(); - } -} - -void DreamWebEngine::setPalette() { - processEvents(); - unsigned n = (uint16)_context.cx; - uint8 *src = _context.ds.ptr(_context.si, n * 3); - setPalette(src, _context.al, n); - _context.si += n * 3; - _context.cx = 0; -} - void DreamWebEngine::getPalette(uint8 *data, uint start, uint count) { _system->getPaletteManager()->grabPalette(data, start, count); - while(count--) + while (count--) *data++ >>= 2; } void DreamWebEngine::setPalette(const uint8 *data, uint start, uint count) { assert(start + count <= 256); uint8 fixed[768]; - for(uint i = 0; i < count * 3; ++i) { + for (uint i = 0; i < count * 3; ++i) { fixed[i] = data[i] << 2; } _system->getPaletteManager()->setPalette(fixed, start, count); } - void DreamWebEngine::blit(const uint8 *src, int pitch, int x, int y, int w, int h) { if (y + h > 200) h = 200 - y; @@ -377,28 +330,23 @@ void DreamWebEngine::blit(const uint8 *src, int pitch, int x, int y, int w, int } void DreamWebEngine::printUnderMonitor() { - _context.es = _context.data.word(DreamGen::DreamGenContext::kWorkspace); - _context.di = DreamGen::DreamGenContext::kScreenwidth * 43 + 76; - _context.si = _context.di + 8 * DreamGen::DreamGenContext::kScreenwidth; + uint8 *dst = _base._workspace + DreamGen::kScreenwidth * 43 + 76; Graphics::Surface *s = _system->lockScreen(); if (!s) error("lockScreen failed"); - for(uint y = 0; y < 104; ++y) { + for (uint y = 0; y < 104; ++y) { uint8 *src = (uint8 *)s->getBasePtr(76, 43 + 8 + y); - uint8 *dst = _context.es.ptr(_context.di, 170); - for(uint x = 0; x < 170; ++x) { + for (uint x = 0; x < 170; ++x) { if (*src < 231) *dst++ = *src++; else { ++dst; ++src; } } - _context._add(_context.di, DreamGen::DreamGenContext::kScreenwidth); - _context._add(_context.si, DreamGen::DreamGenContext::kScreenwidth); + dst += DreamGen::kScreenwidth - 170; } - _context.cx = 0; _system->unlockScreen(); } @@ -406,173 +354,6 @@ void DreamWebEngine::cls() { _system->fillScreen(0); } -void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) { - debug(1, "playSound(%u, %u, %u)", channel, id, loops); - - int bank = 0; - bool speech = false; - Audio::Mixer::SoundType type = channel == 0? - Audio::Mixer::kMusicSoundType: Audio::Mixer::kSFXSoundType; - - if (id >= 12) { - id -= 12; - bank = 1; - if (id == 50) { - speech = true; - type = Audio::Mixer::kSpeechSoundType; - } - } - const SoundData &data = _soundData[bank]; - - Audio::SeekableAudioStream *raw; - if (!speech) { - if (id >= data.samples.size() || data.samples[id].size == 0) { - warning("invalid sample #%u played", id); - return; - } - - const Sample &sample = data.samples[id]; - uint8 *buffer = (uint8 *)malloc(sample.size); - if (!buffer) - error("out of memory: cannot allocate memory for sound(%u bytes)", sample.size); - memcpy(buffer, data.data.begin() + sample.offset, sample.size); - - raw = Audio::makeRawStream( - buffer, - sample.size, 22050, Audio::FLAG_UNSIGNED); - } else { - uint8 *buffer = (uint8 *)malloc(_speechData.size()); - memcpy(buffer, _speechData.begin(), _speechData.size()); - if (!buffer) - error("out of memory: cannot allocate memory for sound(%u bytes)", _speechData.size()); - raw = Audio::makeRawStream( - buffer, - _speechData.size(), 22050, Audio::FLAG_UNSIGNED); - - } - - Audio::AudioStream *stream; - if (loops > 1) { - stream = new Audio::LoopingAudioStream(raw, loops < 255? loops: 0); - } else - stream = raw; - - if (_mixer->isSoundHandleActive(_channelHandle[channel])) - _mixer->stopHandle(_channelHandle[channel]); - _mixer->playStream(type, &_channelHandle[channel], stream); -} - -void DreamWebEngine::stopSound(uint8 channel) { - debug(1, "stopSound(%u)", channel); - assert(channel == 0 || channel == 1); - _mixer->stopHandle(_channelHandle[channel]); - if (channel == 0) - _channel0 = 0; - else - _channel1 = 0; -} - -bool DreamWebEngine::loadSpeech(const Common::String &filename) { - if (ConfMan.getBool("speech_mute")) - return false; - - Common::File file; - if (!file.open("speech/" + filename)) - return false; - - debug(1, "loadSpeech(%s)", filename.c_str()); - - uint size = file.size(); - _speechData.resize(size); - file.read(_speechData.begin(), size); - file.close(); - return true; -} - - -void DreamWebEngine::soundHandler() { - _context.data.byte(_context.kSubtitles) = ConfMan.getBool("subtitles"); - _context.push(_context.ax); - _context.volumeadjust(); - _context.ax = _context.pop(); - - uint volume = _context.data.byte(DreamGen::DreamGenContext::kVolume); - //.vol file loaded into soundbuf:0x4000 - //volume table at (volume * 0x100 + 0x3f00) - //volume value could be from 1 to 7 - //1 - 0x10-0xff - //2 - 0x1f-0xdf - //3 - 0x2f-0xd0 - //4 - 0x3e-0xc1 - //5 - 0x4d-0xb2 - //6 - 0x5d-0xa2 - //7 - 0x6f-0x91 - if (volume >= 8) - volume = 7; - volume = (8 - volume) * Audio::Mixer::kMaxChannelVolume / 8; - _mixer->setChannelVolume(_channelHandle[0], volume); - - uint8 ch0 = _context.data.byte(DreamGen::DreamGenContext::kCh0playing); - if (ch0 == 255) - ch0 = 0; - uint8 ch1 = _context.data.byte(DreamGen::DreamGenContext::kCh1playing); - if (ch1 == 255) - ch1 = 0; - uint8 ch0loop = _context.data.byte(DreamGen::DreamGenContext::kCh0repeat); - - if (_channel0 != ch0) { - _channel0 = ch0; - if (ch0) { - playSound(0, ch0, ch0loop); - } - } - if (_channel1 != ch1) { - _channel1 = ch1; - if (ch1) { - playSound(1, ch1, 1); - } - } - if (!_mixer->isSoundHandleActive(_channelHandle[0])) { - _context.data.byte(DreamGen::DreamGenContext::kCh0playing) = 255; - _channel0 = 0; - } - if (!_mixer->isSoundHandleActive(_channelHandle[1])) { - _context.data.byte(DreamGen::DreamGenContext::kCh1playing) = 255; - _channel1 = 0; - } - -} - -void DreamWebEngine::loadSounds(uint bank, const Common::String &filename) { - debug(1, "loadSounds(%u, %s)", bank, filename.c_str()); - Common::File file; - if (!file.open(filename)) { - warning("cannot open %s", filename.c_str()); - return; - } - - uint8 header[0x60]; - file.read(header, sizeof(header)); - uint tablesize = READ_LE_UINT16(header + 0x32); - debug(1, "table size = %u", tablesize); - - SoundData &soundData = _soundData[bank]; - soundData.samples.resize(tablesize / 6); - uint total = 0; - for(uint i = 0; i < tablesize / 6; ++i) { - uint8 entry[6]; - Sample &sample = soundData.samples[i]; - file.read(entry, sizeof(entry)); - sample.offset = entry[0] * 0x4000 + READ_LE_UINT16(entry + 1); - sample.size = READ_LE_UINT16(entry + 3) * 0x800; - total += sample.size; - debug(1, "offset: %08x, size: %u", sample.offset, sample.size); - } - soundData.data.resize(total); - file.read(soundData.data.begin(), total); - file.close(); -} - uint8 DreamWebEngine::modifyChar(uint8 c) const { if (c < 128) return c; diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 97f6007f9d..7ff0005fa4 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -40,6 +40,20 @@ #include "dreamweb/dreamgen.h" #include "dreamweb/console.h" +#include "dreamweb/structs.h" + +namespace DreamGen { + +// These are for ReelRoutine::reelPointer, which is a callback field. +const uint16 addr_backobject = 0xc170; +const uint16 addr_mainman = 0xc138; + +// Keyboard buffer. data.word(kBufferin) and data.word(kBufferout) are indexes +// into this, making it a ring buffer +extern uint8 g_keyBuffer[16]; + +} + namespace DreamWeb { // Engine Debug Flags @@ -84,19 +98,13 @@ public: void mouseCall(uint16 *x, uint16 *y, uint16 *state); //fill mouse pos and button state void processEvents(); - void setPalette(); - void fadeDos(); void blit(const uint8 *src, int pitch, int x, int y, int w, int h); void cls(); void getPalette(uint8 *data, uint start, uint count); void setPalette(const uint8 *data, uint start, uint count); - void openSaveFileForWriting(const Common::String &name); - uint writeToSaveFile(const uint8 *data, uint size); - - bool openSaveFileForReading(const Common::String &name); - uint readFromSaveFile(uint8 *data, uint size); + Common::String getSavegameFilename(int slot) const; void setShakePos(int pos) { _system->setShakePos(pos); } void printUnderMonitor(); @@ -113,6 +121,20 @@ public: void stopSound(uint8 channel); + DreamGen::Frame *icons1() const { return (DreamGen::Frame *)_icons1; } + DreamGen::Frame *icons2() const { return (DreamGen::Frame *)_icons2; } + void setIcons1(void *frames) { assert(_icons1 == NULL); _icons1 = frames; } + void setIcons2(void *frames) { assert(_icons2 == NULL); _icons2 = frames; } + void freeIcons1() { free(_icons1); _icons1 = NULL; } + void freeIcons2() { free(_icons2); _icons2 = NULL; } + + DreamGen::Frame *tempCharset() const { return (DreamGen::Frame *)_tempCharset; } + void setTempCharset(void *frames) { assert(_tempCharset == NULL); _tempCharset = frames; } + void freeTempCharset() { free(_tempCharset); _tempCharset = NULL; } + + DreamGen::Frame *currentCharset() const { return _currentCharset; } + void setCurrentCharset(DreamGen::Frame *charset) { _currentCharset = charset; } + private: void keyPressed(uint16 ascii); void setSpeed(uint speed); @@ -123,7 +145,6 @@ private: Common::RandomSource _rnd; Common::File _file; - Common::OutSaveFile *_outSaveFile; Common::InSaveFile *_inSaveFile; uint _speed; @@ -148,7 +169,13 @@ private: Audio::SoundHandle _channelHandle[2]; uint8 _channel0, _channel1; + void *_icons1; + void *_icons2; + void *_tempCharset; + DreamGen::Frame *_currentCharset; + DreamGen::DreamGenContext _context; + DreamGen::DreamBase &_base; }; } // End of namespace DreamWeb diff --git a/engines/dreamweb/keypad.cpp b/engines/dreamweb/keypad.cpp new file mode 100644 index 0000000000..09bdcb837b --- /dev/null +++ b/engines/dreamweb/keypad.cpp @@ -0,0 +1,267 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "dreamweb/dreamweb.h" + +namespace DreamGen { + +void DreamGenContext::getUnderMenu() { + multiGet(getSegment(data.word(kBuffers)).ptr(kUndertimedtext, 0), kMenux, kMenuy, 48, 48); +} + +void DreamGenContext::putUnderMenu() { + multiPut(getSegment(data.word(kBuffers)).ptr(kUndertimedtext, 0), kMenux, kMenuy, 48, 48); +} + +void DreamGenContext::singleKey(uint8 key, uint16 x, uint16 y) { + if (key == data.byte(kGraphicpress)) { + key += 11; + if (data.byte(kPresscount) < 8) + key -= 11; + } + key -= 20; + showFrame(tempGraphics(), x, y, key, 0); +} + +void DreamGenContext::loadKeypad() { + loadIntoTemp("DREAMWEB.G02"); +} + +void DreamGenContext::showKeypad() { + singleKey(22, kKeypadx+9, kKeypady+5); + singleKey(23, kKeypadx+31, kKeypady+5); + singleKey(24, kKeypadx+53, kKeypady+5); + singleKey(25, kKeypadx+9, kKeypady+23); + singleKey(26, kKeypadx+31, kKeypady+23); + singleKey(27, kKeypadx+53, kKeypady+23); + singleKey(28, kKeypadx+9, kKeypady+41); + singleKey(29, kKeypadx+31, kKeypady+41); + singleKey(30, kKeypadx+53, kKeypady+41); + singleKey(31, kKeypadx+9, kKeypady+59); + singleKey(32, kKeypadx+31, kKeypady+59); + if (data.byte(kLightcount)) { + --data.byte(kLightcount); + uint8 frameIndex; + uint16 y; + if (data.byte(kLockstatus)) { + frameIndex = 36; + y = kKeypady-1+63; + } else { + frameIndex = 41; + y = kKeypady+4+63; + } + if ((data.byte(kLightcount) >= 60) && (data.byte(kLightcount) < 100)) + --frameIndex; + showFrame(tempGraphics(), kKeypadx+60, y, frameIndex, 0); + } +} + +bool DreamGenContext::isItRight(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3) { + + return digit0 == data.byte(kPresslist+0) && digit1 == data.byte(kPresslist+1) + && digit2 == data.byte(kPresslist+2) && digit3 == data.byte(kPresslist+3); +} + +void DreamGenContext::addToPressList() { + if (data.word(kPresspointer) == 5) + return; + uint8 pressed = data.byte(kPressed); + if (pressed == 10) + pressed = 0; + + data.byte(kPresslist + data.word(kPresspointer)) = pressed; + ++data.word(kPresspointer); +} + +void DreamGenContext::enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3) { + RectWithCallback keypadList[] = { + { kKeypadx+9,kKeypadx+30,kKeypady+9,kKeypady+22,&DreamGenContext::buttonOne }, + { kKeypadx+31,kKeypadx+52,kKeypady+9,kKeypady+22,&DreamGenContext::buttonTwo }, + { kKeypadx+53,kKeypadx+74,kKeypady+9,kKeypady+22,&DreamGenContext::buttonThree }, + { kKeypadx+9,kKeypadx+30,kKeypady+23,kKeypady+40,&DreamGenContext::buttonFour }, + { kKeypadx+31,kKeypadx+52,kKeypady+23,kKeypady+40,&DreamGenContext::buttonFive }, + { kKeypadx+53,kKeypadx+74,kKeypady+23,kKeypady+40,&DreamGenContext::buttonSix }, + { kKeypadx+9,kKeypadx+30,kKeypady+41,kKeypady+58,&DreamGenContext::buttonSeven }, + { kKeypadx+31,kKeypadx+52,kKeypady+41,kKeypady+58,&DreamGenContext::buttonEight }, + { kKeypadx+53,kKeypadx+74,kKeypady+41,kKeypady+58,&DreamGenContext::buttonNine }, + { kKeypadx+9,kKeypadx+30,kKeypady+59,kKeypady+73,&DreamGenContext::buttonNought }, + { kKeypadx+31,kKeypadx+74,kKeypady+59,kKeypady+73,&DreamGenContext::buttonEnter }, + { kKeypadx+72,kKeypadx+86,kKeypady+80,kKeypady+94,&DreamGenContext::quitKey }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + + getRidOfReels(); + loadKeypad(); + createPanel(); + showIcon(); + showOuterPad(); + showKeypad(); + readMouse(); + showPointer(); + workToScreenCPP(); + delPointer(); + data.word(kPresspointer) = 0; + data.byte(kGetback) = 0; + while (true) { + delPointer(); + readMouse(); + showKeypad(); + showPointer(); + vSync(); + if (data.byte(kPresscount) == 0) { + data.byte(kPressed) = 255; + data.byte(kGraphicpress) = 255; + vSync(); + } else + --data.byte(kPresscount); + + dumpPointer(); + dumpKeypad(); + dumpTextLine(); + checkCoords(keypadList); + if (quitRequested() || (data.byte(kGetback) == 1)) + break; + if (data.byte(kLightcount) == 1) { + if (data.byte(kLockstatus) == 0) + break; + } else { + if (data.byte(kPresscount) == 40) { + addToPressList(); + if (data.byte(kPressed) == 11) { + if (isItRight(digit0, digit1, digit2, digit3)) + data.byte(kLockstatus) = 0; + playChannel1(11); + data.byte(kLightcount) = 120; + data.word(kPresspointer) = 0; + } + } + } + } + data.byte(kManisoffscreen) = 0; + getRidOfTemp(); + restoreReels(); + redrawMainScrn(); + workToScreenM(); +} + +void DreamGenContext::buttonOne() { + buttonPress(1); +} + +void DreamGenContext::buttonTwo() { + buttonPress(2); +} + +void DreamGenContext::buttonThree() { + buttonPress(3); +} + +void DreamGenContext::buttonFour() { + buttonPress(4); +} + +void DreamGenContext::buttonFive() { + buttonPress(5); +} + +void DreamGenContext::buttonSix() { + buttonPress(6); +} + +void DreamGenContext::buttonSeven() { + buttonPress(7); +} + +void DreamGenContext::buttonEight() { + buttonPress(8); +} + +void DreamGenContext::buttonNine() { + buttonPress(9); +} + +void DreamGenContext::buttonNought() { + buttonPress(10); +} + +void DreamGenContext::buttonEnter() { + buttonPress(11); +} + +void DreamGenContext::buttonPress(uint8 buttonId) { + uint8 commandType = 100 + buttonId; + if (data.byte(kCommandtype) != commandType) { + data.byte(kCommandtype) = commandType; + commandOnly(buttonId + 4); + } + if ((data.word(kMousebutton) & 1) && (data.word(kMousebutton) != data.word(kOldbutton))) { + data.byte(kPressed) = buttonId; + data.byte(kGraphicpress) = buttonId + 21; + data.byte(kPresscount) = 40; + if (buttonId != 11) + playChannel1(10); + } +} + +void DreamGenContext::showOuterPad() { + showFrame(tempGraphics(), kKeypadx-3, kKeypady-4, 1, 0); + showFrame(tempGraphics(), kKeypadx+74, kKeypady+76, 37, 0); +} + +void DreamGenContext::dumpKeypad() { + multiDump(kKeypadx - 3, kKeypady - 4, 120, 90); +} + +void DreamGenContext::dumpSymbol() { + data.byte(kNewtextline) = 0; + multiDump(kSymbolx, kSymboly + 20, 104, 60); +} + +void DreamGenContext::dumpSymBox() { + if (data.word(kDumpx) != 0xFFFF) { + multiDump(data.word(kDumpx), data.word(kDumpy), 30, 77); + data.word(kDumpx) = 0xFFFF; + } +} + +void DreamGenContext::quitSymbol() { + if (data.byte(kSymboltopx) != 24 || data.byte(kSymbolbotx) != 24) { + blank(); + return; + }; + + if (data.byte(kCommandtype) != 222) { + data.byte(kCommandtype) = 222; + commandOnly(18); + } + + if (data.word(kMousebutton) == data.word(kOldbutton)) + return; // notqs + + if (!(data.word(kMousebutton) & 1)) + return; + + data.byte(kGetback) = 1; +} + +} // End of namespace DreamGen diff --git a/engines/dreamweb/module.mk b/engines/dreamweb/module.mk index 8cacbdc91e..398f0b8db0 100644 --- a/engines/dreamweb/module.mk +++ b/engines/dreamweb/module.mk @@ -6,12 +6,19 @@ MODULE_OBJS := \ detection.o \ dreamweb.o \ dreamgen.o \ + keypad.o \ + monitor.o \ + object.o \ pathfind.o \ + people.o \ print.o \ saveload.o \ + sound.o \ sprite.o \ stubs.o \ + talk.o \ use.o \ + vgafades.o \ vgagrafx.o # This module can be built as a plugin diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp new file mode 100644 index 0000000000..f01664632a --- /dev/null +++ b/engines/dreamweb/monitor.cpp @@ -0,0 +1,347 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "dreamweb/dreamweb.h" + +namespace DreamGen { + +struct MonitorKeyEntry { + uint8 b0; + uint8 b1; + char b2[24]; +}; + +void DreamGenContext::useMon() { + data.byte(kLasttrigger) = 0; + memset(data.ptr(kCurrentfile+1, 0), ' ', 12); + memset(data.ptr(offset_operand1+1, 0), ' ', 12); + + MonitorKeyEntry *monitorKeyEntries = (MonitorKeyEntry *)data.ptr(offset_keys, 0); + monitorKeyEntries[0].b0 = 1; + monitorKeyEntries[1].b0 = 0; + monitorKeyEntries[2].b0 = 0; + monitorKeyEntries[3].b0 = 0; + + createPanel(); + showPanel(); + showIcon(); + drawFloor(); + getRidOfAll(); + loadIntoTemp("DREAMWEB.G03"); // mon. graphic name + loadPersonal(); + loadNews(); + loadCart(); + loadTempCharset("DREAMWEB.C01"); // character set 2 + printOuterMon(); + initialMonCols(); + printLogo(); + workToScreenCPP(); + turnOnPower(); + fadeupYellows(); + fadeupMonFirst(); + data.word(kMonadx) = 76; + data.word(kMonady) = 141; + monMessage(1); + hangOnCurs(120); + monMessage(2); + randomAccess(60); + monMessage(3); + hangOnCurs(100); + printLogo(); + scrollMonitor(); + data.word(kBufferin) = 0; + data.word(kBufferout) = 0; + do { + di = data.word(kMonadx); + bx = data.word(kMonady); + push(di); + push(bx); + input(); + bx = pop(); + di = pop(); + data.word(kMonadx) = di; + data.word(kMonady) = bx; + execCommand(); + if (quitRequested()) //TODO : Check why it crashes when put before the execcommand + break; + } while (al == 0); + getRidOfTemp(); + getRidOfTempCharset(); + deallocateMem(data.word(kTextfile1)); + deallocateMem(data.word(kTextfile2)); + deallocateMem(data.word(kTextfile3)); + data.byte(kGetback) = 1; + playChannel1(26); + data.byte(kManisoffscreen) = 0; + restoreAll(); + redrawMainScrn(); + workToScreenM(); +} + +void DreamGenContext::monitorLogo() { + if (data.byte(kLogonum) != data.byte(kOldlogonum)) { + data.byte(kOldlogonum) = data.byte(kLogonum); + printLogo(); + printUnderMon(); + workToScreenCPP(); + printLogo(); + printLogo(); + playChannel1(26); + randomAccess(20); + } else { + printLogo(); + } +} + +void DreamBase::printLogo() { + showFrame(tempGraphics(), 56, 32, 0, 0); + showCurrentFile(); +} + +void DreamGenContext::input() { + char *inputLine = (char *)data.ptr(kInputline, 64); + memset(inputLine, 0, 64); + data.word(kCurpos) = 0; + printChar(engine->tempCharset(), data.word(kMonadx), data.word(kMonady), '>', 0, NULL, NULL); + multiDump(data.word(kMonadx), data.word(kMonady), 6, 8); + data.word(kMonadx) += 6; + data.word(kCurslocx) = data.word(kMonadx); + data.word(kCurslocy) = data.word(kMonady); + while (true) { + printCurs(); + vSync(); + delCurs(); + readKey(); + if (quitRequested()) + return; + uint8 currentKey = data.byte(kCurrentkey); + if (currentKey == 0) + continue; + if (currentKey == 13) + return; + if (currentKey == 8) { + if (data.word(kCurpos) > 0) + delChar(); + continue; + } + if (data.word(kCurpos) == 28) + continue; + if ((currentKey == 32) && (data.word(kCurpos) == 0)) + continue; + al = currentKey; + makeCaps(); + currentKey = al; + inputLine[data.word(kCurpos) * 2 + 0] = currentKey; + if (currentKey > 'Z') + continue; + multiGet(mapStore() + data.word(kCurpos) * 256, data.word(kMonadx), data.word(kMonady), 8, 8); + uint8 charWidth; + printChar(engine->tempCharset(), data.word(kMonadx), data.word(kMonady), currentKey, 0, &charWidth, NULL); + inputLine[data.word(kCurpos) * 2 + 1] = charWidth; + data.word(kMonadx) += charWidth; + ++data.word(kCurpos); + data.word(kCurslocx) += charWidth; + } +} + +void DreamGenContext::delChar() { + char *inputLine = (char *)data.ptr(kInputline, 0); + --data.word(kCurpos); + inputLine[data.word(kCurpos) * 2] = 0; + uint8 width = inputLine[data.word(kCurpos) * 2 + 1]; + data.word(kMonadx) -= width; + data.word(kCurslocx) -= width; + uint16 offset = data.word(kCurpos); + offset = ((offset & 0x00ff) << 8) | ((offset & 0xff00) >> 8); + multiPut(mapStore() + offset, data.word(kMonadx), data.word(kMonady), 8, 8); + multiDump(data.word(kMonadx), data.word(kMonady), al, 8); +} + +void DreamBase::printCurs() { + uint16 x = data.word(kCurslocx); + uint16 y = data.word(kCurslocy); + uint16 height; + if (data.byte(kForeignrelease)) { + y -= 3; + height = 11; + } else + height = 8; + multiGet(textUnder(), x, y, 6, height); + ++data.word(kMaintimer); + if ((data.word(kMaintimer) & 16) == 0) + showFrame(engine->tempCharset(), x, y, '/' - 32, 0); + multiDump(x - 6, y, 12, height); +} + +void DreamBase::delCurs() { + uint16 x = data.word(kCurslocx); + uint16 y = data.word(kCurslocy); + uint16 width = 6; + uint16 height; + if (data.byte(kForeignrelease)) { + y -= 3; + height = 11; + } else + height = 8; + multiPut(textUnder(), x, y, width, height); + multiDump(x, y, width, height); +} + +void DreamGenContext::hangOnCurs() { + hangOnCurs(cx); +} + +void DreamBase::scrollMonitor() { + printLogo(); + printUnderMon(); + workToScreenCPP(); + playChannel1(25); +} + +void DreamBase::showCurrentFile() { + uint16 x = 178; // TODO: Looks like this hardcoded constant in the asm doesn't match the frame + const char *currentFile = (const char *)data.ptr(kCurrentfile+1, 0); + while (*currentFile) { + char c = *currentFile++; + c = engine->modifyChar(c); + printChar(engine->tempCharset(), &x, 37, c, 0, NULL, NULL); + } +} + +void DreamBase::accessLightOn() { + showFrame(tempGraphics(), 74, 182, 8, 0); + multiDump(74, 182, 12, 8); +} + +void DreamBase::accessLightOff() { + showFrame(tempGraphics(), 74, 182, 7, 0); + multiDump(74, 182, 12, 8); +} + +void DreamGenContext::randomAccess() { + randomAccess(cx); +} + +void DreamGenContext::randomAccess(uint16 count) { + for (uint16 i = 0; i < count; ++i) { + vSync(); + vSync(); + uint16 v = engine->randomNumber() & 15; + if (v < 10) + accessLightOff(); + else + accessLightOn(); + } + accessLightOff(); +} + +void DreamGenContext::monMessage() { + monMessage(al); +} + +void DreamGenContext::monMessage(uint8 index) { + assert(index > 0); + const char *string = (const char *)getSegment(data.word(kTextfile1)).ptr(kTextstart, 0); + for (uint8 i = 0; i < index; ++i) { + while (*string++ != '+') { + } + } + monPrint(string); +} + +void DreamGenContext::netError() { + monMessage(5); + scrollMonitor(); +} + +void DreamBase::powerLightOn() { + showFrame(tempGraphics(), 257+4, 182, 6, 0); + multiDump(257+4, 182, 12, 8); +} + +void DreamBase::powerLightOff() { + showFrame(tempGraphics(), 257+4, 182, 5, 0); + multiDump(257+4, 182, 12, 8); +} + +void DreamBase::lockLightOn() { + showFrame(tempGraphics(), 56, 182, 10, 0); + multiDump(58, 182, 12, 8); +} + +void DreamBase::lockLightOff() { + showFrame(tempGraphics(), 56, 182, 9, 0); + multiDump(58, 182, 12, 8); +} + +void DreamBase::turnOnPower() { + for (size_t i = 0; i < 3; ++i) { + powerLightOn(); + hangOn(30); + powerLightOff(); + hangOn(30); + } + powerLightOn(); +} + +void DreamBase::printOuterMon() { + showFrame(tempGraphics(), 40, 32, 1, 0); + showFrame(tempGraphics(), 264, 32, 2, 0); + showFrame(tempGraphics(), 40, 12, 3, 0); + showFrame(tempGraphics(), 40, 164, 4, 0); +} + +void DreamGenContext::loadPersonal() { + if (data.byte(kLocation) == 0 || data.byte(kLocation) == 42) + data.word(kTextfile1) = standardLoad("DREAMWEB.T01"); // monitor file 1 + else + data.word(kTextfile1) = standardLoad("DREAMWEB.T02"); // monitor file 2 +} + +void DreamGenContext::loadNews() { + // textfile2 holds information accessible by anyone + if (data.byte(kNewsitem) == 0) + data.word(kTextfile2) = standardLoad("DREAMWEB.T10"); // monitor file 10 + else if (data.byte(kNewsitem) == 1) + data.word(kTextfile2) = standardLoad("DREAMWEB.T11"); // monitor file 11 + else if (data.byte(kNewsitem) == 2) + data.word(kTextfile2) = standardLoad("DREAMWEB.T12"); // monitor file 12 + else + data.word(kTextfile2) = standardLoad("DREAMWEB.T13"); // monitor file 13 +} + +void DreamGenContext::loadCart() { + lookInInterface(); + + if (al == 0) + data.word(kTextfile3) = standardLoad("DREAMWEB.T20"); // monitor file 20 + else if (al == 1) + data.word(kTextfile3) = standardLoad("DREAMWEB.T21"); // monitor file 21 + else if (al == 2) + data.word(kTextfile3) = standardLoad("DREAMWEB.T22"); // monitor file 22 + else if (al == 3) + data.word(kTextfile3) = standardLoad("DREAMWEB.T23"); // monitor file 23 + else + data.word(kTextfile3) = standardLoad("DREAMWEB.T24"); // monitor file 24 +} + +} // End of namespace DreamGen diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp new file mode 100644 index 0000000000..53d834e74c --- /dev/null +++ b/engines/dreamweb/object.cpp @@ -0,0 +1,266 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "dreamweb/dreamweb.h" + +namespace DreamGen { + +void DreamGenContext::fillRyan() { + uint8 *inv = getSegment(data.word(kBuffers)).ptr(kRyaninvlist, 60); + findAllRyan(inv); + inv += data.byte(kRyanpage) * 2 * 10; + for (size_t i = 0; i < 2; ++i) { + for (size_t j = 0; j < 5; ++j) { + uint8 objIndex = *inv++; + uint8 objType = *inv++; + obToInv(objIndex, objType, kInventx + j * kItempicsize, kInventy + i * kItempicsize); + } + } + showRyanPage(); +} + +void DreamGenContext::isItWorn() { + flags._z = isItWorn((const DynObject *)es.ptr(bx, sizeof(DynObject))); +} + +bool DreamGenContext::isItWorn(const DynObject *object) { + return (object->id[0] == 'W'-'A') && (object->id[1] == 'E'-'A'); +} + +void DreamGenContext::wornError() { + data.byte(kCommandtype) = 255; + delPointer(); + printMessage(76, 21, 57, 240, false); + workToScreenM(); + hangOnP(50); + showPanel(); + showMan(); + examIcon(); + data.byte(kCommandtype) = 255; + workToScreenM(); +} + +void DreamGenContext::makeWorn() { + makeWorn((DynObject *)es.ptr(bx, sizeof(DynObject))); +} + +void DreamGenContext::makeWorn(DynObject *object) { + object->id[0] = 'W'-'A'; + object->id[1] = 'E'-'A'; +} + +void DreamGenContext::obToInv() { + obToInv(al, ah, di, bx); +} + +void DreamGenContext::obToInv(uint8 index, uint8 flag, uint16 x, uint16 y) { + showFrame(engine->icons1(), x - 2, y - 1, 10, 0); + if (index == 0xff) + return; + + Frame *extras = (Frame *)getSegment(data.word(kExtras)).ptr(0, 0); + Frame *frees = (Frame *)getSegment(data.word(kFreeframes)).ptr(0, 0); + Frame *frames = (flag == 4) ? extras : frees; + showFrame(frames, x + 18, y + 19, 3 * index + 1, 128); + const DynObject *object = (const DynObject *)getAnyAdDir(index, flag); + bool worn = isItWorn(object); + if (worn) + showFrame(engine->icons1(), x - 3, y - 2, 7, 0); +} + +void DreamGenContext::obPicture() { + if (data.byte(kObjecttype) == 1) + return; + Frame *frames; + if (data.byte(kObjecttype) == 4) + frames = (Frame *)getSegment(data.word(kExtras)).ptr(0, 0); + else + frames = (Frame *)getSegment(data.word(kFreeframes)).ptr(0, 0); + uint8 frame = 3 * data.byte(kCommand) + 1; + showFrame(frames, 160, 68, frame, 0x80); +} + +void DreamBase::obIcons() { + uint8 value1, value2; + getAnyAd(&value1, &value2); + if (value1 != 0xff) { + // can open it + showFrame(engine->icons2(), 210, 1, 4, 0); + } + + showFrame(engine->icons2(), 260, 1, 1, 0); +} + +void DreamGenContext::examineOb(bool examineAgain) { + data.byte(kPointermode) = 0; + data.word(kTimecount) = 0; + while (true) { + if (examineAgain) { + data.byte(kInmaparea) = 0; + data.byte(kExamagain) = 0; + data.byte(kOpenedob) = 255; + data.byte(kOpenedtype) = 255; + data.byte(kInvopen) = 0; + al = data.byte(kCommandtype); + data.byte(kObjecttype) = al; + data.byte(kItemframe) = 0; + data.byte(kPointerframe) = 0; + createPanel(); + showPanel(); + showMan(); + showExit(); + obIcons(); + obPicture(); + describeOb(); + underTextLine(); + data.byte(kCommandtype) = 255; + readMouse(); + showPointer(); + workToScreenCPP(); + delPointer(); + examineAgain = false; + } + + readMouse(); + showPointer(); + vSync(); + dumpPointer(); + dumpTextLine(); + delPointer(); + data.byte(kGetback) = 0; + switch (data.byte(kInvopen)) { + case 0: { + RectWithCallback examList[] = { + { 273,320,157,198,&DreamGenContext::getBackFromOb }, + { 260,300,0,44,&DreamGenContext::useObject }, + { 210,254,0,44,&DreamGenContext::selectOpenOb }, + { 144,176,64,96,&DreamGenContext::setPickup }, + { 0,50,50,200,&DreamGenContext::examineInventory }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + checkCoords(examList); + break; + } + case 1: { + // NB: This table contains the non-constant openChangeSize! + RectWithCallback invList1[] = { + { 273,320,157,198,&DreamGenContext::getBackFromOb }, + { 255,294,0,24,&DreamGenContext::dropObject }, + { kInventx+167,kInventx+167+(18*3),kInventy-18,kInventy-2,&DreamGenContext::incRyanPage }, + { kInventx, data.word(offset_openchangesize),kInventy+100,kInventy+100+kItempicsize,&DreamGenContext::useOpened }, + { kInventx,kInventx+(5*kItempicsize), kInventy,kInventy+(2*kItempicsize),&DreamGenContext::inToInv }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + checkCoords(invList1); + break; + } + default: { + RectWithCallback withList1[] = { + { 273,320,157,198,&DreamGenContext::getBackFromOb }, + { kInventx+167,kInventx+167+(18*3),kInventy-18,kInventy-2,&DreamGenContext::incRyanPage }, + { kInventx,kInventx+(5*kItempicsize), kInventy,kInventy+(2*kItempicsize),&DreamGenContext::selectOb }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + checkCoords(withList1); + break; + } + } + if (data.byte(kQuitrequested) != 0) + break; + if (data.byte(kExamagain) != 0) + examineAgain = true; + else if (data.byte(kGetback) != 0) + break; + } + + data.byte(kPickup) = 0; + if (data.word(kWatchingtime) != 0 || data.byte(kNewlocation) == 255) { + // isWatching + makeMainScreen(); + } + + data.byte(kInvopen) = 0; + data.byte(kOpenedob) = 255; +} + +void DreamGenContext::inventory() { + if (data.byte(kMandead) == 1 || data.word(kWatchingtime) != 0) { + blank(); + return; + } + + if (data.byte(kCommandtype) != 239) { + data.byte(kCommandtype) = 239; + al = 32; + commandOnly(); + } + + if (data.word(kMousebutton) == data.word(kOldbutton)) + return; + if (!(data.word(kMousebutton) & 1)) // only on left mouse button + return; + + + data.word(kTimecount) = 0; + data.byte(kPointermode) = 0; + data.byte(kInmaparea) = 0; + animPointer(); + createPanel(); + showPanel(); + examIcon(); + showMan(); + showExit(); + underTextLine(); + data.byte(kPickup) = 0; + data.byte(kInvopen) = 2; + openInv(); + readMouse(); + showPointer(); + workToScreenCPP(); + delPointer(); + data.byte(kOpenedob) = 255; + examineOb(false); +} + +void DreamGenContext::transferText() { + getSegment(data.word(kExtras)).word(kExtextdat + data.byte(kExpos) * 2) = data.word(kExtextpos); + uint16 freeTextOffset = data.byte(kItemtotran) * 2; + uint16 srcOffset = getSegment(data.word(kFreedesc)).word(kFreetextdat + freeTextOffset); + const char *src = (const char *)getSegment(data.word(kFreedesc)).ptr(kFreetext + srcOffset, 0); + char *dst = (char *)getSegment(data.word(kExtras)).ptr(kExtext + data.word(kExtextpos), 0); + + size_t len = strlen(src); + memcpy(dst, src, len + 1); + data.word(kExtextpos) += len + 1; +} + +void DreamGenContext::getBackFromOb() { + if (data.byte(kPickup) != 1) + getBack1(); + else + blank(); +} + +} // End of namespace DreamGen diff --git a/engines/dreamweb/pathfind.cpp b/engines/dreamweb/pathfind.cpp index d367f02d15..f6591d4666 100644 --- a/engines/dreamweb/pathfind.cpp +++ b/engines/dreamweb/pathfind.cpp @@ -24,62 +24,94 @@ namespace DreamGen { -void DreamGenContext::turnpathon() { - turnpathon(al); +void DreamGenContext::turnPathOn() { + turnPathOn(al); } -void DreamGenContext::turnpathon(uint8 param) { - findormake(param, 0xff, data.byte(kRoomnum) + 100); - PathNode *roomsPaths = getroomspaths()->nodes; +void DreamGenContext::turnPathOn(uint8 param) { + findOrMake(param, 0xff, data.byte(kRoomnum) + 100); + PathNode *roomsPaths = getRoomsPaths()->nodes; if (param == 0xff) return; roomsPaths[param].on = 0xff; } -void DreamGenContext::turnpathoff() { - turnpathoff(al); +void DreamGenContext::turnPathOff() { + turnPathOff(al); } -void DreamGenContext::turnpathoff(uint8 param) { - findormake(param, 0x00, data.byte(kRoomnum) + 100); - PathNode *roomsPaths = getroomspaths()->nodes; +void DreamGenContext::turnPathOff(uint8 param) { + findOrMake(param, 0x00, data.byte(kRoomnum) + 100); + PathNode *roomsPaths = getRoomsPaths()->nodes; if (param == 0xff) return; roomsPaths[param].on = 0x00; } -void DreamGenContext::turnanypathon(uint8 param, uint8 room) { - findormake(param, 0xff, room + 100); - PathNode *paths = (PathNode *)segRef(data.word(kReels)).ptr(kPathdata + 144 * room, 0); +void DreamGenContext::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::turnAnyPathOn() { + turnAnyPathOn(al, ah); } -void DreamGenContext::turnanypathoff(uint8 param, uint8 room) { - findormake(param, 0x00, room + 100); - PathNode *paths = (PathNode *)segRef(data.word(kReels)).ptr(kPathdata + 144 * room, 0); +void DreamGenContext::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); +void DreamGenContext::turnAnyPathOff() { + turnAnyPathOff(al, ah); } -RoomPaths *DreamGenContext::getroomspaths() { - void *result = segRef(data.word(kReels)).ptr(data.byte(kRoomnum) * 144, 144); +RoomPaths *DreamBase::getRoomsPaths() { + void *result = getSegment(data.word(kReels)).ptr(data.byte(kRoomnum) * 144, 144); return (RoomPaths *)result; } -void DreamGenContext::autosetwalk() { - al = data.byte(kManspath); - if (data.byte(kFinaldest) == al) +void DreamBase::faceRightWay() { + PathNode *paths = getRoomsPaths()->nodes; + uint8 dir = paths[data.byte(kManspath)].dir; + data.byte(kTurntoface) = dir; + data.byte(kLeavedirection) = dir; +} + +void DreamBase::setWalk() { + if (data.byte(kLinepointer) != 254) { + // Already walking + data.byte(kFinaldest) = data.byte(kPointerspath); + } else if (data.byte(kPointerspath) == data.byte(kManspath)) { + // Can't walk + faceRightWay(); + } else if (data.byte(kWatchmode) == 1) { + // Holding reel + data.byte(kDestafterhold) = data.byte(kPointerspath); + data.byte(kWatchmode) = 2; + } else if (data.byte(kWatchmode) == 2) { + // Can't walk + } else { + data.byte(kDestination) = data.byte(kPointerspath); + data.byte(kFinaldest) = data.byte(kPointerspath); + if (data.word(kMousebutton) != 2 || data.word(kCommandtype) == 3) { + autoSetWalk(); + } else { + data.byte(kWalkandexam) = 1; + data.byte(kWalkexamtype) = data.byte(kCommandtype); + data.byte(kWalkexamnum) = data.byte(kCommand); + autoSetWalk(); + } + } +} + +void DreamBase::autoSetWalk() { + if (data.byte(kFinaldest) == data.byte(kManspath)) return; - const RoomPaths *roomsPaths = getroomspaths(); - checkdest(roomsPaths); + const RoomPaths *roomsPaths = getRoomsPaths(); + checkDest(roomsPaths); data.word(kLinestartx) = roomsPaths->nodes[data.byte(kManspath)].x - 12; data.word(kLinestarty) = roomsPaths->nodes[data.byte(kManspath)].y - 12; data.word(kLineendx) = roomsPaths->nodes[data.byte(kDestination)].x - 12; @@ -93,46 +125,44 @@ void DreamGenContext::autosetwalk() { data.byte(kLinepointer) = 0; } -void DreamGenContext::checkdest(const RoomPaths *roomsPaths) { +void DreamBase::checkDest(const RoomPaths *roomsPaths) { const PathSegment *segments = roomsPaths->segments; - ah = data.byte(kManspath) << 4; - al = data.byte(kDestination); + const uint8 tmp = data.byte(kManspath) << 4; uint8 destination = data.byte(kDestination); for (size_t i = 0; i < 24; ++i) { - dh = segments[i].b0 & 0xf0; - dl = segments[i].b0 & 0x0f; - if (ax == dx) { + if ((segments[i].b0 & 0xf0) == tmp && + (segments[i].b0 & 0x0f) == data.byte(kDestination)) { data.byte(kDestination) = segments[i].b1 & 0x0f; return; } - dl = (segments[i].b0 & 0xf0) >> 4; - dh = (segments[i].b0 & 0x0f) << 4; - if (ax == dx) { + + if (((segments[i].b0 & 0x0f) << 4) == tmp && + ((segments[i].b0 & 0xf0) >> 4) == data.byte(kDestination)) { destination = segments[i].b1 & 0x0f; } } data.byte(kDestination) = destination; } -void DreamGenContext::findxyfrompath() { - const PathNode *roomsPaths = getroomspaths()->nodes; +void DreamBase::findXYFromPath() { + const PathNode *roomsPaths = getRoomsPaths()->nodes; data.byte(kRyanx) = roomsPaths[data.byte(kManspath)].x - 12; data.byte(kRyany) = roomsPaths[data.byte(kManspath)].y - 12; } -void DreamGenContext::checkifpathison() { - flags._z = checkifpathison(al); +void DreamGenContext::checkIfPathIsOn() { + flags._z = checkIfPathIsOn(al); } -bool DreamGenContext::checkifpathison(uint8 index) { - RoomPaths *roomsPaths = getroomspaths(); +bool DreamGenContext::checkIfPathIsOn(uint8 index) { + RoomPaths *roomsPaths = getRoomsPaths(); uint8 pathOn = roomsPaths->nodes[index].on; return pathOn == 0xff; } -void DreamGenContext::bresenhams() { - workoutframes(); - int8 *lineData = (int8 *)data.ptr(kLinedata, 0); +void DreamBase::bresenhams() { + workoutFrames(); + Common::Point *lineData = &_lineData[0]; int16 startX = (int16)data.word(kLinestartx); int16 startY = (int16)data.word(kLinestarty); int16 endX = (int16)data.word(kLineendx); @@ -153,13 +183,12 @@ void DreamGenContext::bresenhams() { ++deltaY; int8 x = (int8)startX; data.byte(kLinelength) = deltaY; - do { - lineData[0] = x; - lineData[1] = y; - lineData += 2; + for (; deltaY; --deltaY) { + lineData->x = x; + lineData->y = y; + ++lineData; ++y; - --deltaY; - } while (deltaY); + } return; } uint16 deltaX; @@ -183,13 +212,12 @@ void DreamGenContext::bresenhams() { int8 y = (int8)startY; ++deltaX; data.byte(kLinelength) = deltaX; - do { - lineData[0] = x; - lineData[1] = y; - lineData += 2; + for (; deltaX; --deltaX) { + lineData->x = x; + lineData->y = y; + ++lineData; ++x; - --deltaX; - } while (deltaX); + } return; } uint16 deltaY; @@ -220,10 +248,10 @@ void DreamGenContext::bresenhams() { int8 y = (int8)startY; data.byte(kLinelength) = delta1; if (data.byte(kLineroutine) != 1) { - do { - lineData[0] = x; - lineData[1] = y; - lineData += 2; + for (; delta1; --delta1) { + lineData->x = x; + lineData->y = y; + ++lineData; ++x; if (remainder < 0) { remainder += data.word(kIncrement1); @@ -231,13 +259,12 @@ void DreamGenContext::bresenhams() { remainder += data.word(kIncrement2); y += increment; } - --delta1; - } while (delta1); + } } else { - do { - lineData[0] = x; - lineData[1] = y; - lineData += 2; + for (; delta1; --delta1) { + lineData->x = x; + lineData->y = y; + ++lineData; y += increment; if (remainder < 0) { remainder += data.word(kIncrement1); @@ -245,10 +272,59 @@ void DreamGenContext::bresenhams() { remainder += data.word(kIncrement2); ++x; } - --delta1; - } while (delta1); + } } } -} /*namespace dreamgen */ +void DreamBase::workoutFrames() { + byte tmp; + int diffx, diffy; + + // We have to use signed arithmetic here because these values can + // be slightly negative when walking off-screen + int lineStartX = (int16)data.word(kLinestartx); + int lineStartY = (int16)data.word(kLinestarty); + int lineEndX = (int16)data.word(kLineendx); + int lineEndY = (int16)data.word(kLineendy); + + + diffx = ABS(lineStartX - lineEndX); + diffy = ABS(lineStartY - lineEndY); + + if (diffx < diffy) { + tmp = 2; + if (diffx >= (diffy >> 1)) + tmp = 1; + } else { + // tendstohoriz + tmp = 0; + if (diffy >= (diffx >> 1)) + tmp = 1; + } + + if (lineStartX >= lineEndX) { + // isinleft + if (lineStartY < lineEndY) { + if (tmp != 1) + tmp ^= 2; + tmp += 4; + } else { + // topleft + tmp += 6; + } + } else { + // isinright + if (lineStartY < lineEndY) { + tmp += 2; + } else { + // botright + if (tmp != 1) + tmp ^= 2; + } + } + + data.byte(kTurntoface) = tmp & 7; + data.byte(kTurndirection) = 0; +} +} // End of namespace DreamGen diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp new file mode 100644 index 0000000000..889a430a22 --- /dev/null +++ b/engines/dreamweb/people.cpp @@ -0,0 +1,789 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "dreamweb/dreamweb.h" + +namespace DreamGen { + +static void (DreamGenContext::*reelCallbacks[57])() = { + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + &DreamGenContext::receptionist, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + &DreamGenContext::heavy, NULL, + NULL, NULL, + &DreamGenContext::bartender, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, &DreamGenContext::poolGuard, + NULL, &DreamGenContext::businessMan, + NULL, NULL, + &DreamGenContext::mugger, &DreamGenContext::helicopter, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, &DreamGenContext::endGameSeq, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL +}; + +static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = { + &DreamGenContext::gamer, &DreamGenContext::sparkyDrip, + &DreamGenContext::eden, &DreamGenContext::edenInBath, + &DreamGenContext::sparky, &DreamGenContext::smokeBloke, + &DreamGenContext::manAsleep, &DreamGenContext::drunk, + /*&DreamGenContext::receptionist*/NULL, &DreamGenContext::genericPerson /*maleFan*/, + &DreamGenContext::genericPerson /*femaleFan*/, &DreamGenContext::louis, + &DreamGenContext::louisChair, &DreamGenContext::soldier1, + &DreamGenContext::bossMan, &DreamGenContext::interviewer, + /*&DreamGenContext::heavy*/NULL, &DreamGenContext::manAsleep /*manAsleep2*/, + &DreamGenContext::genericPerson /*manSatStill*/, &DreamGenContext::drinker, + /*&DreamGenContext::bartender*/NULL, &DreamGenContext::genericPerson /*otherSmoker*/, + &DreamGenContext::genericPerson /*tattooMan*/, &DreamGenContext::attendant, + &DreamGenContext::keeper, &DreamGenContext::candles1, + &DreamGenContext::smallCandle, &DreamGenContext::security, + &DreamGenContext::copper, /*&DreamGenContext::poolGuard*/NULL, + &DreamGenContext::rockstar, /*&DreamGenContext::businessMan*/NULL, + &DreamGenContext::train, &DreamGenContext::genericPerson /*aide*/, + /*&DreamGenContext::mugger*/NULL, /*&DreamGenContext::helicopter*/NULL, + &DreamGenContext::introMagic1, &DreamGenContext::introMusic, + &DreamGenContext::introMagic2, &DreamGenContext::candles2, + &DreamGenContext::gates, &DreamGenContext::introMagic3, + &DreamGenContext::introMonks1, &DreamGenContext::candles, + &DreamGenContext::introMonks2, &DreamGenContext::handClap, + &DreamGenContext::monkAndRyan, /*&DreamGenContext::endGameSeq*/NULL, + &DreamGenContext::priest, &DreamGenContext::madman, + &DreamGenContext::madmansTelly, &DreamGenContext::alleyBarkSound, + &DreamGenContext::foghornSound, &DreamGenContext::carParkDrip, + &DreamGenContext::carParkDrip, &DreamGenContext::carParkDrip, + &DreamGenContext::carParkDrip +}; + +void DreamGenContext::updatePeople() { + data.word(kListpos) = kPeoplelist; + memset(getSegment(data.word(kBuffers)).ptr(kPeoplelist, 12 * sizeof(People)), 0xff, 12 * sizeof(People)); + ++data.word(kMaintimer); + + // The original callbacks are called with es:bx pointing to their reelRoutine entry. + // The new callbacks take a mutable ReelRoutine parameter. + + es = data; + ReelRoutine *r = (ReelRoutine *)data.ptr(kReelroutines, 0); + + for (int i = 0; r[i].reallocation != 255; ++i) { + bx = kReelroutines + 8*i; + if (r[i].reallocation == data.byte(kReallocation) && + r[i].mapX == data.byte(kMapx) && + r[i].mapY == data.byte(kMapy)) { + if (reelCallbacks[i]) { + assert(!reelCallbacksCPP[i]); + (this->*(reelCallbacks[i]))(); + } else { + assert(reelCallbacksCPP[i]); + (this->*(reelCallbacksCPP[i]))(r[i]); + } + } + } +} + +void DreamGenContext::madmanText() { + if (isCD()) { + if (data.byte(kSpeechcount) >= 63) + return; + if (data.byte(kCh1playing) != 255) + return; + al = data.byte(kSpeechcount); + ++data.byte(kSpeechcount); + } else { + if (data.byte(kCombatcount) >= 61) + return; + al = data.byte(kCombatcount); + _and(al, 3); + if (!flags.z()) + return; + al = data.byte(kCombatcount) / 4; + } + setupTimedTemp(47 + al, 82, 72, 80, 90, 1); +} + +void DreamGenContext::madman(ReelRoutine &routine) { + data.word(kWatchingtime) = 2; + if (checkSpeed(routine)) { + uint16 newReelPointer = routine.reelPointer(); + if (newReelPointer >= 364) { + data.byte(kMandead) = 2; + showGameReel(&routine); + return; + } + if (newReelPointer == 10) { + loadTempText("DREAMWEB.T82"); + data.byte(kCombatcount) = (uint8)-1; + data.byte(kSpeechcount) = 0; + } + ++newReelPointer; + if (newReelPointer == 294) { + if (data.byte(kWongame) != 1) { + data.byte(kWongame) = 1; + getRidOfTempText(); + } + return; + } + if (newReelPointer == 66) { + ++data.byte(kCombatcount); + madmanText(); + newReelPointer = 53; + if (data.byte(kCombatcount) >= (isCD() ? 64 : 62)) { + if (data.byte(kCombatcount) == (isCD() ? 70 : 68)) + newReelPointer = 310; + else { + if (data.byte(kLastweapon) == 8) { + data.byte(kCombatcount) = isCD() ? 72 : 70; + data.byte(kLastweapon) = (uint8)-1; + data.byte(kMadmanflag) = 1; + newReelPointer = 67; + } + } + } + } + routine.setReelPointer(newReelPointer); + } + showGameReel(&routine); + routine.mapX = data.byte(kMapx); + madMode(); +} + +void DreamGenContext::madMode() { + data.word(kWatchingtime) = 2; + data.byte(kPointermode) = 0; + if (data.byte(kCombatcount) < (isCD() ? 65 : 63)) + return; + if (data.byte(kCombatcount) >= (isCD() ? 70 : 68)) + return; + data.byte(kPointermode) = 2; +} + +void DreamGenContext::addToPeopleList() { + addToPeopleList((ReelRoutine *)es.ptr(bx, sizeof(ReelRoutine))); +} + +void DreamGenContext::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)); + people->setReelPointer(routine->reelPointer()); + people->setRoutinePointer(routinePointer); + people->b4 = routine->b7; + 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) { + if (data.byte(kLastweapon) != (uint8)-1) + return true; + ++routine.counter; + if (routine.counter != routine.period) + return false; + routine.counter = 0; + return true; +} + +void DreamGenContext::sparkyDrip(ReelRoutine &routine) { + if (checkSpeed(routine)) + playChannel0(14, 0); +} + +void DreamGenContext::genericPerson(ReelRoutine &routine) { + showGameReel(&routine); + addToPeopleList(&routine); +} + +void DreamGenContext::gamer(ReelRoutine &routine) { + if (checkSpeed(routine)) { + uint8 v; + do { + v = 20 + engine->randomNumber() % 5; + } while (v == routine.reelPointer()); + routine.setReelPointer(v); + } + + showGameReel(&routine); + addToPeopleList(&routine); +} + +void DreamGenContext::eden(ReelRoutine &routine) { + if (data.byte(kGeneraldead)) + return; + showGameReel(&routine); + addToPeopleList(&routine); +} + +void DreamGenContext::sparky(ReelRoutine &routine) { + if (data.word(kCard1money)) + routine.b7 = 3; + if (checkSpeed(routine)) { + if (routine.reelPointer() != 34) { + if (engine->randomNumber() < 30) + routine.incReelPointer(); + else + routine.setReelPointer(27); + } else { + if (routine.reelPointer() != 48) + routine.incReelPointer(); + else + routine.setReelPointer(27); + } + } + showGameReel(&routine); + addToPeopleList(&routine); + if (routine.b7 & 128) + data.byte(kTalkedtosparky) = 1; +} + +void DreamGenContext::rockstar(ReelRoutine &routine) { + if ((routine.reelPointer() == 303) || (routine.reelPointer() == 118)) { + data.byte(kNewlocation) = 45; + showGameReel(&routine); + return; + } + if (checkSpeed(routine)) { + uint16 nextReelPointer = routine.reelPointer() + 1; + if (nextReelPointer == 118) { + data.byte(kMandead) = 2; + } else if (nextReelPointer == 79) { + --nextReelPointer; + if (data.byte(kLastweapon) != 1) { + ++data.byte(kCombatcount); + if (data.byte(kCombatcount) == 40) { + data.byte(kCombatcount) = 0; + nextReelPointer = 79; + } + } else { + data.byte(kLastweapon) = (uint8)-1; + nextReelPointer = 123; + } + } + routine.setReelPointer(nextReelPointer); + } + showGameReel(&routine); + if (routine.reelPointer() == 78) { + addToPeopleList(&routine); + data.byte(kPointermode) = 2; + data.word(kWatchingtime) = 0; + } else { + data.word(kWatchingtime) = 2; + data.byte(kPointermode) = 0; + routine.mapY = data.byte(kMapy); + } +} + +void DreamGenContext::madmansTelly(ReelRoutine &routine) { + uint16 nextReelPointer = routine.reelPointer() + 1; + if (nextReelPointer == 307) + nextReelPointer = 300; + routine.setReelPointer(nextReelPointer); + showGameReel(&routine); +} + + +void DreamGenContext::smokeBloke(ReelRoutine &routine) { + if (data.byte(kRockstardead) == 0) { + if (routine.b7 & 128) + setLocation(5); + } + if (checkSpeed(routine)) { + if (routine.reelPointer() == 100) { + if (engine->randomNumber() < 30) + routine.incReelPointer(); + else + routine.setReelPointer(96); + } else if (routine.reelPointer() == 117) + routine.setReelPointer(96); + else + routine.incReelPointer(); + } + showGameReel(&routine); + addToPeopleList(&routine); +} + +void DreamGenContext::manAsleep(ReelRoutine &routine) { + routine.b7 &= 127; + showGameReel(&routine); + addToPeopleList(&routine); +} + +void DreamGenContext::attendant(ReelRoutine &routine) { + showGameReel(&routine); + addToPeopleList(&routine); + if (routine.b7 & 128) + data.byte(kTalkedtoattendant) = 1; +} + +void DreamGenContext::keeper(ReelRoutine &routine) { + if (data.byte(kKeeperflag) != 0) { + // Not waiting + addToPeopleList(&routine); + showGameReel(&routine); + return; + } + + if (data.word(kReeltowatch) < 190) + return; // waiting + + data.byte(kKeeperflag)++; + + if ((routine.b7 & 127) != data.byte(kDreamnumber)) + routine.b7 = data.byte(kDreamnumber); +} + +void DreamGenContext::drunk(ReelRoutine &routine) { + if (data.byte(kGeneraldead)) + return; + routine.b7 &= 127; + showGameReel(&routine); + addToPeopleList(&routine); +} + +void DreamGenContext::interviewer(ReelRoutine &routine) { + if (data.word(kReeltowatch) == 68) + routine.incReelPointer(); + + if (routine.reelPointer() != 250 && routine.reelPointer() != 259 && checkSpeed(routine)) + routine.incReelPointer(); + + showGameReel(&routine); +} + +void DreamGenContext::drinker(ReelRoutine &routine) { + if (checkSpeed(routine)) { + routine.incReelPointer(); + + if ( routine.reelPointer() == 115 || + (routine.reelPointer() == 106 && engine->randomNumber() >= 3)) + routine.setReelPointer(105); + } + + showGameReel(&routine); + addToPeopleList(&routine); +} + +void DreamGenContext::alleyBarkSound(ReelRoutine &routine) { + uint16 prevReelPointer = routine.reelPointer() - 1; + if (prevReelPointer == 0) { + playChannel1(14); + routine.setReelPointer(1000); + } else { + routine.setReelPointer(prevReelPointer); + } +} + +void DreamGenContext::introMagic1(ReelRoutine &routine) { + if (checkSpeed(routine)) { + uint16 nextReelPointer = routine.reelPointer() + 1; + if (nextReelPointer == 145) + nextReelPointer = 121; + 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; + } + } + } + showGameReel(&routine); +} + +void DreamGenContext::introMagic2(ReelRoutine &routine) { + if (checkSpeed(routine)) { + uint16 nextReelPointer = routine.reelPointer() + 1; + if (nextReelPointer == 216) + nextReelPointer = 192; + routine.setReelPointer(nextReelPointer); + } + showGameReel(&routine); +} + +void DreamGenContext::introMagic3(ReelRoutine &routine) { + if (checkSpeed(routine)) { + uint16 nextReelPointer = routine.reelPointer() + 1; + if (nextReelPointer == 218) + data.byte(kGetback) = 1; + routine.setReelPointer(nextReelPointer); + } + showGameReel(&routine); + routine.mapX = data.byte(kMapx); +} + +void DreamGenContext::candles1(ReelRoutine &routine) { + if (checkSpeed(routine)) { + uint16 nextReelPointer = routine.reelPointer() + 1; + if (nextReelPointer == 44) + nextReelPointer = 39; + routine.setReelPointer(nextReelPointer); + } + showGameReel(&routine); +} + +void DreamGenContext::candles2(ReelRoutine &routine) { + if (checkSpeed(routine)) { + uint16 nextReelPointer = routine.reelPointer() + 1; + if (nextReelPointer == 238) + nextReelPointer = 233; + routine.setReelPointer(nextReelPointer); + } + showGameReel(&routine); +} + +void DreamGenContext::smallCandle(ReelRoutine &routine) { + if (checkSpeed(routine)) { + uint16 nextReelPointer = routine.reelPointer() + 1; + if (nextReelPointer == 37) + nextReelPointer = 25; + routine.setReelPointer(nextReelPointer); + } + showGameReel(&routine); +} + +void DreamGenContext::introMusic(ReelRoutine &routine) { +} + +void DreamGenContext::candles(ReelRoutine &routine) { + if (checkSpeed(routine)) { + uint16 nextReelPointer = routine.reelPointer() + 1; + if (nextReelPointer == 167) + nextReelPointer = 162; + routine.setReelPointer(nextReelPointer); + } + showGameReel(&routine); +} + +void DreamGenContext::gates(ReelRoutine &routine) { + if (checkSpeed(routine)) { + uint16 nextReelPointer = routine.reelPointer() + 1; + if (nextReelPointer == 116) + playChannel1(17); + if (nextReelPointer >= 110) + routine.period = 2; + if (nextReelPointer == 120) { + data.byte(kGetback) = 1; + nextReelPointer = 119; + } + routine.setReelPointer(nextReelPointer); + push(es); + push(bx); + ax = nextReelPointer; + intro3Text(); + bx = pop(); + es = pop(); + } + showGameReel(&routine); +} + +void DreamGenContext::security(ReelRoutine &routine) { + if (routine.reelPointer() == 32) { + if (data.byte(kLastweapon) == 1) { + data.word(kWatchingtime) = 10; + if ((data.byte(kManspath) == 9) && (data.byte(kFacing) == 0)) { + data.byte(kLastweapon) = (uint8)-1; + routine.incReelPointer(); + } + } + } else if (routine.reelPointer() == 69) + return; + else { + data.word(kWatchingtime) = 10; + if (checkSpeed(routine)) + routine.incReelPointer(); + } + showGameReel(&routine); + addToPeopleList(&routine); +} + +void DreamGenContext::edenInBath(ReelRoutine &routine) { + if (data.byte(kGeneraldead) == 0 || data.byte(kSartaindead) != 0) + return; + + showGameReel(&routine); + addToPeopleList(&routine); +} + +void DreamGenContext::louis(ReelRoutine &routine) { + if (data.byte(kRockstardead) != 0) + return; + + showGameReel(&routine); + addToPeopleList(&routine); +} + +void DreamGenContext::handClap(ReelRoutine &routine) { +} + +void DreamGenContext::carParkDrip(ReelRoutine &routine) { + if (!checkSpeed(routine)) + return; // cantdrip2 + + playChannel1(14); +} + +void DreamGenContext::foghornSound(ReelRoutine &routine) { + if (engine->randomNumber() == 198) + playChannel1(13); +} + +void DreamGenContext::train(ReelRoutine &routine) { + // The original code has logic for this, but it is disabled +} + +void DreamGenContext::louisChair(ReelRoutine &routine) { + if (data.byte(kRockstardead) == 0) + return; // notlouis2 + + if (checkSpeed(routine)) { + uint16 nextReelPointer = routine.reelPointer() + 1; + if (nextReelPointer == 191) { + routine.setReelPointer(182); // Restart Louis + } else if (nextReelPointer != 185) { + routine.setReelPointer(nextReelPointer); + } else { + if (engine->randomNumber() < 245) + routine.setReelPointer(182); // Restart Louis + else + routine.setReelPointer(nextReelPointer); + } + } + + showGameReel(&routine); + addToPeopleList(&routine); +} + +void DreamGenContext::bossMan(ReelRoutine &routine) { + if (checkSpeed(routine)) { + uint16 nextReelPointer = routine.reelPointer() + 1; + + if (nextReelPointer == 4) { + if (data.byte(kGunpassflag) != 1 && engine->randomNumber() >= 10) + nextReelPointer = 0; + } else if (nextReelPointer == 20) { + if (data.byte(kGunpassflag) != 1) + nextReelPointer = 0; + } else if (nextReelPointer == 41) { + nextReelPointer = 0; + data.byte(kGunpassflag)++; + routine.b7 = 10; + } + + routine.setReelPointer(nextReelPointer); + } + + showGameReel(&routine); + addToPeopleList(&routine); + + if (routine.b7 & 128) + data.byte(kTalkedtoboss) = 1; +} + +void DreamGenContext::priest(ReelRoutine &routine) { + if (routine.reelPointer() == 8) + return; // priestspoken + + data.byte(kPointermode) = 0; + data.word(kWatchingtime) = 2; + + if (checkSpeed(routine)) { + routine.incReelPointer(); + push(es); + push(bx); + priestText(routine); + bx = pop(); + es = pop(); + } +} + +void DreamGenContext::priestText(ReelRoutine &routine) { + uint16 reel = routine.reelPointer(); + if (reel < 2 || reel >= 7 || (reel & 1)) + return; // nopriesttext + + al = ((reel & 0xFF) >> 1) + 50; + bl = 72; + bh = 80; + cx = 54; + dx = 1; + setupTimedUse(); +} + +void DreamGenContext::monkAndRyan(ReelRoutine &routine) { + if (checkSpeed(routine)) { + uint16 nextReelPointer = routine.reelPointer() + 1; + if (nextReelPointer == 83) { + data.byte(kIntrocount)++; + textForMonk(); + nextReelPointer = 77; + + if (data.byte(kIntrocount) == 57) { + data.byte(kGetback) = 1; + return; + } + } + + routine.setReelPointer(nextReelPointer); + } + + showGameReel(&routine); +} + +void DreamGenContext::copper(ReelRoutine &routine) { + if (checkSpeed(routine)) { + uint16 nextReelPointer = routine.reelPointer() + 1; + if (nextReelPointer == 94) { + nextReelPointer = 64; + } else if (nextReelPointer == 81 || nextReelPointer == 66) { + // Might wait + if (engine->randomNumber() >= 7) + nextReelPointer--; + } + + routine.setReelPointer(nextReelPointer); + } + + showGameReel(&routine); + addToPeopleList(&routine); +} + +void DreamGenContext::introMonks1(ReelRoutine &routine) { + if (checkSpeed(routine)) { + uint16 nextReelPointer = routine.reelPointer() + 1; + + if (nextReelPointer == 80) { + data.byte(kMapy) += 10; + data.byte(kNowinnewroom) = 1; + showGameReel(&routine); + return; + } else if (nextReelPointer == 30) { + data.byte(kMapy) -= 10; + data.byte(kNowinnewroom) = 1; + nextReelPointer = 51; + } + + routine.setReelPointer(nextReelPointer); + + if (nextReelPointer == 5 || nextReelPointer == 15 || + nextReelPointer == 25 || nextReelPointer == 61 || + nextReelPointer == 71) { + // Wait step + push(es); + push(bx); + intro2Text(); + bx = pop(); + es = pop(); + routine.counter = (uint8)-20; + } + } + + showGameReel(&routine); + routine.mapY = data.byte(kMapy); +} + +void DreamGenContext::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; + else + nextReelPointer = 74; + } + + if (nextReelPointer == 110) { + data.byte(kIntrocount)++; + push(es); + push(bx); + monks2text(); + bx = pop(); + es = pop(); + + if (data.byte(kIntrocount) == 35) + nextReelPointer = 111; + else + nextReelPointer = 98; + } else if (nextReelPointer == 176) { + data.byte(kGetback) = 1; + } else if (nextReelPointer == 125) { + nextReelPointer = 140; + } + + routine.setReelPointer(nextReelPointer); + } + + showGameReel(&routine); +} + +void DreamGenContext::soldier1(ReelRoutine &routine) { + if (routine.reelPointer() != 0) { + data.word(kWatchingtime) = 10; + if (routine.reelPointer() == 30) { + data.byte(kCombatcount)++; + if (data.byte(kCombatcount) == 40) + data.byte(kMandead) = 2; + } else if (checkSpeed(routine)) { + // Not after shot + routine.incReelPointer(); + } + } else if (data.byte(kLastweapon) == 1) { + data.word(kWatchingtime) = 10; + if (data.byte(kManspath) == 2 && data.byte(kFacing) == 4) + routine.incReelPointer(); + data.byte(kLastweapon) = 0xFF; + data.byte(kCombatcount) = 0; + } + + showGameReel(&routine); + addToPeopleList(&routine); +} + +} // End of namespace DreamGen diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp index edaf8ee1eb..0fd596ceac 100644 --- a/engines/dreamweb/print.cpp +++ b/engines/dreamweb/print.cpp @@ -24,18 +24,18 @@ namespace DreamGen { -void DreamGenContext::printboth(const Frame *charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar) { +void DreamBase::printBoth(const Frame *charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar) { uint16 newX = *x; uint8 width, height; - printchar(charSet, &newX, y, c, nextChar, &width, &height); - multidump(*x, y, width, height); + printChar(charSet, &newX, y, c, nextChar, &width, &height); + multiDump(*x, y, width, height); *x = newX; } -uint8 DreamGenContext::getnextword(const Frame *charSet, const uint8 *string, uint8 *totalWidth, uint8 *charCount) { +uint8 DreamBase::getNextWord(const Frame *charSet, const uint8 *string, uint8 *totalWidth, uint8 *charCount) { *totalWidth = 0; *charCount = 0; - while(true) { + while (true) { uint8 firstChar = *string; ++string; ++*charCount; @@ -51,55 +51,47 @@ uint8 DreamGenContext::getnextword(const Frame *charSet, const uint8 *string, ui if (firstChar != 255) { uint8 secondChar = *string; uint8 width = charSet[firstChar - 32 + data.word(kCharshift)].width; - width = kernchars(firstChar, secondChar, width); + width = kernChars(firstChar, secondChar, width); *totalWidth += width; } } } -void DreamGenContext::printchar() { - uint16 x = di; - uint8 width, height; - printchar((const Frame *)ds.ptr(0, 0), &x, bx, al, ah, &width, &height); - di = x; - cl = width; - ch = height; -} - -void DreamGenContext::printchar(const Frame *charSet, uint16* x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height) { +void DreamBase::printChar(const Frame *charSet, uint16* x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height) { if (c == 255) return; - push(si); - push(di); - if (data.byte(kForeignrelease) != 0) + + uint8 dummyWidth, dummyHeight; + if (width == NULL) + width = &dummyWidth; + if (height == NULL) + height = &dummyHeight; + if (data.byte(kForeignrelease)) y -= 3; uint16 tmp = c - 32 + data.word(kCharshift); - showframe(charSet, *x, y, tmp & 0x1ff, (tmp >> 8) & 0xfe, width, height); - di = pop(); - si = pop(); - _cmp(data.byte(kKerning), 0); - if (flags.z()) - *width = kernchars(c, nextChar, *width); + showFrame(charSet, *x, y, tmp & 0x1ff, (tmp >> 8) & 0xfe, width, height); + if (data.byte(kKerning), 0) + *width = kernChars(c, nextChar, *width); (*x) += *width; } -void DreamGenContext::printslow() { - al = printslow(es.ptr(si, 0), di, bx, dl, (bool)(dl & 1)); +void DreamBase::printChar(const Frame *charSet, uint16 x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height) { + printChar(charSet, &x, y, c, nextChar, width, height); } -uint8 DreamGenContext::printslow(const uint8 *string, uint16 x, uint16 y, uint8 maxWidth, bool centered) { +uint8 DreamBase::printSlow(const uint8 *string, uint16 x, uint16 y, uint8 maxWidth, bool centered) { data.byte(kPointerframe) = 1; data.byte(kPointermode) = 3; - const Frame* charSet = (const Frame *)segRef(data.word(kCharset1)).ptr(0, 0); + const Frame* charSet = (const Frame *)getSegment(data.word(kCharset1)).ptr(0, 0); do { uint16 offset = x; - uint16 charCount = getnumber(charSet, string, maxWidth, centered, &offset); + uint16 charCount = getNumber(charSet, string, maxWidth, centered, &offset); do { uint8 c0 = string[0]; uint8 c1 = string[1]; uint8 c2 = string[2]; c0 = engine->modifyChar(c0); - printboth(charSet, &offset, y, c0, c1); + printBoth(charSet, &offset, y, c0, c1); if ((c1 == 0) || (c1 == ':')) { return 0; } @@ -107,10 +99,10 @@ uint8 DreamGenContext::printslow(const uint8 *string, uint16 x, uint16 y, uint8 c1 = engine->modifyChar(c1); data.word(kCharshift) = 91; uint16 offset2 = offset; - printboth(charSet, &offset2, y, c1, c2); + printBoth(charSet, &offset2, y, c1, c2); data.word(kCharshift) = 0; for (int i=0; i<2; ++i) { - uint16 mouseState = waitframes(); + uint16 mouseState = waitFrames(); if (data.byte(kQuitrequested)) return 0; if (mouseState == 0) @@ -128,83 +120,75 @@ uint8 DreamGenContext::printslow(const uint8 *string, uint16 x, uint16 y, uint8 } while (true); } -void DreamGenContext::printdirect() { +void DreamGenContext::printDirect() { uint16 y = bx; - uint16 initialSi = si; const uint8 *initialString = es.ptr(si, 0); const uint8 *string = initialString; - printdirect(&string, di, &y, dl, (bool)(dl & 1)); - si = initialSi + (string - initialString); + al = DreamBase::printDirect(&string, di, &y, dl, (bool)(dl & 1)); + si += (string - initialString); bx = y; } -void DreamGenContext::printdirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered) { - printdirect(&string, x, &y, maxWidth, centered); +uint8 DreamBase::printDirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered) { + return printDirect(&string, x, &y, maxWidth, centered); } -void DreamGenContext::printdirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered) { +uint8 DreamBase::printDirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered) { data.word(kLastxpos) = x; - const Frame *charSet = (const Frame *)segRef(data.word(kCurrentset)).ptr(0, 0); + const Frame *charSet = engine->currentCharset(); while (true) { uint16 offset = x; - uint8 charCount = getnumber(charSet, *string, maxWidth, centered, &offset); + uint8 charCount = getNumber(charSet, *string, maxWidth, centered, &offset); uint16 i = offset; do { uint8 c = (*string)[0]; uint8 nextChar = (*string)[1]; ++(*string); if ((c == 0) || (c == ':')) { - return; + return c; } c = engine->modifyChar(c); uint8 width, height; - printchar(charSet, &i, *y, c, nextChar, &width, &height); + printChar(charSet, &i, *y, c, nextChar, &width, &height); data.word(kLastxpos) = i; --charCount; - } while(charCount); + } while (charCount); *y += data.word(kLinespacing); } } -void DreamGenContext::getnumber() { - uint16 offset = di; - cl = getnumber((Frame *)ds.ptr(0, 0), es.ptr(si, 0), dl, (bool)(dl & 1), &offset); - di = offset; -} - -uint8 DreamGenContext::getnumber(const Frame *charSet, const uint8 *string, uint16 maxWidth, bool centered, uint16* offset) { +uint8 DreamBase::getNumber(const Frame *charSet, const uint8 *string, uint16 maxWidth, bool centered, uint16* offset) { uint8 totalWidth = 0; uint8 charCount = 0; while (true) { uint8 wordTotalWidth, wordCharCount; - uint8 done = getnextword(charSet, string, &wordTotalWidth, &wordCharCount); + uint8 done = getNextWord(charSet, string, &wordTotalWidth, &wordCharCount); string += wordCharCount; + uint16 tmp = totalWidth + wordTotalWidth - 10; if (done == 1) { //endoftext - ax = totalWidth + wordTotalWidth - 10; - if (ax < maxWidth) { + if (tmp < maxWidth) { totalWidth += wordTotalWidth; charCount += wordCharCount; } if (centered) { - ax = (maxWidth & 0xfe) + 2 + 20 - totalWidth; - ax /= 2; + tmp = (maxWidth & 0xfe) + 2 + 20 - totalWidth; + tmp /= 2; } else { - ax = 0; + tmp = 0; } - *offset += ax; + *offset += tmp; return charCount; } - ax = totalWidth + wordTotalWidth - 10; - if (ax >= maxWidth) { //gotoverend + if (tmp >= maxWidth) { //gotoverend if (centered) { - ax = (maxWidth & 0xfe) - totalWidth + 20; - ax /= 2; + tmp = (maxWidth & 0xfe) - totalWidth + 20; + tmp /= 2; } else { - ax = 0; + tmp = 0; } - *offset += ax; + *offset += tmp; return charCount; } totalWidth += wordTotalWidth; @@ -212,22 +196,71 @@ uint8 DreamGenContext::getnumber(const Frame *charSet, const uint8 *string, uint } } -uint8 DreamGenContext::kernchars(uint8 firstChar, uint8 secondChar, uint8 width) { - if ((firstChar == 'a') || (al == 'u')) { +uint8 DreamBase::kernChars(uint8 firstChar, uint8 secondChar, uint8 width) { + if ((firstChar == 'a') || (firstChar == 'u')) { if ((secondChar == 'n') || (secondChar == 't') || (secondChar == 'r') || (secondChar == 'i') || (secondChar == 'l')) return width-1; } return width; } -uint16 DreamGenContext::waitframes() { - readmouse(); - showpointer(); - vsync(); - dumppointer(); - delpointer(); +uint16 DreamBase::waitFrames() { + readMouse(); + showPointer(); + vSync(); + dumpPointer(); + delPointer(); return data.word(kMousebutton); } -} /*namespace dreamgen */ +void DreamGenContext::monPrint() { + uint16 originalBx = bx; + const char *string = (const char *)es.ptr(bx, 0); + const char *nextString = monPrint(string); + bx = originalBx + (nextString - string); +} + +const char *DreamBase::monPrint(const char *string) { + data.byte(kKerning) = 1; + uint16 x = data.word(kMonadx); + Frame *charset = engine->tempCharset(); + const char *iterator = string; + bool done = false; + while (!done) { + + uint16 count = getNumber(charset, (const uint8 *)iterator, 166, false, &x); + do { + char c = *iterator++; + if (c == ':') + break; + if ((c == 0) || (c == '"') || (c == '=')) { + done = true; + break; + } + if (c == '%') { + data.byte(kLasttrigger) = *iterator; + iterator += 2; + done = true; + break; + } + c = engine->modifyChar(c); + printChar(charset, &x, data.word(kMonady), c, 0, NULL, NULL); + data.word(kCurslocx) = x; + data.word(kCurslocy) = data.word(kMonady); + data.word(kMaintimer) = 1; + printCurs(); + vSync(); + lockMon(); + delCurs(); + } while (--count); + + x = data.word(kMonadx); + scrollMonitor(); + data.word(kCurslocx) = data.word(kMonadx); + } + + data.byte(kKerning) = 0; + return iterator; +} +} // End of namespace DreamGen diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 8aa71b285c..9b70d164a6 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -20,26 +20,18 @@ * */ -#ifndef DREAMGEN_RUNTIME_H__ -#define DREAMGEN_RUNTIME_H__ +#ifndef DREAMGEN_RUNTIME_H +#define DREAMGEN_RUNTIME_H #include <assert.h> #include "common/scummsys.h" #include "common/array.h" #include "common/debug.h" -#include "common/hashmap.h" -#include "common/list.h" -#include "common/ptr.h" -namespace DreamWeb { - class DreamWebEngine; -} +#include "dreamweb/segment.h" namespace DreamGen { -//fixme: name clash -#undef random - struct Register { union { uint16 _value; @@ -48,12 +40,6 @@ struct Register { inline Register(): _value() {} inline Register& operator=(uint16 v) { _value = v; return *this; } inline operator uint16&() { return _value; } - inline void cbw() { - if (_value & 0x80) - _value |= 0xff00; - else - _value &= 0x7f; - } }; template<int kIndex> //from low to high @@ -85,113 +71,6 @@ struct RegisterPart { typedef RegisterPart<0> HighPartOfRegister; #endif -class WordRef { - uint8 *_data; - unsigned _index; - uint16 _value; - -public: - inline WordRef(Common::Array<uint8> &data, unsigned index) : _data(data.begin() + index), _index(index) { - assert(index + 1 < data.size()); - _value = _data[0] | (_data[1] << 8); - } - - inline WordRef& operator=(const WordRef &ref) { - _value = ref._value; - return *this; - } - - inline WordRef& operator=(uint16 v) { - _value = v; - return *this; - } - - inline operator uint16&() { - return _value; - } - - inline ~WordRef() { - _data[0] = _value & 0xff; - _data[1] = _value >> 8; - _value = _data[0] | (_data[1] << 8); - } -}; - -struct Segment { - Common::Array<uint8> data; - - inline void assign(const uint8 *b, const uint8 *e) { - data.assign(b, e); - } - - inline uint8 &byte(unsigned index) { - assert(index < data.size()); - return data[index]; - } - - inline WordRef word(unsigned index) { - return WordRef(data, index); - } - - inline uint8 *ptr(unsigned index, unsigned size) { - assert(index + size <= data.size()); - return data.begin() + index; - } -}; - -typedef Common::SharedPtr<Segment> SegmentPtr; - -class Context; - -class SegmentRef { - Context *_context; - uint16 _value; - SegmentPtr _segment; - -public: - SegmentRef(Context *ctx, uint16 value = 0, SegmentPtr segment = SegmentPtr()): _context(ctx), _value(value), _segment(segment) { - } - - inline void reset(uint16 value); - - inline SegmentRef& operator=(const uint16 id) { - reset(id); - return *this; - } - - inline SegmentRef& operator=(const SegmentRef &ref) { - _context = ref._context; - _value = ref._value; - _segment = ref._segment; - return *this; - } - - inline uint8 &byte(unsigned index) { - assert(_segment != 0); - return _segment->byte(index); - } - - inline operator uint16() const { - return _value; - } - - inline WordRef word(unsigned index) { - //debug(1, "getting word ref for %04x:%d", _value, index); - assert(_segment != 0); - return _segment->word(index); - } - - inline void assign(const uint8 *b, const uint8 *e) { - assert(_segment != 0); - _segment->assign(b, e); - } - - inline uint8 *ptr(unsigned index, unsigned size) { - assert(_segment != 0); - return _segment->ptr(index, size); - } -}; - struct Flags { bool _z, _c, _s, _o; inline Flags(): _z(true), _c(false), _s(false), _o(false) {} @@ -225,17 +104,7 @@ struct Flags { }; class Context { - typedef Common::HashMap<uint16, SegmentPtr> SegmentMap; - SegmentMap _segments; - - typedef Common::List<uint16> FreeSegmentList; - FreeSegmentList _freeSegments; - public: - DreamWeb::DreamWebEngine *engine; - - enum { kDefaultDataSegment = 0x1000 }; - Register ax, dx, bx, cx, si, di; LowPartOfRegister al; HighPartOfRegister ah; @@ -246,51 +115,16 @@ public: LowPartOfRegister dl; HighPartOfRegister dh; - SegmentRef cs, ds, es, data; - //data == fake segment register always pointing to data segment + SegmentRef cs; + MutableSegmentRef ds; + MutableSegmentRef es; Flags flags; - inline Context(): engine(0), al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx), - cs(this), ds(this), es(this), data(this) { - _segments[kDefaultDataSegment] = SegmentPtr(new Segment()); - cs.reset(kDefaultDataSegment); - ds.reset(kDefaultDataSegment); - es.reset(kDefaultDataSegment); - data.reset(kDefaultDataSegment); - } - - SegmentRef getSegment(uint16 value) { - SegmentMap::iterator i = _segments.find(value); - assert(i != _segments.end()); - return SegmentRef(this, value, i->_value); - } - - SegmentRef allocateSegment(uint size) { - unsigned id; - if (_freeSegments.empty()) - id = kDefaultDataSegment + _segments.size(); - else { - id = _freeSegments.front(); - _freeSegments.pop_front(); - } - assert(!_segments.contains(id)); - SegmentPtr seg(new Segment()); - seg->data.resize(size); - _segments[id] = seg; - return SegmentRef(this, id, seg); - } - - void deallocateSegment(uint16 id) { - SegmentMap::iterator i = _segments.find(id); - assert(i != _segments.end()); - _segments.erase(i); - _freeSegments.push_back(id); - } + Context(SegmentManager *segMan): al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx), + cs(segMan->data), + ds(segMan, segMan->data), + es(segMan, segMan->data) { - SegmentRef segRef(uint16 seg) { - SegmentRef result(this); - result = seg; - return result; } inline void _cmp(uint8 a, uint8 b) { @@ -564,10 +398,6 @@ public: } }; -inline void SegmentRef::reset(uint16 value) { - *this = _context->getSegment(value); -} - class StackChecker { const Context &_context; const uint _stackDepth; @@ -583,6 +413,6 @@ public: # define STACK_CHECK do {} while (0) #endif -} +} // End of namespace DreamGen #endif diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp index 636182dc83..f0fd477ec1 100644 --- a/engines/dreamweb/saveload.cpp +++ b/engines/dreamweb/saveload.cpp @@ -28,54 +28,53 @@ namespace DreamGen { -void DreamGenContext::loadgame() { - STACK_CHECK; +// Temporary storage for loading the room from a savegame +Room g_madeUpRoomDat; + +void DreamGenContext::loadGame() { if (data.byte(kCommandtype) != 246) { data.byte(kCommandtype) = 246; - al = 41; - commandonly(); + commandOnly(41); } if (data.word(kMousebutton) == data.word(kOldbutton)) return; // "noload" - if (data.word(kMousebutton) == 1) { - ax = 0xFFFF; - doload(); - } + if (data.word(kMousebutton) == 1) + doLoad(-1); } -// input: ax = savegameId // if -1, open menu to ask for slot to load // if >= 0, directly load from that slot -void DreamGenContext::doload() { - STACK_CHECK; - int savegameId = (int16)ax; - +void DreamGenContext::doLoad(int savegameId) { data.byte(kLoadingorsave) = 1; if (ConfMan.getBool("dreamweb_originalsaveload") && savegameId == -1) { - showopbox(); - showloadops(); + showOpBox(); + showLoadOps(); data.byte(kCurrentslot) = 0; - showslots(); - shownames(); + showSlots(); + showNames(); data.byte(kPointerframe) = 0; - worktoscreenm(); - namestoold(); + workToScreenM(); + namesToOld(); data.byte(kGetback) = 0; - while (true) { - if (data.byte(kQuitrequested)) - return; // "quitloaded" - delpointer(); - readmouse(); - showpointer(); - vsync(); - dumppointer(); - dumptextline(); - bx = offset_loadlist; - checkcoords(); - if (data.byte(kGetback) == 1) - break; + while (data.byte(kGetback) == 0) { + if (quitRequested()) + return; + delPointer(); + readMouse(); + showPointer(); + vSync(); + dumpPointer(); + dumpTextLine(); + RectWithCallback loadlist[] = { + { kOpsx+176,kOpsx+192,kOpsy+60,kOpsy+76,&DreamGenContext::getBackToOps }, + { kOpsx+128,kOpsx+190,kOpsy+12,kOpsy+100,&DreamGenContext::actualLoad }, + { kOpsx+2,kOpsx+92,kOpsy+4,kOpsy+81,&DreamGenContext::selectSlot }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + checkCoords(loadlist); if (data.byte(kGetback) == 2) return; // "quitloaded" } @@ -98,83 +97,35 @@ void DreamGenContext::doload() { return; } + loadPosition(savegameId); - // TODO: proper scheme for filename, in a separate function - //Common::String filename = ConfMan.getActiveDomainName() + Common::String::format(".d%02d", savegameId); - Common::String filename = Common::String::format("DREAMWEB.D%02d", savegameId); - debug(1, "Loading from filename: %s", filename.c_str()); - engine->openSaveFileForReading(filename); - - // TODO: The below is duplicated from Loadposition - data.word(kTimecount) = 0; - clearchanges(); - - ds = cs; - dx = kFileheader; - cx = kHeaderlen; - savefileread(); - es = cs; - di = kFiledata; - ax = savegameId; - if (savegameId < 7) { - cx = 17; - _mul(cx); - ds = data; - dx = kSavenames; - _add(dx, ax); - loadseg(); - } else { - // For potential support of more than 7 savegame slots, - // loading into the savenames buffer isn't always possible - // Emulate a loadseg call: - uint8 namebuf[17]; - engine->readFromFile(namebuf, 17); - _add(di, 2); - } - ds = data; - dx = kStartvars; - loadseg(); - ds = data.word(kExtras); - dx = kExframedata; - loadseg(); - ds = data.word(kBuffers); - dx = kListofchanges; - loadseg(); - ds = data; - dx = kMadeuproomdat; - loadseg(); - ds = cs; - dx = kReelroutines; - loadseg(); - closefile(); data.byte(kGetback) = 1; } + // If we reach this point, loadPosition() has just been called. + // Among other things, it will have filled g_MadeUpRoomDat. + // kTempgraphics might not have been allocated if we bypassed all menus if (data.word(kTempgraphics) != 0xFFFF) - getridoftemp(); + getRidOfTemp(); - dx = data; - es = dx; - bx = kMadeuproomdat; - startloading(); - loadroomssample(); + startLoading(g_madeUpRoomDat); + loadRoomsSample(); data.byte(kRoomloaded) = 1; data.byte(kNewlocation) = 255; - clearsprites(); - initman(); - initrain(); + clearSprites(); + initMan(); + initRain(); data.word(kTextaddressx) = 13; data.word(kTextaddressy) = 182; data.byte(kTextlen) = 240; startup(); - worktoscreen(); + workToScreenCPP(); data.byte(kGetback) = 4; } -void DreamGenContext::savegame() { - STACK_CHECK; +void DreamGenContext::saveGame() { if (data.byte(kMandead) == 2) { blank(); return; @@ -182,8 +133,7 @@ void DreamGenContext::savegame() { if (data.byte(kCommandtype) != 247) { data.byte(kCommandtype) = 247; - al = 44; - commandonly(); + commandOnly(44); } if (data.word(kMousebutton) != 1) return; @@ -191,34 +141,36 @@ void DreamGenContext::savegame() { data.byte(kLoadingorsave) = 2; if (ConfMan.getBool("dreamweb_originalsaveload")) { - showopbox(); - showsaveops(); + showOpBox(); + showSaveOps(); data.byte(kCurrentslot) = 0; - showslots(); - shownames(); - worktoscreenm(); - namestoold(); + showSlots(); + showNames(); + workToScreenM(); + namesToOld(); data.word(kBufferin) = 0; data.word(kBufferout) = 0; data.byte(kGetback) = 0; - while (true) { - _cmp(data.byte(kQuitrequested), 0); - if (!flags.z()) - return /* (quitsavegame) */; - delpointer(); - checkinput(); - readmouse(); - showpointer(); - vsync(); - dumppointer(); - dumptextline(); - bx = offset_savelist; - checkcoords(); - _cmp(data.byte(kGetback), 0); - if (flags.z()) - continue; - break; + while (data.byte(kGetback) == 0) { + if (quitRequested()) + return; + delPointer(); + checkInput(); + readMouse(); + showPointer(); + vSync(); + dumpPointer(); + dumpTextLine(); + + RectWithCallback savelist[] = { + { kOpsx+176,kOpsx+192,kOpsy+60,kOpsy+76,&DreamGenContext::getBackToOps }, + { kOpsx+128,kOpsx+190,kOpsy+12,kOpsy+100,&DreamGenContext::actualSave }, + { kOpsx+2,kOpsx+92,kOpsy+4,kOpsy+81,&DreamGenContext::selectSlot }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + checkCoords(savelist); } return; } else { @@ -238,54 +190,7 @@ void DreamGenContext::savegame() { return; } - // TODO: The below is copied from actualsave - al = data.byte(kLocation); - ah = 0; - cx = 32; - _mul(cx); - ds = cs; - si = kRoomdata; - _add(si, ax); - di = kMadeuproomdat; - bx = di; - es = cs; - cx = 16; - _movsw(cx, true); - al = data.byte(kRoomssample); - es.byte(bx+13) = al; - al = data.byte(kMapx); - es.byte(bx+15) = al; - al = data.byte(kMapy); - es.byte(bx+16) = al; - al = data.byte(kLiftflag); - es.byte(bx+20) = al; - al = data.byte(kManspath); - es.byte(bx+21) = al; - al = data.byte(kFacing); - es.byte(bx+22) = al; - al = 255; - es.byte(bx+27) = al; - - // TODO: The below is copied from saveposition - makeheader(); - - //Common::String filename = ConfMan.getActiveDomainName() + Common::String::format(".d%02d", savegameId); - Common::String filename = Common::String::format("DREAMWEB.D%02d", savegameId); - debug(1, "Saving to filename: %s (%s)", filename.c_str(), game_description.c_str()); - - engine->openSaveFileForWriting(filename.c_str()); - - dx = data; - ds = dx; - dx = kFileheader; - cx = kHeaderlen; - savefilewrite(); - dx = data; - es = dx; - di = kFiledata; - - // TODO: Check if this 2 is a constant - uint8 descbuf[17] = { 2, 0 }; + char descbuf[17] = { 2, 0 }; strncpy((char*)descbuf+1, game_description.c_str(), 16); unsigned int desclen = game_description.size(); if (desclen > 15) @@ -294,50 +199,328 @@ void DreamGenContext::savegame() { descbuf[++desclen] = 0; while (desclen < 17) descbuf[++desclen] = 1; - if (savegameId < 7) { - ax = savegameId; - cx = 17; - _mul(cx); - ds = data; - dx = kSavenames; - _add(dx, ax); - memcpy(data.ptr(dx,17), descbuf, 17); - saveseg(); - } else { - // savenames only has room for descriptions for 7 slots - uint16 len = es.word(di); - _add(di, 2); - assert(len == 17); - engine->writeToSaveFile(descbuf, len); - } + if (savegameId < 7) + memcpy(&_saveNames[17*savegameId], descbuf, 17); - ds = data; - dx = kStartvars; - saveseg(); - ds = data.word(kExtras); - dx = kExframedata; - saveseg(); - ds = data.word(kBuffers); - dx = kListofchanges; - saveseg(); - ds = data; - dx = kMadeuproomdat; - saveseg(); - ds = data; - dx = kReelroutines; - saveseg(); - closefile(); - - getridoftemp(); - restoreall(); + savePosition(savegameId, descbuf); + + // TODO: The below is copied from actualsave + getRidOfTemp(); + restoreAll(); // reels data.word(kTextaddressx) = 13; data.word(kTextaddressy) = 182; data.byte(kTextlen) = 240; - redrawmainscrn(); - worktoscreenm(); + redrawMainScrn(); + workToScreenM(); data.byte(kGetback) = 4; } } +void DreamGenContext::namesToOld() { + memcpy(_saveNamesOld, _saveNames, 17*7); +} + +void DreamGenContext::oldToNames() { + memcpy(_saveNames, _saveNamesOld, 17*7); +} + +void DreamGenContext::saveLoad() { + if (data.word(kWatchingtime) || (data.byte(kPointermode) == 2)) { + blank(); + return; + } + if (data.byte(kCommandtype) != 253) { + data.byte(kCommandtype) = 253; + commandOnly(43); + } + if ((data.word(kMousebutton) != data.word(kOldbutton)) && (data.word(kMousebutton) & 1)) + doSaveLoad(); +} + +void DreamGenContext::showMainOps() { + showFrame(tempGraphics(), kOpsx+10, kOpsy+10, 8, 0); + showFrame(tempGraphics(), kOpsx+59, kOpsy+30, 7, 0); + showFrame(tempGraphics(), kOpsx+128+4, kOpsy+12, 1, 0); +} + +void DreamGenContext::showDiscOps() { + showFrame(tempGraphics(), kOpsx+128+4, kOpsy+12, 1, 0); + showFrame(tempGraphics(), kOpsx+10, kOpsy+10, 9, 0); + showFrame(tempGraphics(), kOpsx+59, kOpsy+30, 10, 0); + showFrame(tempGraphics(), kOpsx+176+2, kOpsy+60-4, 5, 0); +} + +void DreamGenContext::actualSave() { + if (data.byte(kCommandtype) != 222) { + data.byte(kCommandtype) = 222; + commandOnly(44); + } + + if (!(data.word(kMousebutton) & 1)) + return; + + unsigned int slot = data.byte(kCurrentslot); + + const char *desc = &_saveNames[17*slot]; + if (desc[1] == 0) // The actual description string starts at desc[1] + return; + + savePosition(slot, desc); + + getRidOfTemp(); + restoreAll(); // reels + data.word(kTextaddressx) = 13; + data.word(kTextaddressy) = 182; + data.byte(kTextlen) = 240; + redrawMainScrn(); + workToScreenM(); + data.byte(kGetback) = 4; +} + +void DreamGenContext::actualLoad() { + if (data.byte(kCommandtype) != 221) { + data.byte(kCommandtype) = 221; + commandOnly(41); + } + + if (data.word(kMousebutton) == data.word(kOldbutton) || data.word(kMousebutton) != 1) + return; + + unsigned int slot = data.byte(kCurrentslot); + + const char *desc = &_saveNames[17*slot]; + if (desc[1] == 0) // The actual description string starts at desc[1] + return; + + loadPosition(data.byte(kCurrentslot)); + data.byte(kGetback) = 1; +} + +void DreamGenContext::savePosition(unsigned int slot, const char *descbuf) { + + const Room ¤tRoom = g_roomData[data.byte(kLocation)]; + + Room madeUpRoom = currentRoom; + madeUpRoom.roomsSample = data.byte(kRoomssample); + madeUpRoom.mapX = data.byte(kMapx); + madeUpRoom.mapY = data.byte(kMapy); + madeUpRoom.liftFlag = data.byte(kLiftflag); + madeUpRoom.b21 = data.byte(kManspath); + madeUpRoom.facing = data.byte(kFacing); + madeUpRoom.b27 = 255; + + + engine->processEvents(); // TODO: Is this necessary? + + Common::String filename = engine->getSavegameFilename(slot); + debug(1, "savePosition: slot %d filename %s", slot, filename.c_str()); + Common::OutSaveFile *outSaveFile = engine->getSaveFileManager()->openForSaving(filename); + if (!outSaveFile) // TODO: Do proper error handling! + error("save could not be opened for writing"); + + // Initialize new header + FileHeader header; + + // Note: _desc is not zero-terminated + const char *desc = "DREAMWEB DATA FILE COPYRIGHT 1992 CREATIVE REALITY"; + assert(strlen(desc) == sizeof(header._desc)); + memcpy(header._desc, desc, sizeof(header._desc)); + memset(&header._len[0], 0, sizeof(header._len)); + memset(&header._padding[0], 0, sizeof(header._padding)); + + // fill length fields in savegame file header + uint16 len[6] = { 17, kLengthofvars, kLengthofextra, + 4*kNumchanges, 48, kLenofreelrouts }; + for (int i = 0; i < 6; ++i) + header.setLen(i, len[i]); + + outSaveFile->write((const uint8 *)&header, sizeof(FileHeader)); + outSaveFile->write(descbuf, len[0]); + outSaveFile->write(data.ptr(kStartvars, len[1]), len[1]); + outSaveFile->write(getSegment(data.word(kExtras)).ptr(kExframedata, len[2]), len[2]); + outSaveFile->write(getSegment(data.word(kBuffers)).ptr(kListofchanges, len[3]), len[3]); + + // len[4] == 48, which is sizeof(Room) plus 16 for 'Roomscango' + outSaveFile->write((const uint8 *)&madeUpRoom, sizeof(Room)); + outSaveFile->write(data.ptr(kRoomscango, 16), 16); + + outSaveFile->write(data.ptr(kReelroutines, len[5]), len[5]); + + outSaveFile->finalize(); + if (outSaveFile->err()) { + // TODO: Do proper error handling + warning("an error occurred while writing the savegame"); + } + + delete outSaveFile; +} + +void DreamGenContext::loadPosition(unsigned int slot) { + data.word(kTimecount) = 0; + clearChanges(); + + Common::String filename = engine->getSavegameFilename(slot); + debug(1, "loadPosition: slot %d filename %s", slot, filename.c_str()); + Common::InSaveFile *inSaveFile = engine->getSaveFileManager()->openForLoading(filename); + if (!inSaveFile) // TODO: Do proper error handling! + error("save could not be opened for reading"); + + FileHeader header; + + inSaveFile->read((uint8 *)&header, sizeof(FileHeader)); + + // read segment lengths from savegame file header + int len[6]; + for (int i = 0; i < 6; ++i) + len[i] = header.len(i); + if (len[0] != 17) + ::error("Error loading save: description buffer isn't 17 bytes"); + + if (slot < 7) { + inSaveFile->read(&_saveNames[17*slot], len[0]); + } else { + // The savenames buffer only has room for 7 descriptions + uint8 namebuf[17]; + inSaveFile->read(namebuf, 17); + } + inSaveFile->read(data.ptr(kStartvars, len[1]), len[1]); + inSaveFile->read(getSegment(data.word(kExtras)).ptr(kExframedata, len[2]), len[2]); + inSaveFile->read(getSegment(data.word(kBuffers)).ptr(kListofchanges, len[3]), len[3]); + + // len[4] == 48, which is sizeof(Room) plus 16 for 'Roomscango' + // Note: the values read into g_madeUpRoomDat are only used in actualLoad, + // which is (almost) immediately called after this function + inSaveFile->read((uint8 *)&g_madeUpRoomDat, sizeof(Room)); + inSaveFile->read(data.ptr(kRoomscango, 16), 16); + + inSaveFile->read(data.ptr(kReelroutines, len[5]), len[5]); + + delete inSaveFile; +} + +// Count number of save files, and load their descriptions into _saveNames +unsigned int DreamGenContext::scanForNames() { + unsigned int count = 0; + + FileHeader header; + + // TODO: Change this to use SaveFileManager::listSavefiles() + for (unsigned int slot = 0; slot < 7; ++slot) { + _saveNames[17*slot+0] = 2; + _saveNames[17*slot+1] = 0; + for (int i = 2; i < 17; ++i) + _saveNames[17*slot+i] = 1; + + // Try opening savegame with the given slot id + Common::String filename = engine->getSavegameFilename(slot); + Common::InSaveFile *inSaveFile = engine->getSaveFileManager()->openForLoading(filename); + if (!inSaveFile) + continue; + + ++count; + + inSaveFile->read((uint8 *)&header, sizeof(FileHeader)); + + if (header.len(0) != 17) { + ::warning("Error loading save: description buffer isn't 17 bytes"); + delete inSaveFile; + continue; + } + + // NB: Only possible if slot < 7 + inSaveFile->read(&_saveNames[17*slot], 17); + + delete inSaveFile; + } + + al = (uint8)count; + + return count; +} + +void DreamGenContext::loadOld() { + if (data.byte(kCommandtype) != 252) { + data.byte(kCommandtype) = 252; + commandOnly(48); + } + + if (!(data.word(kMousebutton) & 1)) + return; + + doLoad(-1); + + if (data.byte(kGetback) == 4 || quitRequested()) + return; + + showDecisions(); + workToScreenM(); + data.byte(kGetback) = 0; +} + +void DreamGenContext::loadSaveBox() { + loadIntoTemp("DREAMWEB.G08"); +} + +// show savegame names (original interface), and set kCursorpos +void DreamBase::showNames() { + for (int slot = 0; slot < 7; ++slot) { + // The first character of the savegame name is unused + Common::String name(&_saveNames[17*slot + 1]); + + if (slot != data.byte(kCurrentslot)) { + printDirect((const uint8 *)name.c_str(), kOpsx + 21, kOpsy + 10*slot + 10, 200, false); + continue; + } + if (data.byte(kLoadingorsave) != 2) { + data.word(kCharshift) = 91; + printDirect((const uint8 *)name.c_str(), kOpsx + 21, kOpsy + 10*slot + 10, 200, false); + data.word(kCharshift) = 0; + continue; + } + + int pos = name.size(); + data.byte(kCursorpos) = pos; + name += '/'; // cursor character + printDirect((const uint8 *)name.c_str(), kOpsx + 21, kOpsy + 10*slot + 10, 200, false); + } +} + +void DreamGenContext::checkInput() { + if (data.byte(kLoadingorsave) == 3) + return; + + readKey(); + + // The first character of the savegame name is unused + char *name = &_saveNames[17*data.byte(kCurrentslot) + 1]; + + if (data.byte(kCurrentkey) == 0) { + return; + } else if (data.byte(kCurrentkey) == 13) { + data.byte(kLoadingorsave) = 3; + } else if (data.byte(kCurrentkey) == 8) { + if (data.byte(kCursorpos) == 0) + return; + + --data.byte(kCursorpos); + name[data.byte(kCursorpos)] = 0; + name[data.byte(kCursorpos)+1] = 1; + } else { + if (data.byte(kCursorpos) == 14) + return; + + name[data.byte(kCursorpos)] = data.byte(kCurrentkey); + name[data.byte(kCursorpos)+1] = 0; + name[data.byte(kCursorpos)+2] = 1; + ++data.byte(kCursorpos); + } + + showOpBox(); + showNames(); + showSlots(); + showSaveOps(); + workToScreenM(); +} + -} /*namespace dreamgen */ +} // End of namespace DreamGen diff --git a/engines/dreamweb/segment.h b/engines/dreamweb/segment.h new file mode 100644 index 0000000000..9464015478 --- /dev/null +++ b/engines/dreamweb/segment.h @@ -0,0 +1,227 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef DREAMGEN_SEGMENT_H +#define DREAMGEN_SEGMENT_H + +#include "common/array.h" +#include "common/ptr.h" +#include "common/hashmap.h" +#include "common/list.h" + +namespace DreamGen { + +class WordRef { + uint8 *_data; + unsigned _index; + uint16 _value; + +public: + inline WordRef(Common::Array<uint8> &data, unsigned index) : _data(data.begin() + index), _index(index) { + assert(index + 1 < data.size()); + _value = _data[0] | (_data[1] << 8); + } + + inline WordRef& operator=(const WordRef &ref) { + _value = ref._value; + return *this; + } + + inline WordRef& operator=(uint16 v) { + _value = v; + return *this; + } + + inline operator uint16&() { + return _value; + } + + inline ~WordRef() { + _data[0] = _value & 0xff; + _data[1] = _value >> 8; + _value = _data[0] | (_data[1] << 8); + } +}; + +class Segment { + Common::Array<uint8> data; + +public: + Segment(uint size = 0) { + if (size > 0) + data.resize(size); + } + + inline void assign(const uint8 *b, const uint8 *e) { + data.assign(b, e); + } + + inline uint8 &byte(unsigned index) { + assert(index < data.size()); + return data[index]; + } + + inline WordRef word(unsigned index) { + return WordRef(data, index); + } + + inline uint8 *ptr(unsigned index, unsigned size) { + assert(index + size <= data.size()); + return data.begin() + index; + } +}; + +typedef Common::SharedPtr<Segment> SegmentPtr; + +class SegmentRef { + uint16 _value; + SegmentPtr _segment; + +public: + SegmentRef(uint16 value = 0, SegmentPtr segment = SegmentPtr()) + : _value(value), _segment(segment) { + } + + inline operator uint16() const { + return _value; + } + + SegmentPtr getSegmentPtr() const { + return _segment; + } + + inline uint8 &byte(unsigned index) { + assert(_segment != 0); + return _segment->byte(index); + } + + inline WordRef word(unsigned index) { + //debug(1, "getting word ref for %04x:%d", _value, index); + assert(_segment != 0); + return _segment->word(index); + } + + inline void assign(const uint8 *b, const uint8 *e) { + assert(_segment != 0); + _segment->assign(b, e); + } + + inline uint8 *ptr(unsigned index, unsigned size) { + assert(_segment != 0); + return _segment->ptr(index, size); + } + +protected: + SegmentRef &operator=(const SegmentRef &seg) { + _value = seg._value; + _segment = seg._segment; + return *this; + } + +}; + +class SegmentManager; + +class MutableSegmentRef : public SegmentRef { +protected: + SegmentManager *_segMan; + +public: + MutableSegmentRef(SegmentManager *segMan, uint16 value = 0, SegmentPtr segment = SegmentPtr()) + : _segMan(segMan), SegmentRef(value, segment) { + } + + MutableSegmentRef(SegmentManager *segMan, SegmentRef seg) + : _segMan(segMan), SegmentRef(seg) { + } + + inline MutableSegmentRef& operator=(const uint16 id); + +}; + + +class SegmentManager { +private: + typedef Common::HashMap<uint16, SegmentPtr> SegmentMap; + SegmentMap _segments; + + typedef Common::List<uint16> FreeSegmentList; + FreeSegmentList _freeSegments; + + enum { kDefaultDataSegment = 0x1000 }; + +public: + + SegmentPtr _realData; ///< the primary data segment, points to a huge blob of binary data + SegmentRef data; ///< fake segment register always pointing to data segment + +public: + SegmentManager() : + _realData(new Segment()), + data(kDefaultDataSegment, _realData) { + + _segments[kDefaultDataSegment] = data.getSegmentPtr(); + } + + SegmentRef getSegment(uint16 value) { + SegmentMap::iterator i = _segments.find(value); + if (i != _segments.end()) + return SegmentRef(value, i->_value); + else + return SegmentRef(value); + } + + SegmentRef allocateSegment(uint size) { + unsigned id; + if (_freeSegments.empty()) + id = kDefaultDataSegment + _segments.size(); + else { + id = _freeSegments.front(); + _freeSegments.pop_front(); + } + assert(!_segments.contains(id)); + SegmentPtr seg(new Segment(size)); + _segments[id] = seg; + return SegmentRef(id, seg); + } + + void deallocateSegment(uint16 id) { + SegmentMap::iterator i = _segments.find(id); + if(i != _segments.end()) { + _segments.erase(i); + _freeSegments.push_back(id); + } else { + debug("Deallocating non existent segment! Client code should be fixed."); + } + } + +}; + + +inline MutableSegmentRef& MutableSegmentRef::operator=(const uint16 id) { + SegmentRef::operator=(_segMan->getSegment(id)); + return *this; +} + +} // End of namespace DreamGen + +#endif diff --git a/engines/dreamweb/sound.cpp b/engines/dreamweb/sound.cpp new file mode 100644 index 0000000000..784a6d0d11 --- /dev/null +++ b/engines/dreamweb/sound.cpp @@ -0,0 +1,294 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "dreamweb/dreamweb.h" +#include "dreamweb/dreamgen.h" + +#include "audio/mixer.h" +#include "audio/decoders/raw.h" + +#include "common/config-manager.h" + +namespace DreamGen { + +void DreamGenContext::loadSpeech() { + loadSpeech((uint8)dl, (uint8)dh, (uint8)cl, (uint16)ax); +} + +bool DreamBase::loadSpeech(byte type1, int idx1, byte type2, int idx2) { + cancelCh1(); + + Common::String name = Common::String::format("%c%02d%c%04d.RAW", type1, idx1, type2, idx2); + //debug("name = %s", name.c_str()); + bool result = engine->loadSpeech(name); + + data.byte(kSpeechloaded) = result; + return result; +} + + +void DreamBase::volumeAdjust() { + if (data.byte(kVolumedirection) == 0) + return; + if (data.byte(kVolume) != data.byte(kVolumeto)) { + data.byte(kVolumecount) += 64; + // Only modify the volume every 256/64 = 4th time around + if (data.byte(kVolumecount) == 0) + data.byte(kVolume) += data.byte(kVolumedirection); + } else { + data.byte(kVolumedirection) = 0; + } +} + +void DreamBase::playChannel0(uint8 index, uint8 repeat) { + data.byte(kCh0playing) = index; + Sound *soundBank; + if (index >= 12) { + soundBank = (Sound *)getSegment(data.word(kSounddata2)).ptr(0, 0); + index -= 12; + } else + soundBank = (Sound *)getSegment(data.word(kSounddata)).ptr(0, 0); + + data.byte(kCh0repeat) = repeat; + data.word(kCh0blockstocopy) = soundBank[index].blockCount(); +} + +void DreamBase::playChannel1(uint8 index) { + if (data.byte(kCh1playing) == 7) + return; + + data.byte(kCh1playing) = index; + Sound *soundBank; + if (index >= 12) { + soundBank = (Sound *)getSegment(data.word(kSounddata2)).ptr(0, 0); + index -= 12; + } else + soundBank = (Sound *)getSegment(data.word(kSounddata)).ptr(0, 0); + + data.word(kCh1blockstocopy) = soundBank[index].blockCount(); +} + +void DreamGenContext::playChannel1() { + playChannel1(al); +} + +void DreamBase::cancelCh0() { + data.byte(kCh0repeat) = 0; + data.word(kCh0blockstocopy) = 0; + data.byte(kCh0playing) = 255; + engine->stopSound(0); +} + +void DreamBase::cancelCh1() { + data.word(kCh1blockstocopy) = 0; + data.byte(kCh1playing) = 255; + engine->stopSound(1); +} + +void DreamBase::loadRoomsSample() { + uint8 sample = data.byte(kRoomssample); + + if (sample == 255 || data.byte(kCurrentsample) == sample) + return; // loaded already + + assert(sample < 100); + Common::String sampleName = Common::String::format("DREAMWEB.V%02d", sample); + + uint8 ch0 = data.byte(kCh0playing); + if (ch0 >= 12 && ch0 != 255) + cancelCh0(); + uint8 ch1 = data.byte(kCh1playing); + if (ch1 >= 12) + cancelCh1(); + engine->loadSounds(1, sampleName.c_str()); +} + +} // End of namespace DreamGen + + +namespace DreamWeb { + +void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) { + debug(1, "playSound(%u, %u, %u)", channel, id, loops); + + int bank = 0; + bool speech = false; + Audio::Mixer::SoundType type = channel == 0? + Audio::Mixer::kMusicSoundType: Audio::Mixer::kSFXSoundType; + + if (id >= 12) { + id -= 12; + bank = 1; + if (id == 50) { + speech = true; + type = Audio::Mixer::kSpeechSoundType; + } + } + const SoundData &data = _soundData[bank]; + + Audio::SeekableAudioStream *raw; + if (!speech) { + if (id >= data.samples.size() || data.samples[id].size == 0) { + warning("invalid sample #%u played", id); + return; + } + + const Sample &sample = data.samples[id]; + uint8 *buffer = (uint8 *)malloc(sample.size); + if (!buffer) + error("out of memory: cannot allocate memory for sound(%u bytes)", sample.size); + memcpy(buffer, data.data.begin() + sample.offset, sample.size); + + raw = Audio::makeRawStream( + buffer, + sample.size, 22050, Audio::FLAG_UNSIGNED); + } else { + uint8 *buffer = (uint8 *)malloc(_speechData.size()); + if (!buffer) + error("out of memory: cannot allocate memory for sound(%u bytes)", _speechData.size()); + memcpy(buffer, _speechData.begin(), _speechData.size()); + raw = Audio::makeRawStream( + buffer, + _speechData.size(), 22050, Audio::FLAG_UNSIGNED); + + } + + Audio::AudioStream *stream; + if (loops > 1) { + stream = new Audio::LoopingAudioStream(raw, loops < 255? loops: 0); + } else + stream = raw; + + if (_mixer->isSoundHandleActive(_channelHandle[channel])) + _mixer->stopHandle(_channelHandle[channel]); + _mixer->playStream(type, &_channelHandle[channel], stream); +} + +void DreamWebEngine::stopSound(uint8 channel) { + debug(1, "stopSound(%u)", channel); + assert(channel == 0 || channel == 1); + _mixer->stopHandle(_channelHandle[channel]); + if (channel == 0) + _channel0 = 0; + else + _channel1 = 0; +} + +bool DreamWebEngine::loadSpeech(const Common::String &filename) { + if (ConfMan.getBool("speech_mute")) + return false; + + Common::File file; + if (!file.open("speech/" + filename)) + return false; + + debug(1, "loadSpeech(%s)", filename.c_str()); + + uint size = file.size(); + _speechData.resize(size); + file.read(_speechData.begin(), size); + file.close(); + return true; +} + +void DreamWebEngine::soundHandler() { + _base.data.byte(DreamGen::kSubtitles) = ConfMan.getBool("subtitles"); + _base.volumeAdjust(); + + uint volume = _base.data.byte(DreamGen::kVolume); + //.vol file loaded into soundbuf:0x4000 + //volume table at (volume * 0x100 + 0x3f00) + //volume value could be from 1 to 7 + //1 - 0x10-0xff + //2 - 0x1f-0xdf + //3 - 0x2f-0xd0 + //4 - 0x3e-0xc1 + //5 - 0x4d-0xb2 + //6 - 0x5d-0xa2 + //7 - 0x6f-0x91 + if (volume >= 8) + volume = 7; + volume = (8 - volume) * Audio::Mixer::kMaxChannelVolume / 8; + _mixer->setChannelVolume(_channelHandle[0], volume); + + uint8 ch0 = _base.data.byte(DreamGen::kCh0playing); + if (ch0 == 255) + ch0 = 0; + uint8 ch1 = _base.data.byte(DreamGen::kCh1playing); + if (ch1 == 255) + ch1 = 0; + uint8 ch0loop = _base.data.byte(DreamGen::kCh0repeat); + + if (_channel0 != ch0) { + _channel0 = ch0; + if (ch0) { + playSound(0, ch0, ch0loop); + } + } + if (_channel1 != ch1) { + _channel1 = ch1; + if (ch1) { + playSound(1, ch1, 1); + } + } + if (!_mixer->isSoundHandleActive(_channelHandle[0])) { + _base.data.byte(DreamGen::kCh0playing) = 255; + _channel0 = 0; + } + if (!_mixer->isSoundHandleActive(_channelHandle[1])) { + _base.data.byte(DreamGen::kCh1playing) = 255; + _channel1 = 0; + } + +} + +void DreamWebEngine::loadSounds(uint bank, const Common::String &filename) { + debug(1, "loadSounds(%u, %s)", bank, filename.c_str()); + Common::File file; + if (!file.open(filename)) { + warning("cannot open %s", filename.c_str()); + return; + } + + uint8 header[0x60]; + file.read(header, sizeof(header)); + uint tablesize = READ_LE_UINT16(header + 0x32); + debug(1, "table size = %u", tablesize); + + SoundData &soundData = _soundData[bank]; + soundData.samples.resize(tablesize / 6); + uint total = 0; + for (uint i = 0; i < tablesize / 6; ++i) { + uint8 entry[6]; + Sample &sample = soundData.samples[i]; + file.read(entry, sizeof(entry)); + sample.offset = entry[0] * 0x4000 + READ_LE_UINT16(entry + 1); + sample.size = READ_LE_UINT16(entry + 3) * 0x800; + total += sample.size; + debug(1, "offset: %08x, size: %u", sample.offset, sample.size); + } + soundData.data.resize(total); + file.read(soundData.data.begin(), total); + file.close(); +} + +} // End of namespace DreamWeb diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp index 864bba1d8c..e93a77f3ff 100644 --- a/engines/dreamweb/sprite.cpp +++ b/engines/dreamweb/sprite.cpp @@ -24,14 +24,14 @@ namespace DreamGen { -Sprite *DreamGenContext::spritetable() { - Sprite *sprite = (Sprite *)segRef(data.word(kBuffers)).ptr(kSpritetable, 16 * sizeof(Sprite)); +Sprite *DreamBase::spriteTable() { + Sprite *sprite = (Sprite *)getSegment(data.word(kBuffers)).ptr(kSpritetable, 16 * sizeof(Sprite)); return sprite; } -void DreamGenContext::printsprites() { +void DreamGenContext::printSprites() { for (size_t priority = 0; priority < 7; ++priority) { - Sprite *sprites = spritetable(); + Sprite *sprites = spriteTable(); for (size_t j = 0; j < 16; ++j) { const Sprite &sprite = sprites[j]; if (sprite.updateCallback() == 0x0ffff) @@ -40,12 +40,12 @@ void DreamGenContext::printsprites() { continue; if (sprite.hidden == 1) continue; - printasprite(&sprite); + printASprite(&sprite); } } } -void DreamGenContext::printasprite(const Sprite *sprite) { +void DreamGenContext::printASprite(const Sprite *sprite) { uint16 x, y; if (sprite->y >= 220) { y = data.word(kMapady) - (256 - sprite->y); @@ -60,20 +60,20 @@ void DreamGenContext::printasprite(const Sprite *sprite) { } uint8 c; - if (sprite->b29 != 0) + if (sprite->walkFrame != 0) c = 8; else c = 0; - showframe((const Frame *)segRef(sprite->frameData()).ptr(0, 0), x, y, sprite->b15, c); + showFrame((const Frame *)getSegment(sprite->frameData()).ptr(0, 0), x, y, sprite->frameNumber, c); } -void DreamGenContext::clearsprites() { - memset(spritetable(), 0xff, sizeof(Sprite) * 16); +void DreamGenContext::clearSprites() { + memset(spriteTable(), 0xff, sizeof(Sprite) * 16); } -Sprite *DreamGenContext::makesprite(uint8 x, uint8 y, uint16 updateCallback, uint16 frameData, uint16 somethingInDi) { - Sprite *sprite = spritetable(); - while (sprite->b15 != 0xff) { // NB: No boundchecking in the original code either +Sprite *DreamGenContext::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; } @@ -83,13 +83,13 @@ Sprite *DreamGenContext::makesprite(uint8 x, uint8 y, uint16 updateCallback, uin sprite->setFrameData(frameData); WRITE_LE_UINT16(&sprite->w8, somethingInDi); sprite->w2 = 0xffff; - sprite->b15 = 0; + sprite->frameNumber = 0; sprite->delay = 0; return sprite; } -void DreamGenContext::spriteupdate() { - Sprite *sprites = spritetable(); +void DreamGenContext::spriteUpdate() { + Sprite *sprites = spriteTable(); sprites[0].hidden = data.byte(kRyanon); Sprite *sprite = sprites; @@ -98,10 +98,10 @@ void DreamGenContext::spriteupdate() { if (updateCallback != 0xffff) { sprite->w24 = sprite->w2; if (updateCallback == addr_mainman) // NB : Let's consider the callback as an enum while more code is not ported to C++ - mainman(sprite); + mainMan(sprite); else { assert(updateCallback == addr_backobject); - backobject(sprite); + backObject(sprite); } } @@ -111,18 +111,18 @@ void DreamGenContext::spriteupdate() { } } -void DreamGenContext::initman() { - Sprite *sprite = makesprite(data.byte(kRyanx), data.byte(kRyany), addr_mainman, data.word(kMainsprites), 0); +void DreamGenContext::initMan() { + Sprite *sprite = makeSprite(data.byte(kRyanx), data.byte(kRyany), addr_mainman, data.word(kMainsprites), 0); sprite->priority = 4; - sprite->b22 = 0; - sprite->b29 = 0; + sprite->speed = 0; + sprite->walkFrame = 0; } -void DreamGenContext::mainman() { +void DreamGenContext::mainMan() { assert(false); } -void DreamGenContext::mainman(Sprite *sprite) { +void DreamGenContext::mainMan(Sprite *sprite) { push(es); push(ds); @@ -137,48 +137,48 @@ void DreamGenContext::mainman(Sprite *sprite) { data.byte(kResetmanxy) = 0; sprite->x = data.byte(kRyanx); sprite->y = data.byte(kRyany); - sprite->b29 = 0; + sprite->walkFrame = 0; } - --sprite->b22; - if (sprite->b22 != 0xff) { + --sprite->speed; + if (sprite->speed != 0xff) { ds = pop(); es = pop(); return; } - sprite->b22 = 0; + sprite->speed = 0; if (data.byte(kTurntoface) != data.byte(kFacing)) { - aboutturn(sprite); + aboutTurn(sprite); } else { if ((data.byte(kTurndirection) != 0) && (data.byte(kLinepointer) == 254)) { data.byte(kReasseschanges) = 1; if (data.byte(kFacing) == data.byte(kLeavedirection)) - checkforexit(); + checkForExit(); } data.byte(kTurndirection) = 0; if (data.byte(kLinepointer) == 254) { - sprite->b29 = 0; + sprite->walkFrame = 0; } else { - ++sprite->b29; - if (sprite->b29 == 11) - sprite->b29 = 1; + ++sprite->walkFrame; + if (sprite->walkFrame == 11) + sprite->walkFrame = 1; walking(sprite); if (data.byte(kLinepointer) != 254) { if ((data.byte(kFacing) & 1) == 0) walking(sprite); - else if ((sprite->b29 != 2) && (sprite->b29 != 7)) + else if ((sprite->walkFrame != 2) && (sprite->walkFrame != 7)) walking(sprite); } if (data.byte(kLinepointer) == 254) { if (data.byte(kTurntoface) == data.byte(kFacing)) { data.byte(kReasseschanges) = 1; if (data.byte(kFacing) == data.byte(kLeavedirection)) - checkforexit(); + checkForExit(); } } } } static const uint8 facelist[] = { 0,60,33,71,11,82,22,93 }; - sprite->b15 = sprite->b29 + facelist[data.byte(kFacing)]; + sprite->frameNumber = sprite->walkFrame + facelist[data.byte(kFacing)]; data.byte(kRyanx) = sprite->x; data.byte(kRyany) = sprite->y; @@ -196,26 +196,26 @@ void DreamGenContext::walking(Sprite *sprite) { comp = data.byte(kLinelength); } if (data.byte(kLinepointer) < comp) { - sprite->x = data.byte(kLinedata + data.byte(kLinepointer) * 2 + 0); - sprite->y = data.byte(kLinedata + data.byte(kLinepointer) * 2 + 1); + sprite->x = (uint8)_lineData[data.byte(kLinepointer)].x; + sprite->y = (uint8)_lineData[data.byte(kLinepointer)].y; return; } data.byte(kLinepointer) = 254; data.byte(kManspath) = data.byte(kDestination); if (data.byte(kDestination) == data.byte(kFinaldest)) { - facerightway(); + faceRightWay(); return; } data.byte(kDestination) = data.byte(kFinaldest); push(es); push(bx); - autosetwalk(); + autoSetWalk(); bx = pop(); es = pop(); } -void DreamGenContext::aboutturn(Sprite *sprite) { +void DreamGenContext::aboutTurn(Sprite *sprite) { bool incdir = true; if (data.byte(kTurndirection) == 1) @@ -241,20 +241,20 @@ void DreamGenContext::aboutturn(Sprite *sprite) { if (incdir) { data.byte(kTurndirection) = 1; data.byte(kFacing) = (data.byte(kFacing) + 1) & 7; - sprite->b29 = 0; + sprite->walkFrame = 0; } else { - data.byte(kTurndirection) = -1; + data.byte(kTurndirection) = (uint8)-1; data.byte(kFacing) = (data.byte(kFacing) - 1) & 7; - sprite->b29 = 0; + sprite->walkFrame = 0; } } -void DreamGenContext::backobject() { +void DreamGenContext::backObject() { assert(false); } -void DreamGenContext::backobject(Sprite *sprite) { - SetObject *objData = (SetObject *)segRef(data.word(kSetdat)).ptr(sprite->objData(), 0); +void DreamGenContext::backObject(Sprite *sprite) { + SetObject *objData = (SetObject *)getSegment(data.word(kSetdat)).ptr(sprite->objData(), 0); if (sprite->delay != 0) { --sprite->delay; @@ -263,13 +263,13 @@ void DreamGenContext::backobject(Sprite *sprite) { sprite->delay = objData->delay; if (objData->type == 6) - widedoor(sprite, objData); + wideDoor(sprite, objData); else if (objData->type == 5) - random(sprite, objData); + randomSprite(sprite, objData); else if (objData->type == 4) - lockeddoorway(sprite, objData); + lockedDoorway(sprite, objData); else if (objData->type == 3) - liftsprite(sprite, objData); + liftSprite(sprite, objData); else if (objData->type == 2) doorway(sprite, objData); else if (objData->type == 1) @@ -279,563 +279,277 @@ void DreamGenContext::backobject(Sprite *sprite) { } void DreamGenContext::constant(Sprite *sprite, SetObject *objData) { - ++sprite->frame; - if (objData->b18[sprite->frame] == 255) { - sprite->frame = 0; + ++sprite->animFrame; + if (objData->frames[sprite->animFrame] == 255) { + sprite->animFrame = 0; } - uint8 b18 = objData->b18[sprite->frame]; - objData->index = b18; - sprite->b15 = b18; + uint8 frame = objData->frames[sprite->animFrame]; + objData->index = frame; + sprite->frameNumber = frame; } -void DreamGenContext::random(Sprite *sprite, SetObject *objData) { - randomnum1(); - uint16 r = ax; - sprite->b15 = objData->b18[r&7]; +void DreamGenContext::randomSprite(Sprite *sprite, SetObject *objData) { + uint8 r = engine->randomNumber(); + sprite->frameNumber = objData->frames[r&7]; } void DreamGenContext::doorway(Sprite *sprite, SetObject *objData) { - data.byte(kDoorcheck1) = -24; - data.byte(kDoorcheck2) = 10; - data.byte(kDoorcheck3) = -30; - data.byte(kDoorcheck4) = 10; - dodoor(sprite, objData); + Common::Rect check(-24, -30, 10, 10); + doDoor(sprite, objData, check); } -void DreamGenContext::widedoor(Sprite *sprite, SetObject *objData) { - data.byte(kDoorcheck1) = -24; - data.byte(kDoorcheck2) = 24; - data.byte(kDoorcheck3) = -30; - data.byte(kDoorcheck4) = 24; - dodoor(sprite, objData); +void DreamGenContext::wideDoor(Sprite *sprite, SetObject *objData) { + Common::Rect check(-24, -30, 24, 24); + doDoor(sprite, objData, check); } -void DreamGenContext::dodoor() { - Sprite *sprite = (Sprite *)es.ptr(bx, sizeof(Sprite)); - SetObject *objData = (SetObject *)ds.ptr(di, 0); - dodoor(sprite, objData); -} +void DreamGenContext::doDoor(Sprite *sprite, SetObject *objData, Common::Rect check) { + int ryanx = data.byte(kRyanx); + int ryany = data.byte(kRyany); + + // Automatically opening doors: check if Ryan is in range + + check.translate(sprite->x, sprite->y); + bool openDoor = check.contains(ryanx, ryany); + + if (openDoor) { + + if ((data.byte(kThroughdoor) == 1) && (sprite->animFrame == 0)) + sprite->animFrame = 6; + + ++sprite->animFrame; + if (sprite->animFrame == 1) { // doorsound2 + uint8 soundIndex; + if (data.byte(kReallocation) == 5) // hoteldoor2 + soundIndex = 13; + else + soundIndex = 0; + playChannel1(soundIndex); + } + if (objData->frames[sprite->animFrame] == 255) + --sprite->animFrame; + + sprite->frameNumber = objData->index = objData->frames[sprite->animFrame]; + data.byte(kThroughdoor) = 1; -void DreamGenContext::dodoor(Sprite *sprite, SetObject *objData) { - uint8 ryanx = data.byte(kRyanx); - uint8 ryany = data.byte(kRyany); - if (ryanx < sprite->x) { - if (ryanx < sprite->x + (int8)data.byte(kDoorcheck1)) - goto shutdoor; - } else { - if (ryanx >= sprite->x + data.byte(kDoorcheck2)) - goto shutdoor; - } - if (ryany < sprite->y) { - if (ryany < sprite->y + (int8)data.byte(kDoorcheck3)) - goto shutdoor; } else { - if (ryany >= sprite->y + data.byte(kDoorcheck4)) - goto shutdoor; - } -//opendoor: - if ((data.byte(kThroughdoor) == 1) && (sprite->frame == 0)) - sprite->frame = 6; - - ++sprite->frame; - if (sprite->frame == 1) { //doorsound2 - if (data.byte(kReallocation) == 5) //hoteldoor2 - al = 13; - else - al = 0; - playchannel1(); - } - if (objData->b18[sprite->frame] == 255) { - --sprite->frame; - } - sprite->b15 = objData->index = objData->b18[sprite->frame]; - data.byte(kThroughdoor) = 1; - return; -shutdoor: - if (sprite->frame == 5) { //doorsound1; - if (data.byte(kReallocation) == 5) //hoteldoor1 - al = 13; - else - al = 1; - playchannel1(); - } - if (sprite->frame != 0) { - --sprite->frame; + // shut door + + if (sprite->animFrame == 5) { // doorsound1; + uint8 soundIndex; + if (data.byte(kReallocation) == 5) // hoteldoor1 + soundIndex = 13; + else + soundIndex = 1; + playChannel1(soundIndex); + } + if (sprite->animFrame != 0) + --sprite->animFrame; + + sprite->frameNumber = objData->index = objData->frames[sprite->animFrame]; + if (sprite->animFrame == 5) // nearly + data.byte(kThroughdoor) = 0; } - sprite->b15 = objData->index = objData->b18[sprite->frame]; - if (sprite->frame == 5) //nearly - data.byte(kThroughdoor) = 0; } void DreamGenContext::steady(Sprite *sprite, SetObject *objData) { - uint8 b18 = objData->b18[0]; - objData->index = b18; - sprite->b15 = b18; + uint8 frame = objData->frames[0]; + objData->index = frame; + sprite->frameNumber = frame; } -void DreamGenContext::lockeddoorway(Sprite *sprite, SetObject *objData) { - if (data.byte(kRyanx) < sprite->x) { - if (sprite->x - data.byte(kRyanx) > 24) - goto shutdoor2; - } else { - if (data.byte(kRyanx) - sprite->x >= 10) - goto shutdoor2; - } +void DreamGenContext::lockedDoorway(Sprite *sprite, SetObject *objData) { + int ryanx = data.byte(kRyanx); + int ryany = data.byte(kRyany); - if (data.byte(kRyany) < sprite->y) { - if (sprite->y - data.byte(kRyany) > 30) - goto shutdoor2; - } else { - if (data.byte(kRyany) - sprite->y >= 12) - goto shutdoor2; - } + Common::Rect check(-24, -30, 10, 12); + check.translate(sprite->x, sprite->y); + bool openDoor = check.contains(ryanx, ryany); - if (data.byte(kThroughdoor) != 1) { - if (data.byte(kLockstatus) == 1) - goto shutdoor2; - } + if (data.byte(kThroughdoor) != 1 && data.byte(kLockstatus) == 1) + openDoor = false; - if (sprite->frame == 1) { - al = 0; - playchannel1(); - } + if (openDoor) { - if (sprite->frame == 6) { - turnpathon(data.byte(kDoorpath)); - } + if (sprite->animFrame == 1) { + playChannel1(0); + } - if ((data.byte(kThroughdoor) == 1) && (sprite->frame == 0)) { - sprite->frame = 6; - } + if (sprite->animFrame == 6) + turnPathOn(data.byte(kDoorpath)); - ++sprite->frame; - if (objData->b18[sprite->frame] == 255) { - --sprite->frame; - } + if (data.byte(kThroughdoor) == 1 && sprite->animFrame == 0) + sprite->animFrame = 6; - sprite->b15 = objData->index = objData->b18[sprite->frame]; - if (sprite->frame == 5) - data.byte(kThroughdoor) = 1; - return; + ++sprite->animFrame; + if (objData->frames[sprite->animFrame] == 255) + --sprite->animFrame; -shutdoor2: - if (sprite->frame == 5) { - al = 1; - playchannel1(); - } + sprite->frameNumber = objData->index = objData->frames[sprite->animFrame]; + if (sprite->animFrame == 5) + data.byte(kThroughdoor) = 1; - if (sprite->frame != 0) { - --sprite->frame; - } + } else { + // shut door - data.byte(kThroughdoor) = 0; - sprite->b15 = objData->index = objData->b18[sprite->frame]; + if (sprite->animFrame == 5) { + playChannel1(1); + } - if (sprite->frame == 0) { - turnpathoff(data.byte(kDoorpath)); - data.byte(kLockstatus) = 1; + if (sprite->animFrame != 0) + --sprite->animFrame; + + data.byte(kThroughdoor) = 0; + sprite->frameNumber = objData->index = objData->frames[sprite->animFrame]; + + if (sprite->animFrame == 0) { + turnPathOff(data.byte(kDoorpath)); + data.byte(kLockstatus) = 1; + } } } -void DreamGenContext::liftsprite(Sprite *sprite, SetObject *objData) { +void DreamGenContext::liftSprite(Sprite *sprite, SetObject *objData) { uint8 liftFlag = data.byte(kLiftflag); if (liftFlag == 0) { //liftclosed - turnpathoff(data.byte(kLiftpath)); + turnPathOff(data.byte(kLiftpath)); if (data.byte(kCounttoopen) != 0) { _dec(data.byte(kCounttoopen)); if (data.byte(kCounttoopen) == 0) data.byte(kLiftflag) = 3; } - sprite->frame = 0; - sprite->b15 = objData->index = objData->b18[sprite->frame]; + sprite->animFrame = 0; + sprite->frameNumber = objData->index = objData->frames[sprite->animFrame]; } else if (liftFlag == 1) { //liftopen - turnpathon(data.byte(kLiftpath)); + turnPathOn(data.byte(kLiftpath)); if (data.byte(kCounttoclose) != 0) { _dec(data.byte(kCounttoclose)); if (data.byte(kCounttoclose) == 0) data.byte(kLiftflag) = 2; } - sprite->frame = 12; - sprite->b15 = objData->index = objData->b18[sprite->frame]; + sprite->animFrame = 12; + sprite->frameNumber = objData->index = objData->frames[sprite->animFrame]; } else if (liftFlag == 3) { //openlift - if (sprite->frame == 12) { + if (sprite->animFrame == 12) { data.byte(kLiftflag) = 1; return; } - ++sprite->frame; - if (sprite->frame == 1) { - al = 2; - liftnoise(); + ++sprite->animFrame; + if (sprite->animFrame == 1) { + liftNoise(2); } - sprite->b15 = objData->index = objData->b18[sprite->frame]; + sprite->frameNumber = objData->index = objData->frames[sprite->animFrame]; } else { //closeLift assert(liftFlag == 2); - if (sprite->frame == 0) { + if (sprite->animFrame == 0) { data.byte(kLiftflag) = 0; return; } - --sprite->frame; - if (sprite->frame == 11) { - al = 3; - liftnoise(); + --sprite->animFrame; + if (sprite->animFrame == 11) { + liftNoise(3); } - sprite->b15 = objData->index = objData->b18[sprite->frame]; + sprite->frameNumber = objData->index = objData->frames[sprite->animFrame]; } } -void DreamGenContext::facerightway() { - PathNode *paths = getroomspaths()->nodes; - uint8 dir = paths[data.byte(kManspath)].dir; - data.byte(kTurntoface) = dir; - data.byte(kLeavedirection) = dir; +Reel *DreamBase::getReelStart(uint16 reelPointer) { + Reel *reel = (Reel *)getSegment(data.word(kReels)).ptr(kReellist + reelPointer * sizeof(Reel) * 8, sizeof(Reel)); + return reel; } -void DreamGenContext::findsource() { - uint16 currentFrame = data.word(kCurrentframe); - if (currentFrame < 160) { - ds = data.word(kReel1); - data.word(kTakeoff) = 0; - } else if (currentFrame < 320) { - ds = data.word(kReel2); - data.word(kTakeoff) = 160; +// Locate the reel segment (reel1, reel2, reel3) this frame is stored in, +// and adjust the frame number relative to this segment. +const Frame *DreamBase::findSource(uint16 &frame) { + uint16 base; + if (frame < 160) { + base = data.word(kReel1); + } else if (frame < 320) { + frame -= 160; + base = data.word(kReel2); } else { - ds = data.word(kReel3); - data.word(kTakeoff) = 320; + frame -= 320; + base = data.word(kReel3); } + return (const Frame *)getSegment(base).ptr(0, (frame+1)*sizeof(Frame)); } -Frame *DreamGenContext::findsourceCPP() { - push(ds); - findsource(); - Frame *result = (Frame *)ds.ptr(0, 0); - ds = pop(); - return result; -} - -Reel *DreamGenContext::getreelstart() { - Reel *reel = (Reel *)segRef(data.word(kReels)).ptr(kReellist + data.word(kReelpointer) * sizeof(Reel) * 8, sizeof(Reel)); - return reel; -} - -void DreamGenContext::showreelframe() { - Reel *reel = (Reel *)es.ptr(si, sizeof(Reel)); - showreelframe(reel); -} - -void DreamGenContext::showreelframe(Reel *reel) { +void DreamBase::showReelFrame(Reel *reel) { uint16 x = reel->x + data.word(kMapadx); uint16 y = reel->y + data.word(kMapady); - data.word(kCurrentframe) = reel->frame(); - Frame *source = findsourceCPP(); - uint16 frame = data.word(kCurrentframe) - data.word(kTakeoff); - showframe(source, x, y, frame, 8); + uint16 frame = reel->frame(); + const Frame *base = findSource(frame); + showFrame(base, x, y, frame, 8); } -void DreamGenContext::showgamereel() { - showgamereel((ReelRoutine *)es.ptr(bx, sizeof(ReelRoutine))); +void DreamGenContext::showGameReel() { + showGameReel((ReelRoutine *)es.ptr(bx, sizeof(ReelRoutine))); } -void DreamGenContext::showgamereel(ReelRoutine *routine) { - uint16 reelpointer = routine->reelPointer(); - if (reelpointer >= 512) +void DreamGenContext::showGameReel(ReelRoutine *routine) { + uint16 reelPointer = routine->reelPointer(); + if (reelPointer >= 512) return; - data.word(kReelpointer) = reelpointer; - plotreel(); - routine->setReelPointer(data.word(kReelpointer)); + plotReel(reelPointer); + routine->setReelPointer(reelPointer); } -const Frame *DreamGenContext::getreelframeax(uint16 frame) { - data.word(kCurrentframe) = frame; - Frame *source = findsourceCPP(); - uint16 offset = data.word(kCurrentframe) - data.word(kTakeoff); - return source + offset; +const Frame *DreamBase::getReelFrameAX(uint16 frame) { + const Frame *base = findSource(frame); + return base + frame; } -void DreamGenContext::showrain() { - ds = data.word(kMainsprites); - si = 6*58; - ax = ds.word(si+2); - si = ax + 2080; - Rain *rain = (Rain *)segRef(data.word(kBuffers)).ptr(kRainlist, 0); +void DreamGenContext::showRain() { + Rain *rain = (Rain *)getSegment(data.word(kBuffers)).ptr(kRainlist, 0); + + // Do nothing if there's no rain at all if (rain->x == 255) return; - while (true) { - if (rain->x == 255) { - if (data.word(kCh1blockstocopy) != 0) - return; - if ((data.byte(kReallocation) == 2) && (data.byte(kBeenmugged) != 1)) - return; - if (data.byte(kReallocation) == 55) - return; - randomnum1(); - if (al >= 1) - return; - if (data.byte(kCh0playing) != 6) - al = 4; - else - al = 7; - playchannel1(); - return; - } + + ds = data.word(kMainsprites); + si = 6*58; // Frame 58 + ax = ds.word(si+2); // Frame::ptr + si = ax + 2080; + + for (; rain->x != 255; ++rain) { uint16 y = rain->y + data.word(kMapady) + data.word(kMapystart); uint16 x = rain->x + data.word(kMapadx) + data.word(kMapxstart); uint16 size = rain->size; ax = ((uint16)(rain->w3() - rain->b5)) & 511; rain->setW3(ax); - ++rain; const uint8 *src = ds.ptr(si, 0) + ax; uint8 *dst = workspace() + y * 320 + x; - for(uint16 i = 0; i < size; ++i) { + for (uint16 i = 0; i < size; ++i) { uint8 v = src[i]; if (v != 0) *dst = v; - dst += 320-1; + dst += 320-1; // advance diagonally } } -} -void DreamGenContext::updatepeople() { - data.word(kListpos) = kPeoplelist; - memset(segRef(data.word(kBuffers)).ptr(kPeoplelist, 12 * sizeof(People)), 0xff, 12 * sizeof(People)); - ++data.word(kMaintimer); - es = cs; - bx = kReelroutines; - const ReelRoutine *reelRoutine = (const ReelRoutine *)cs.ptr(bx, 0); - const uint16 *callbacks = (const uint16 *)cs.ptr(kReelcalls, 0); - while (true) { - uint8 realLocation = reelRoutine->reallocation; - if (realLocation == 255) - return; - if ((realLocation == data.byte(kReallocation)) && - (reelRoutine->mapX == data.byte(kMapx)) && - (reelRoutine->mapY == data.byte(kMapy))) { - uint16 callback = READ_LE_UINT16(callbacks); - //dw gamer,sparkydrip,eden,edeninbath,sparky,smokebloke - if (callback == addr_gamer) - gamer(); - else if (callback == addr_sparkydrip) - sparkydrip(); - else if (callback == addr_eden) - eden(); - else if (callback == addr_edeninbath) - edeninbath(); - else if (callback == addr_sparky) - sparky(); - else if (callback == addr_smokebloke) - smokebloke(); - //dw manasleep,drunk,receptionist,malefan,femalefan - else if (callback == addr_manasleep) - manasleep(); - else if (callback == addr_drunk) - drunk(); - else if (callback == addr_receptionist) - receptionist(); - else if (callback == addr_malefan) - malefan(); - else if (callback == addr_femalefan) - femalefan(); - //dw louis,louischair,soldier1,bossman,interviewer - else if (callback == addr_louis) - louis(); - else if (callback == addr_louischair) - louischair(); - else if (callback == addr_soldier1) - soldier1(); - else if (callback == addr_bossman) - bossman(); - else if (callback == addr_interviewer) - interviewer(); - //dw heavy,manasleep2,mansatstill,drinker,bartender - else if (callback == addr_heavy) - heavy(); - else if (callback == addr_manasleep2) - manasleep2(); - else if (callback == addr_mansatstill) - mansatstill(); - else if (callback == addr_drinker) - drinker(); - else if (callback == addr_bartender) - bartender(); - //dw othersmoker,tattooman,attendant,keeper,candles1 - else if (callback == addr_othersmoker) - othersmoker(); - else if (callback == addr_tattooman) - tattooman(); - else if (callback == addr_attendant) - attendant(); - else if (callback == addr_keeper) - keeper(); - else if (callback == addr_candles1) - candles1(); - //dw smallcandle,security,copper,poolguard,rockstar - else if (callback == addr_smallcandle) - smallcandle(); - else if (callback == addr_security) - security(); - else if (callback == addr_copper) - copper(); - else if (callback == addr_poolguard) - poolguard(); - else if (callback == addr_rockstar) - rockstar(); - //dw businessman,train,aide,mugger,helicopter - else if (callback == addr_businessman) - businessman(); - else if (callback == addr_train) - train(); - else if (callback == addr_aide) - aide(); - else if (callback == addr_mugger) - mugger(); - else if (callback == addr_helicopter) - helicopter(); - //dw intromagic1,intromusic,intromagic2,candles2,gates - else if (callback == addr_intromagic1) - intromagic1(); - else if (callback == addr_intromusic) - intromusic(); - else if (callback == addr_intromagic2) - intromagic2(); - else if (callback == addr_candles2) - candles2(); - else if (callback == addr_gates) - gates(); - //dw intromagic3,intromonks1,candles,intromonks2 - else if (callback == addr_intromagic3) - intromagic3(); - else if (callback == addr_intromonks1) - intromonks1(); - else if (callback == addr_candles) - candles(); - else if (callback == addr_intromonks2) - intromonks2(); - //dw handclap,monkandryan,endgameseq,priest,madman - else if (callback == addr_handclap) - handclap(); - else if (callback == addr_monkandryan) - monkandryan(); - else if (callback == addr_endgameseq) - endgameseq(); - else if (callback == addr_priest) - priest(); - else if (callback == addr_madman) - madman(); - //dw madmanstelly,alleybarksound,foghornsound - else if (callback == addr_madmanstelly) - madmanstelly(); - else if (callback == addr_alleybarksound) - alleybarksound(); - else if (callback == addr_foghornsound) - foghornsound(); - //dw carparkdrip,carparkdrip,carparkdrip,carparkdrip - else if (callback == addr_carparkdrip) - carparkdrip(); - else - assert(false); // Oops I forgot something in the dispatch table - } - bx += 8; - ++reelRoutine; - ++callbacks; - } -} - -void DreamGenContext::madmantext() { - if (isCD()) { - if (data.byte(kSpeechcount) >= 63) - return; - if (data.byte(kCh1playing) != 255) - return; - al = data.byte(kSpeechcount); - ++data.byte(kSpeechcount); - } else { - if (data.byte(kCombatcount) >= 61) - return; - al = data.byte(kCombatcount); - _and(al, 3); - if (!flags.z()) - return; - al = data.byte(kCombatcount) / 4; - } - setuptimedtemp(47 + al, 82, 72, 80, 90, 1); -} - -void DreamGenContext::madman() { - data.word(kWatchingtime) = 2; - checkspeed(); - if (flags.z()) { - ax = es.word(bx+3); - if (ax >= 364) { - data.byte(kMandead) = 2; - showgamereel(); - return; - } - if (ax == 10) { - push(es); - push(bx); - push(ax); - dx = kIntrotextname; - loadtemptext(); - ax = pop(); - bx = pop(); - es = pop(); - data.byte(kCombatcount) = -1; - data.byte(kSpeechcount) = 0; - } - ++ax; - if (ax == 294) { - if (data.byte(kWongame) == 1) - return; - data.byte(kWongame) = 1; - push(es); - push(bx); - getridoftemptext(); - bx = pop(); - es = pop(); - return; - } - if (ax == 66) { - ++data.byte(kCombatcount); - push(es); - push(bx); - madmantext(); - bx = pop(); - es = pop(); - ax = 53; - if (data.byte(kCombatcount) >= (isCD() ? 64 : 62)) { - if (data.byte(kCombatcount) == (isCD() ? 70 : 68)) - ax = 310; - else { - if (data.byte(kLastweapon) == 8) { - data.byte(kCombatcount) = isCD() ? 72 : 70; - data.byte(kLastweapon) = -1; - data.byte(kMadmanflag) = 1; - ax = 67; - } - } - } - } - es.word(bx+3) = ax; - } - showgamereel(); - es.byte(bx+1) = data.byte(kMapx); - madmode(); -} - -void DreamGenContext::madmode() { - data.word(kWatchingtime) = 2; - data.byte(kPointermode) = 0; - if (data.byte(kCombatcount) < (isCD() ? 65 : 63)) + if (data.word(kCh1blockstocopy) != 0) + return; + if (data.byte(kReallocation) == 2 && data.byte(kBeenmugged) != 1) return; - if (data.byte(kCombatcount) >= (isCD() ? 70 : 68)) + if (data.byte(kReallocation) == 55) return; - data.byte(kPointermode) = 2; + + if (engine->randomNumber() >= 1) // play thunder with 1 in 256 chance + return; + + uint8 soundIndex; + if (data.byte(kCh0playing) != 6) + soundIndex = 4; + else + soundIndex = 7; + playChannel1(soundIndex); } -void DreamGenContext::movemap(uint8 param) { +void DreamGenContext::moveMap(uint8 param) { switch (param) { case 32: data.byte(kMapy) -= 20; @@ -856,9 +570,9 @@ void DreamGenContext::movemap(uint8 param) { data.byte(kNowinnewroom) = 1; } -void DreamGenContext::checkone() { +void DreamGenContext::checkOne() { uint8 flag, flagEx, type, flagX, flagY; - checkone(cl, ch, &flag, &flagEx, &type, &flagX, &flagY); + checkOne(cl, ch, &flag, &flagEx, &type, &flagX, &flagY); cl = flag; ch = flagEx; @@ -867,41 +581,658 @@ void DreamGenContext::checkone() { al = type; } -void DreamGenContext::checkone(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uint8 *type, uint8 *flagX, uint8 *flagY) { +void DreamGenContext::checkOne(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uint8 *type, uint8 *flagX, uint8 *flagY) { *flagX = x / 16; *flagY = y / 16; - const uint8 *tileData = segRef(data.word(kBuffers)).ptr(kMapflags + (*flagY * 11 + *flagX) * 3, 3); + const uint8 *tileData = getSegment(data.word(kBuffers)).ptr(kMapflags + (*flagY * 11 + *flagX) * 3, 3); *flag = tileData[0]; *flagEx = tileData[1]; *type = tileData[2]; } -void DreamGenContext::getblockofpixel() { - al = getblockofpixel(cl, ch); +void DreamGenContext::getBlockOfPixel() { + al = getBlockOfPixel(cl, ch); } -uint8 DreamGenContext::getblockofpixel(uint8 x, uint8 y) { +uint8 DreamGenContext::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); + checkOne(x + data.word(kMapxstart), y + data.word(kMapystart), &flag, &flagEx, &type, &flagX, &flagY); if (flag & 1) return 0; else return type; } -void DreamGenContext::addtopeoplelist() { - addtopeoplelist((ReelRoutine *)es.ptr(bx, sizeof(ReelRoutine))); +Rain *DreamGenContext::splitIntoLines(uint8 x, uint8 y, Rain *rain) { + do { + // Look for line start + while (!getBlockOfPixel(x, y)) { + --x; + ++y; + if (x == 0 || y >= data.byte(kMapysize)) + return rain; + } + + rain->x = x; + rain->y = y; + + uint8 length = 1; + + // Look for line end + while (getBlockOfPixel(x, y)) { + --x; + ++y; + if (x == 0 || y >= data.byte(kMapysize)) + break; + ++length; + } + + rain->size = length; + rain->w3_lo = engine->randomNumber(); + rain->w3_hi = engine->randomNumber(); + rain->b5 = (engine->randomNumber() & 3) + 4; + ++rain; + } while (x > 0 && y < data.byte(kMapysize)); + + return rain; +} + +struct RainLocation { + uint8 location; + uint8 x, y; + uint8 rainSpacing; +}; + +static const RainLocation rainLocationList[] = { + { 1,44,10,16 }, + { 4,11,30,14 }, + { 4,22,30,14 }, + { 3,33,10,14 }, + { 10,33,30,14 }, + { 10,22,30,24 }, + { 9,22,10,14 }, + { 2,33,0,14 }, + { 2,22,0,14 }, + { 6,11,30,14 }, + { 7,11,20,18 }, + { 7,0,20,18 }, + { 7,0,30,18 }, + { 55,44,0,14 }, + { 5,22,30,14 }, + + { 8,0,10,18 }, + { 8,11,10,18 }, + { 8,22,10,18 }, + { 8,33,10,18 }, + { 8,33,20,18 }, + { 8,33,30,18 }, + { 8,33,40,18 }, + { 8,22,40,18 }, + { 8,11,40,18 }, + + { 21,44,20,18 }, + { 255,0,0,0 } +}; + +void DreamGenContext::initRain() { + const RainLocation *r = rainLocationList; + Rain *rainList = (Rain *)getSegment(data.word(kBuffers)).ptr(kRainlist, 0); + Rain *rain = rainList; + + uint8 rainSpacing = 0; + + // look up location in rainLocationList to determine rainSpacing + for (r = rainLocationList; r->location != 0xff; ++r) { + if (r->location == data.byte(kReallocation) && + r->x == data.byte(kMapx) && r->y == data.byte(kMapy)) { + rainSpacing = r->rainSpacing; + break; + } + } + + if (rainSpacing == 0) { + // location not found in rainLocationList: no rain + rain->x = 0xff; + return; + } + + // start lines of rain from top of screen + uint8 x = 4; + do { + uint8 delta; + do { + delta = (engine->randomNumber() & 31) + 3; + } while (delta >= rainSpacing); + + x += delta; + if (x >= data.byte(kMapxsize)) + break; + + rain = splitIntoLines(x, 0, rain); + } while (true); + + // start lines of rain from side of screen + uint8 y = 0; + do { + uint8 delta; + do { + delta = (engine->randomNumber() & 31) + 3; + } while (delta >= rainSpacing); + + y += delta; + if (y >= data.byte(kMapysize)) + break; + + rain = splitIntoLines(data.byte(kMapxsize) - 1, y, rain); + } while (true); + + rain->x = 0xff; +} + +void DreamGenContext::intro1Text() { + if (data.byte(kIntrocount) != 2 && data.byte(kIntrocount) != 4 && data.byte(kIntrocount) != 6) + return; + + if (isCD() && data.byte(kCh1playing) != 255) { + data.byte(kIntrocount)--; + } else { + if (data.byte(kIntrocount) == 2) + setupTimedTemp(40, 82, 34, 130, 90, 1); + else if (data.byte(kIntrocount) == 4) + setupTimedTemp(41, 82, 34, 130, 90, 1); + else if (data.byte(kIntrocount) == 6) + setupTimedTemp(42, 82, 34, 130, 90, 1); + } +} + +void DreamGenContext::intro2Text() { + if (ax == 5) + setupTimedTemp(43, 82, 34, 40, 90, 1); + else if (ax == 15) + setupTimedTemp(44, 82, 34, 40, 90, 1); +} + +void DreamGenContext::intro3Text() { + if (ax == 107) + setupTimedTemp(45, 82, 36, 56, 100, 1); + else if (ax == (isCD() ? 108 : 109)) + setupTimedTemp(46, 82, 36, 56, 100, 1); +} + +void DreamBase::rollEndCredits() { + playChannel0(16, 255); + data.byte(kVolume) = 7; + data.byte(kVolumeto) = 0; + data.byte(kVolumedirection) = 0xFF; + + multiGet(mapStore(), 75, 20, 160, 160); + + const uint8 *string = getTextInFile1(3); + const int linespacing = data.word(kLinespacing); + + for (int i = 0; i < 254; ++i) { + // Output the text, initially with an offset of 10 pixels, + // then move it up one pixel until we shifted it by a complete + // line of text. + for (int j = 0; j < linespacing; ++j) { + vSync(); + multiPut(mapStore(), 75, 20, 160, 160); + vSync(); + + // Output up to 18 lines of text + uint16 y = 10 - j; + const uint8 *tmp_str = string; + for (int k = 0; k < 18; ++k) { + DreamBase::printDirect(&tmp_str, 75, &y, 160 + 1, true); + y += linespacing; + } + + vSync(); + multiDump(75, 20, 160, 160); + } + + // Skip to the next text line + byte c; + do { + c = *string++; + } while (c != ':' && c != 0); + } + hangOn(100); + panelToMap(); + fadeScreenUpHalf(); +} + + +void DreamGenContext::monks2text() { + bool isGermanCD = isCD() && engine->getLanguage() == Common::DE_DEU; + + if (data.byte(kIntrocount) == 1) + setupTimedTemp(8, 82, 36, 160, 120, 1); + else if (data.byte(kIntrocount) == (isGermanCD ? 5 : 4)) + setupTimedTemp(9, 82, 36, 160, 120, 1); + else if (data.byte(kIntrocount) == (isGermanCD ? 9 : 7)) + setupTimedTemp(10, 82, 36, 160, 120, 1); + else if (data.byte(kIntrocount) == 10 && !isGermanCD) { + if (isCD()) + data.byte(kIntrocount) = 12; + setupTimedTemp(11, 82, 0, 105, 120, 1); + } else if (data.byte(kIntrocount) == 13 && isGermanCD) { + data.byte(kIntrocount) = 14; + setupTimedTemp(11, 82, 0, 105, 120, 1); + } else if (data.byte(kIntrocount) == 13 && !isGermanCD) { + if (isCD()) + data.byte(kIntrocount) = 17; + else + setupTimedTemp(12, 82, 0, 120, 120, 1); + } else if (data.byte(kIntrocount) == 16 && !isGermanCD) + setupTimedTemp(13, 82, 0, 135, 120, 1); + else if (data.byte(kIntrocount) == 19) + setupTimedTemp(14, 82, 36, 160, 100, 1); + else if (data.byte(kIntrocount) == (isGermanCD ? 23 : 22)) + setupTimedTemp(15, 82, 36, 160, 120, 1); + else if (data.byte(kIntrocount) == (isGermanCD ? 27 : 25)) + setupTimedTemp(16, 82, 36, 160, 120, 1); + else if (data.byte(kIntrocount) == (isCD() ? 27 : 28) && !isGermanCD) + setupTimedTemp(17, 82, 36, 160, 120, 1); + else if (data.byte(kIntrocount) == 30 && isGermanCD) + setupTimedTemp(17, 82, 36, 160, 120, 1); + else if (data.byte(kIntrocount) == (isGermanCD ? 35 : 31)) + setupTimedTemp(18, 82, 36, 160, 120, 1); +} + +void DreamGenContext::textForEnd() { + if (data.byte(kIntrocount) == 20) + setupTimedTemp(0, 83, 34, 20, 60, 1); + else if (data.byte(kIntrocount) == (isCD() ? 50 : 65)) + setupTimedTemp(1, 83, 34, 20, 60, 1); + else if (data.byte(kIntrocount) == (isCD() ? 85 : 110)) + setupTimedTemp(2, 83, 34, 20, 60, 1); } -void DreamGenContext::addtopeoplelist(ReelRoutine *routine) { - uint16 routinePointer = (const uint8 *)routine - cs.ptr(0, 0); +void DreamGenContext::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); +} - People *people = (People *)segRef(data.word(kBuffers)).ptr(data.word(kListpos), sizeof(People)); - people->setReelPointer(routine->reelPointer()); - people->setRoutinePointer(routinePointer); - people->b4 = routine->b7; - data.word(kListpos) += sizeof(People); +void DreamGenContext::textForMonk() { + if (data.byte(kIntrocount) == 1) + textForMonkHelper(19, 82, 68, 154, 120, 1); + else if (data.byte(kIntrocount) == 5) + textForMonkHelper(20, 82, 68, 38, 120, 1); + else if (data.byte(kIntrocount) == 9) + textForMonkHelper(21, 82, 48, 154, 120, 1); + else if (data.byte(kIntrocount) == 13) + textForMonkHelper(22, 82, 68, 38, 120, 1); + else if (data.byte(kIntrocount) == (isCD() ? 15 : 17)) + textForMonkHelper(23, 82, 68, 154, 120, 1); + else if (data.byte(kIntrocount) == 21) + textForMonkHelper(24, 82, 68, 38, 120, 1); + else if (data.byte(kIntrocount) == 25) + textForMonkHelper(25, 82, 68, 154, 120, 1); + else if (data.byte(kIntrocount) == 29) + textForMonkHelper(26, 82, 68, 38, 120, 1); + else if (data.byte(kIntrocount) == 33) + textForMonkHelper(27, 82, 68, 154, 120, 1); + else if (data.byte(kIntrocount) == 37) + textForMonkHelper(28, 82, 68, 154, 120, 1); + else if (data.byte(kIntrocount) == 41) + textForMonkHelper(29, 82, 68, 38, 120, 1); + else if (data.byte(kIntrocount) == 45) + textForMonkHelper(30, 82, 68, 154, 120, 1); + else if (data.byte(kIntrocount) == (isCD() ? 52 : 49)) + textForMonkHelper(31, 82, 68, 154, 220, 1); + else if (data.byte(kIntrocount) == 53) { + fadeScreenDowns(); + if (isCD()) { + data.byte(kVolumeto) = 7; + data.byte(kVolumedirection) = 1; + } + } } -} /*namespace dreamgen */ +void DreamGenContext::reelsOnScreen() { + reconstruct(); + updatePeople(); + watchReel(); + showRain(); + useTimedText(); +} + +void DreamGenContext::reconstruct() { + if (data.byte(kHavedoneobs) == 0) + return; + data.byte(kNewobs) = 1; + drawFloor(); + spriteUpdate(); + printSprites(); + if ((data.byte(kForeignrelease) != 0) && (data.byte(kReallocation) == 20)) + underTextLine(); + data.byte(kHavedoneobs) = 0; +} + + + +struct ReelSound { + uint8 _sample; + uint16 _reelPointer; +}; + +static const ReelSound g_roomSound0[] = { + { 255,0 } +}; + +static const ReelSound g_roomSound1[] = { + { 15, 257 }, + { 255,0 } +}; + +static const ReelSound g_roomSound2[] = { + { 12, 5 }, + { 13, 21 }, + { 15, 35 }, // hitting floor? + { 17, 50 }, + { 18, 103 }, + { 19, 108 }, + { 255,0 } +}; + +static const ReelSound g_roomSound6[] = { + { 18, 19 }, + { 19, 23 }, + { 255,0 } +}; +static const ReelSound g_roomSound8[] = { + + { 12, 51 }, + { 13, 53 }, + { 14, 14 }, + { 15, 20 }, + { 0, 78 }, + { 255,0 } +}; +static const ReelSound g_roomSound9[] = { + + { 12, 119 }, + { 12, 145 }, + { 255,0 } +}; + +static const ReelSound g_roomSound10[] = { + { 13, 16 }, + { 255,0 } +}; + +static const ReelSound g_roomSound11[] = { + { 13, 20 }, + { 255,0 } +}; + +static const ReelSound g_roomSound12[] = { + { 14, 16 }, + { 255,0 } +}; + +static const ReelSound g_roomSound13[] = { + { 15, 4 }, + { 16, 8 }, + { 17, 134 }, + { 18, 153 }, + { 255,0 } +}; + +static const ReelSound g_roomSound14[] = { + { 13, 108 }, + { 15, 326 }, + { 15, 331 }, + { 15, 336 }, + { 15, 342 }, + { 15, 348 }, + { 15, 354 }, + { 18, 159 }, + { 18, 178 }, + { 19+128, 217 }, + { 20+64, 228 }, + { 255,0 } +}; + +static const ReelSound g_roomSound20[] = { + { 13, 20 }, + { 13, 21 }, + { 15, 34 }, + { 13, 52 }, + { 13, 55 }, + { 25, 57 }, + { 21, 73 }, + { 255,0 } +}; + +static const ReelSound g_roomSound22[] = { + { 13, 196 }, + { 13, 234 }, + { 13, 156 }, + { 14, 129 }, + { 13, 124 }, + { 15, 162 }, + { 15, 200 }, + { 15, 239 }, + { 17, 99 }, + { 12, 52 }, + { 255,0 } +}; + +static const ReelSound g_roomSound23[] = { + { 15, 56 }, + { 16, 64 }, + { 19, 22 }, + { 20, 33 }, + { 255,0 } +}; + +static const ReelSound g_roomSound25[] = { + { 20, 11 }, + { 20, 15 }, + { 15, 28 }, + { 13, 80 }, + { 21, 82 }, + { 19+128, 87 }, + { 23+64, 128 }, + { 255,0 } +}; + +static const ReelSound g_roomSound26[] = { + { 12, 13 }, + { 14, 39 }, + { 12, 67 }, + { 12, 75 }, + { 12, 83 }, + { 12, 91 }, + { 15, 102 }, // was 90, should be mine cart + { 255,0 } +}; + +static const ReelSound g_roomSound27[] = { + { 22, 36 }, + { 13, 125 }, + { 18, 88 }, + { 15, 107 }, + { 14, 127 }, + { 14, 154 }, + { 19+128, 170 }, + { 23+64, 232 }, + { 255,0 } +}; + +static const ReelSound g_roomSound28[] = { + { 21, 16 }, + { 21, 72 }, + { 21, 205 }, + { 22, 63 }, // 65 + { 23+128, 99 }, + { 24+64, 158 }, + { 255,0 } +}; + +static const ReelSound g_roomSound29[] = { + { 13, 21 }, + { 14, 24 }, + { 19+128, 50 }, + { 23+64, 75 }, + { 24, 128 }, + { 255,0 } +}; + +static const ReelSound g_roomSound29_German[] = { + { 13, 21 }, + { 14, 24 }, + { 19+128, 50 }, + { 23+64, 75 }, + { 255,0 } +}; + + +static const ReelSound g_roomSound45[] = { + { 19+64, 46 }, + { 16, 167 }, + { 255,0 } +}; + +static const ReelSound g_roomSound46[] = { + { 16, 19 }, + { 14, 36 }, + { 16, 50 }, + { 14, 65 }, + { 16, 81 }, + { 14, 96 }, + { 16, 114 }, + { 14, 129 }, + { 16, 147 }, + { 14, 162 }, + { 16, 177 }, + { 14, 191 }, + { 255,0 } +}; + +static const ReelSound g_roomSound47[] = { + { 13, 48 }, + { 14, 41 }, + { 15, 78 }, + { 16, 92 }, + { 255,0 } +}; + +static const ReelSound g_roomSound52[] = { + { 16, 115 }, + { 255,0 } +}; + +static const ReelSound g_roomSound53[] = { + { 21, 103 }, + { 20, 199 }, + { 255,0 } +}; + +static const ReelSound g_roomSound55[] = { + { 17, 53 }, + { 17, 54 }, + { 17, 55 }, + { 17, 56 }, + { 17, 57 }, + { 17, 58 }, + { 17, 59 }, + { 17, 61 }, + { 17, 63 }, + { 17, 64 }, + { 17, 65 }, + { 255,0 } +}; + +static const ReelSound *g_roomByRoom[] = { + g_roomSound0,g_roomSound1,g_roomSound2,g_roomSound0,g_roomSound0, + g_roomSound0,g_roomSound6,g_roomSound0,g_roomSound8,g_roomSound9, + g_roomSound10,g_roomSound11,g_roomSound12,g_roomSound13,g_roomSound14, + g_roomSound0,g_roomSound0,g_roomSound0,g_roomSound0,g_roomSound0, + g_roomSound20,g_roomSound0,g_roomSound22,g_roomSound23,g_roomSound0, + g_roomSound25,g_roomSound26,g_roomSound27,g_roomSound28,g_roomSound29, + g_roomSound0,g_roomSound0,g_roomSound0,g_roomSound0,g_roomSound0, + g_roomSound0,g_roomSound0,g_roomSound0,g_roomSound0,g_roomSound0, + g_roomSound0,g_roomSound0,g_roomSound0,g_roomSound0,g_roomSound0, + g_roomSound45,g_roomSound46,g_roomSound47,g_roomSound0,g_roomSound0, + g_roomSound0,g_roomSound0,g_roomSound52,g_roomSound53,g_roomSound0, + g_roomSound55 +}; + + +void DreamBase::soundOnReels(uint16 reelPointer) { + const ReelSound *r = g_roomByRoom[data.byte(kReallocation)]; + + if (engine->getLanguage() == Common::DE_DEU && r == g_roomSound29) + r = g_roomSound29_German; + + for (; r->_sample != 255; ++r) { + if (r->_reelPointer != reelPointer) + continue; + if (r->_reelPointer == data.word(kLastsoundreel)) + continue; + data.word(kLastsoundreel) = r->_reelPointer; + if (r->_sample < 64) { + playChannel1(r->_sample); + return; + } + if (r->_sample < 128) { + playChannel0(r->_sample & 63, 0); + return; + } + playChannel0(r->_sample & 63, 255); + } + + if (data.word(kLastsoundreel) != reelPointer) + data.word(kLastsoundreel) = (uint16)-1; +} + +void DreamGenContext::clearBeforeLoad() { + if (data.byte(kRoomloaded) != 1) + return /* (noclear) */; + + clearReels(); + + //clearRest + uint8 *dst = (uint8 *)getSegment(data.word(kMapdata)).ptr(0, 0); + memset(dst, 0, kMaplen); + deallocateMem(data.word(kBackdrop)); + deallocateMem(data.word(kSetframes)); + deallocateMem(data.word(kReels)); + deallocateMem(data.word(kPeople)); + deallocateMem(data.word(kSetdesc)); + deallocateMem(data.word(kBlockdesc)); + deallocateMem(data.word(kRoomdesc)); + deallocateMem(data.word(kFreeframes)); + deallocateMem(data.word(kFreedesc)); + + data.byte(kRoomloaded) = 0; +} + +void DreamGenContext::clearReels() { + deallocateMem(data.word(kReel1)); + deallocateMem(data.word(kReel2)); + deallocateMem(data.word(kReel3)); +} + +void DreamGenContext::getRidOfReels() { + if (data.byte(kRoomloaded) == 0) + return /* (dontgetrid) */; + + deallocateMem(data.word(kReel1)); + deallocateMem(data.word(kReel2)); + deallocateMem(data.word(kReel3)); +} + +void DreamGenContext::liftNoise(uint8 index) { + if (data.byte(kReallocation) == 5 || data.byte(kReallocation) == 21) + playChannel1(13); // hiss noise + else + playChannel1(index); +} +} // End of namespace DreamGen diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h index 0d7bbb6cbf..30962a272c 100644 --- a/engines/dreamweb/structs.h +++ b/engines/dreamweb/structs.h @@ -20,7 +20,13 @@ * */ +#ifndef DREAMWEB_STRUCTS_H +#define DREAMWEB_STRUCTS_H + #include "common/endian.h" +#include "common/rect.h" + +namespace DreamGen { struct Sprite { uint16 _updateCallback; @@ -36,37 +42,33 @@ struct Sprite { uint8 y; uint16 w12; uint8 b14; - uint8 b15; + uint8 frameNumber; uint8 b16; uint8 b17; uint8 delay; - uint8 frame; + uint8 animFrame; // index into SetObject::frames uint16 _objData; uint16 objData() const { return READ_LE_UINT16(&_objData); } void setObjData(uint16 v) { WRITE_LE_UINT16(&_objData, v); } - uint8 b22; + uint8 speed; uint8 priority; uint16 w24; uint16 w26; uint8 b28; - uint8 b29; + uint8 walkFrame; uint8 type; uint8 hidden; }; +class DreamGenContext; + struct RectWithCallback { uint16 _xMin, _xMax; uint16 _yMin, _yMax; - uint16 _callback; - - uint16 xMin() const { return READ_LE_UINT16(&_xMin); } - uint16 xMax() const { return READ_LE_UINT16(&_xMax); } - uint16 yMin() const { return READ_LE_UINT16(&_yMin); } - uint16 yMax() const { return READ_LE_UINT16(&_yMax); } - uint16 callback() const { return READ_LE_UINT16(&_callback); } + void (DreamGenContext::*_callback)(); bool contains(uint16 x, uint16 y) const { - return (x >= xMin()) && (x < xMax()) && (y >= yMin()) && (y < yMax()); + return (x >= _xMin) && (x < _xMax) && (y >= _yMin) && (y < _yMax); } }; @@ -86,7 +88,8 @@ struct SetObject { uint8 name[4]; uint8 b16; uint8 index; - uint8 b18[13]; // NB: Don't know the size yet + uint8 frames[13]; // Table mapping animFrame to sprite frame number + // NB: Don't know the size yet uint8 b31; uint8 b32; uint8 b33; @@ -136,6 +139,9 @@ struct ObjPos { uint8 xMax; uint8 yMax; uint8 index; + bool contains(uint8 x, uint8 y) const { + return (x >= xMin) && (x < xMax) && (y >= yMin) && (y < yMax); + } }; struct Frame { @@ -166,8 +172,9 @@ struct ReelRoutine { uint8 b4; uint16 reelPointer() const { return READ_LE_UINT16(&b3); } void setReelPointer(uint16 v) { WRITE_LE_UINT16(&b3, v); } - uint8 b5; - uint8 b6; + void incReelPointer() { setReelPointer(reelPointer() + 1); } + uint8 period; + uint8 counter; uint8 b7; }; @@ -185,10 +192,7 @@ struct People { }; struct Room { - uint8 name[10]; - uint8 b10; - uint8 b11; - uint8 b12; + char name[13]; uint8 roomsSample; uint8 b14; uint8 mapX; @@ -198,7 +202,7 @@ struct Room { uint8 b19; uint8 liftFlag; uint8 b21; - uint8 b22; + uint8 facing; uint8 countToOpen; uint8 liftPath; uint8 doorPath; @@ -207,8 +211,9 @@ struct Room { uint8 b28; uint8 b29; uint8 b30; - uint8 b31; + uint8 realLocation; }; +extern const Room g_roomData[]; struct Rain { uint8 x; @@ -249,3 +254,42 @@ struct RoomPaths { PathSegment segments[24]; }; +struct Sound { + uint8 w1_lo; + uint8 w1_hi; + uint16 offset() const { return READ_LE_UINT16(&w1_lo); } + void setOffset(uint16 v) { WRITE_LE_UINT16(&w1_lo, v); } + uint8 w3_lo; + uint8 w3_hi; + uint16 blockCount() const { return READ_LE_UINT16(&w3_lo); } + void setBlockCount(uint16 v) { WRITE_LE_UINT16(&w3_lo, v); } + uint8 b5; +}; + +struct FileHeader { + char _desc[50]; + uint16 _len[20]; + uint8 _padding[6]; + + uint16 len(unsigned int i) const { + assert(i < 20); + return READ_LE_UINT16(&_len[i]); + } + void setLen(unsigned int i, uint16 length) { + assert(i < 20); + WRITE_LE_UINT16(&_len[i], length); + } +}; + +struct Atmosphere { + uint8 _location; + uint8 _mapX; + uint8 _mapY; + uint8 _sound; + uint8 _repeat; +}; + +} // End of namespace DreamWeb + +#endif + diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index acba57ae87..162152ccda 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -26,26 +26,468 @@ namespace DreamGen { +// Keyboard buffer. data.word(kBufferin) and data.word(kBufferout) are indexes +// into this, making it a ring buffer +uint8 g_keyBuffer[16]; + +const Room g_roomData[] = { + { "DREAMWEB.R00", // Ryan's apartment + 5,255,33,10, + 255,255,255,0, + 1,6,2,255,3,255,255,255,255,255,0 }, + + { "DREAMWEB.R01", + 1,255,44,10, + 255,255,255,0, + 7,2,255,255,255,255,6,255,255,255,1 }, + + { "DREAMWEB.R02", + 2,255,33,0, + 255,255,255,0, + 1,0,255,255,1,255,3,255,255,255,2 }, + + { "DREAMWEB.R03", + 5,255,33,10, + 255,255,255,0, + 2,2,0,2,4,255,0,255,255,255,3 }, + + { "DREAMWEB.R04", + 23,255,11,30, + 255,255,255,0, + 1,4,0,5,255,255,3,255,255,255,4 }, + + { "DREAMWEB.R05", + 5,255,22,30, // if demo: 22,255,22,30, + 255,255,255,0, + 1,2,0,4,255,255,3,255,255,255,5 }, + + { "DREAMWEB.R06", + 5,255,11,30, + 255,255,255,0, + 1,0,0,1,2,255,0,255,255,255,6 }, + + { "DREAMWEB.R07", + 255,255,0,20, + 255,255,255,0, + 2,2,255,255,255,255,0,255,255,255,7 }, + + { "DREAMWEB.R08", + 8,255,0,10, + 255,255,255,0, + 1,2,255,255,255,255,0,11,40,0,8 }, + + { "DREAMWEB.R09", + 9,255,22,10, + 255,255,255,0, + 4,6,255,255,255,255,0,255,255,255,9 }, + + { "DREAMWEB.R10", + 10,255,33,30, + 255,255,255,0, + 2,0,255,255,2,2,4,22,30,255,10 }, // 22,30,0 switches + // off path 0 in skip + { "DREAMWEB.R11", + 11,255,11,20, + 255,255,255,0, + 0,4,255,255,255,255,255,255,255,255,11 }, + + { "DREAMWEB.R12", + 12,255,22,20, + 255,255,255,0, + 1,4,255,255,255,255,255,255,255,255,12 }, + + { "DREAMWEB.R13", + 12,255,22,20, + 255,255,255,0, + 1,4,255,255,255,255,255,255,255,255,13 }, + + { "DREAMWEB.R14", + 14,255,44,20, + 255,255,255,0, + 0,6,255,255,255,255,255,255,255,255,14 }, + + { "", 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, + { "", 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, + { "", 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, + { "", 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, + + { "DREAMWEB.R19", + 19,255,0,0, + 255,255,255,0, + 0,4,255,255,255,255,255,255,255,255,19 }, + + { "DREAMWEB.R20", + 22,255,0,20, + 255,255,255,0, + 1,4,2,15,255,255,255,255,255,255,20 }, + + { "DREAMWEB.R21", + 5,255,11,10, // if demo: 22,255,11,10, + 255,255,255,0, + 1,4,2,15,1,255,255,255,255,255,21 }, + + { "DREAMWEB.R22", + 22,255,22,10, + 255,255,255,0, + 0,4,255,255,1,255,255,255,255,255,22 }, + + { "DREAMWEB.R23", + 23,255,22,30, + 255,255,255,0, + 1,4,2,15,3,255,255,255,255,255,23 }, + + { "DREAMWEB.R24", + 5,255,44,0, + 255,255,255,0, + 1,6,2,15,255,255,255,255,255,255,24 }, + + { "DREAMWEB.R25", + 22,255,11,40, + 255,255,255,0, + 1,0,255,255,255,255,255,255,255,255,25 }, + + { "DREAMWEB.R26", + 9,255,22,20, + 255,255,255,0, + 4,2,255,255,255,255,255,255,255,255,26 }, + + { "DREAMWEB.R27", + 22,255,11,20, + 255,255,255,0, + 0,6,255,255,255,255,255,255,255,255,27 }, + + { "DREAMWEB.R28", + 5,255,11,30, + 255,255,255,0, + 0,0,255,255,2,255,255,255,255,255,28 }, + + { "DREAMWEB.R29", + 22,255,11,10, + 255,255,255,0, + 0,2,255,255,255,255,255,255,255,255,29 }, + + + + { "DREAMWEB.R05", // Duplicate of hotel lobby, but emerging from the lift. + 5,255,22,10, // if demo: 22,255,22,10 + 255,255,255,0, + 1,4,1,15,255,255,255,255,255,255,5 }, + + { "DREAMWEB.R04", // Duplicate of pool hall lobby, + 23,255,22,20, // but emerging from the lift. + 255,255,255,0, + 1,4,2,15,255,255,255,255,255,255,4 }, + + { "DREAMWEB.R10", // entering alley via skip + 10,255,22,30, + 255,255,255,0, + 3,6,255,255,255,255,255,255,255,255,10 }, + + { "DREAMWEB.R12", // on the beach, getting up. + 12,255,22,20, + 255,255,255,0, + 0,2,255,255,255,255,255,255,255,255,12 }, + + { "DREAMWEB.R03", // Duplicate of Eden's lobby + 5,255,44,0, // but emerging from the lift + 255,255,255,0, + 1,6,2,255,4,255,255,255,255,255,3 }, + + { "DREAMWEB.R24", // Duplicate of Eden's flat + 5,255,22,0, // but starting on the bed + 255,255,255,0, + 3,6,0,255,255,255,255,33,0,3,24 }, // 33,0,3 turns off path for lift + + { "DREAMWEB.R22", // Duplicate + 22,255,22,20, // of hotel but in pool room + 255,255,255,0, + 1,4,255,255,255,255,255,255,255,255,22 }, + + { "DREAMWEB.R22", // Duplicate + 22,255,22,20, // of hotel but in pool room + 255,255,255,0, // coming out of bedroom + 0,2,255,255,255,255,255,255,255,255,22 }, + + { "DREAMWEB.R11", // Duplicate + 11,255,22,30, // of carpark but getting + 255,255,255,0, // up off the floor + 0,0,255,255,255,255,255,255,255,255,11 }, + + { "DREAMWEB.R28", + 5,255,11,20, + 255,255,255,0, + 0,6,255,255,2,255,255,255,255,255,28 }, + + { "DREAMWEB.R21", + 5,255,11,10, // if demo: 22,255,11,10 + 255,255,255,0, + 1,4,2,15,1,255,255,255,255,255,21 }, + + { "DREAMWEB.R26", + 9,255,0,40, + 255,255,255,0, + 0,0,255,255,255,255,255,255,255,255,26 }, + + { "DREAMWEB.R19", + 19,255,0,0, + 255,255,255,0, + 2,2,255,255,255,255,255,255,255,255,19 }, + + { "DREAMWEB.R08", // leaving tvstudio into street + 8,255,11,40, + 255,255,255,0, + 0,4,255,255,255,255,255,255,255,255,8 }, + + { "DREAMWEB.R01", + 1,255,44,10, + 255,255,255,0, + 3,6,255,255,255,255,255,255,255,255,1 }, + + + { "DREAMWEB.R45", // Dream room + 35,255,22,30, + 255,255,255,0, + 0,6,255,255,255,255,255,255,255,255,45 }, + + { "DREAMWEB.R46", // Dream room + 35,255,22,40, + 255,255,255,0, + 0,4,255,255,255,255,255,255,255,255,46 }, + + { "DREAMWEB.R47", // Dream room + 35,255,0,0, + 255,255,255,0, + 0,0,255,255,255,255,255,255,255,255,47 }, + + { "DREAMWEB.R45", // Dream room + 35,255,22,30, + 255,255,255,0, + 4,0,255,255,255,255,255,255,255,255,45 }, + + { "DREAMWEB.R46", // Dream room + 35,255,22,50, + 255,255,255,0, + 0,4,255,255,255,255,255,255,255,255,46 }, + + + + { "DREAMWEB.R50", // Intro sequence one + 35,255,22,30, + 255,255,255,0, + 0,0,255,255,255,255,255,255,255,255,50 }, + + { "DREAMWEB.R51", // Intro sequence two + 35,255,11,30, + 255,255,255,0, + 0,0,255,255,255,255,255,255,255,255,51 }, + + { "DREAMWEB.R52", // Intro sequence three + 35,255,22,30, + 255,255,255,0, + 0,0,255,255,255,255,255,255,255,255,52 }, + + { "DREAMWEB.R53", // Intro sequence four + 35,255,33,0, + 255,255,255,0, + 0,0,255,255,255,255,255,255,255,255,53 }, + + { "DREAMWEB.R54", // Intro sequence five - wasteland + 35,255,0,0, + 255,255,255,0, + 0,0,255,255,255,255,255,255,255,255,54 }, + + { "DREAMWEB.R55", // End sequence + 14,255,44,0, + 255,255,255,0, + 0,0,255,255,255,255,255,255,255,255,55 } +}; + +static const Atmosphere g_atmosphereList[] = { + // location,map x,y,sound,repeat + { 0,33,10,15,255 }, + { 0,22,10,15,255 }, + { 0,22,0,15,255 }, + { 0,11,0,15,255 }, + { 0,11,10,15,255 }, + { 0,0,10,15,255 }, + + { 1,44,10,6,255 }, + { 1,44,0,13,255 }, + + { 2,33,0,6,255 }, + { 2,22,0,5,255 }, + { 2,22,10,16,255 }, + { 2,11,10,16,255 }, + + { 3,44,0,15,255 }, + { 3,33,10,6,255 }, + { 3,33,0,5,255 }, + + { 4,11,30,6,255 }, + { 4,22,30,5,255 }, + { 4,22,20,13,255 }, + + { 10,33,30,6,255 }, + { 10,22,30,6,255 }, + + { 9,22,10,6,255 }, + { 9,22,20,16,255 }, + { 9,22,30,16,255 }, + { 9,22,40,16,255 }, + { 9,22,50,16,255 }, + + { 6,11,30,6,255 }, + { 6,0,10,15,255 }, + { 6,0,20,15,255 }, + { 6,11,20,15,255 }, + { 6,22,20,15,255 }, + + { 7,11,20,6,255 }, + { 7,0,20,6,255 }, + { 7,0,30,6,255 }, + + { 55,44,0,5,255 }, + { 55,44,10,5,255 }, + + { 5,22,30,6,255 }, + { 5,22,20,15,255 }, // if demo: { 5,22,20,16,255 }, + { 5,22,10,15,255 }, // if demo: { 5,22,10,16,255 }, + + { 24,22,0,15,255 }, + { 24,33,0,15,255 }, + { 24,44,0,15,255 }, + { 24,33,10,15,255 }, + + { 8,0,10,6,255 }, + { 8,11,10,6,255 }, + { 8,22,10,6,255 }, + { 8,33,10,6,255 }, + { 8,33,20,6,255 }, + { 8,33,30,6,255 }, + { 8,33,40,6,255 }, + { 8,22,40,6,255 }, + { 8,11,40,6,255 }, + + { 11,11,20,12,255 }, + { 11,11,30,12,255 }, + { 11,22,20,12,255 }, + { 11,22,30,12,255 }, + + { 12,22,20,12,255 }, + { 13,22,20,12,255 }, + { 13,33,20,12,255 }, + + { 14,44,20,12,255 }, + { 14,33,0,12,255 }, + { 14,33,10,12,255 }, + { 14,33,20,12,255 }, + { 14,33,30,12,255 }, + { 14,33,40,12,255 }, + { 14,22,0,16,255 }, + + { 19,0,0,12,255 }, + + { 20,0,20,16,255 }, + { 20,0,30,16,255 }, + { 20,11,30,16,255 }, + { 20,0,40,16,255 }, + { 20,11,40,16,255 }, + + { 21,11,10,15,255 }, // if demo: { 21,11,10,16,255 }, + { 21,11,20,15,255 }, // if demo: { 21,11,20,16,255 }, + { 21, 0,20,15,255 }, // if demo: { 21,0,20,16,255 }, + { 21,22,20,15,255 }, // if demo: { 21,22,20,16,255 }, + { 21,33,20,15,255 }, // if demo: { 21,33,20,16,255 }, + { 21,44,20,15,255 }, // if demo: { 21,44,20,16,255 }, + { 21,44,10,15,255 }, // if demo: { 21,44,10,16,255 }, + + { 22,22,10,16,255 }, + { 22,22,20,16,255 }, + + { 23,22,30,13,255 }, + { 23,22,40,13,255 }, + { 23,33,40,13,255 }, + { 23,11,40,13,255 }, + { 23,0,40,13,255 }, + { 23,0,50,13,255 }, + + { 25,11,40,16,255 }, + { 25,11,50,16,255 }, + { 25,0,50,16,255 }, + + { 27,11,20,16,255 }, + { 27,11,30,16,255 }, + + { 29,11,10,16,255 }, + + { 45,22,30,12,255 }, + { 45,22,40,12,255 }, + { 45,22,50,12,255 }, + + { 46,22,40,12,255 }, + { 46,11,50,12,255 }, + { 46,22,50,12,255 }, + { 46,33,50,12,255 }, + + { 47,0,0,12,255 }, + + { 26,22,20,16,255 }, + { 26,33,10,16,255 }, + { 26,33,20,16,255 }, + { 26,33,30,16,255 }, + { 26,44,30,16,255 }, + { 26,22,30,16,255 }, + { 26,11,30,16,255 }, + { 26,11,20,16,255 }, + { 26,0,20,16,255 }, + { 26,11,40,16,255 }, + { 26,0,40,16,255 }, + { 26,22,40,16,255 }, + { 26,11,50,16,255 }, + + { 28,0,30,15,255 }, + { 28,0,20,15,255 }, + { 28,0,40,15,255 }, + { 28,11,30,15,255 }, + { 28,11,20,15,255 }, + { 28,22,30,15,255 }, + { 28,22,20,15,255 }, + + { 255,255,255,255,255 } + +}; + void DreamGenContext::dreamweb() { STACK_CHECK; - seecommandtail(); - checkbasemem(); - soundstartup(); - setkeyboardint(); - setupemm(); - allocatebuffers(); - setmouse(); - fadedos(); - gettime(); - clearbuffers(); - clearpalette(); - set16colpalette(); - readsetdata(); + + switch(engine->getLanguage()) { + case Common::EN_ANY: + case Common::EN_GRB: + case Common::EN_USA: + // Implicit data.byte(kForeignrelease) = 0 + break; + default: + data.byte(kForeignrelease) = 1; + break; + } + + seeCommandTail(); + // soundStartup used to be done here... + // setKeyboardInt used to be done here... + allocateBuffers(); + + // setMouse + data.word(kOldpointerx) = 0xffff; + + fadeDOS(); + getTime(); + clearBuffers(); + clearPalette(); + set16ColPalette(); + readSetData(); data.byte(kWongame) = 0; - dx = 1909; - loadsample(); - setsoundoff(); + engine->loadSounds(0, "DREAMWEB.V99"); // basic sample bool firstLoop = true; @@ -53,7 +495,7 @@ void DreamGenContext::dreamweb() { while (true) { - scanfornames(); + unsigned int count = scanForNames(); bool startNewGame = true; @@ -62,35 +504,34 @@ void DreamGenContext::dreamweb() { // loading a savegame requested from launcher/command line cls(); - setmode(); - loadpalfromiff(); - clearpalette(); - - ax = savegameId; - doload(); - worktoscreen(); - fadescreenup(); + setMode(); + loadPalFromIFF(); + clearPalette(); + + doLoad(savegameId); + workToScreenCPP(); + fadeScreenUp(); startNewGame = false; - } else if (al == 0 && firstLoop) { + } else if (count == 0 && firstLoop) { // no savegames found, and we're not restarting. - setmode(); - loadpalfromiff(); + setMode(); + loadPalFromIFF(); } else { - // "dodecisions" + // "doDecisions" // Savegames found, so ask if we should load one. // (If we're restarting after game over, we also always show these // options.) cls(); - setmode(); + setMode(); decide(); - if (data.byte(kQuitrequested)) - return; // exit game + if (quitRequested()) + goto done; if (data.byte(kGetback) == 4) startNewGame = false; // savegame has been loaded @@ -100,34 +541,42 @@ void DreamGenContext::dreamweb() { firstLoop = false; if (startNewGame) { - // "playgame" + // "playGame" - titles(); - if (data.byte(kQuitrequested)) - return; // exit game - credits(); + // "titles" + clearPalette(); + bibleQuote(); + if (!quitRequested()) // "titlesearly" + intro(); - if (data.byte(kQuitrequested)) - return; // exit game + if (quitRequested()) + goto done; - clearchanges(); - setmode(); - loadpalfromiff(); + // "credits" + clearPalette(); + realCredits(); + + if (quitRequested()) + goto done; + + clearChanges(); + setMode(); + loadPalFromIFF(); data.byte(kLocation) = 255; data.byte(kRoomafterdream) = 1; data.byte(kNewlocation) = 35; data.byte(kVolume) = 7; - loadroom(); - clearsprites(); - initman(); - entrytexts(); - entryanims(); + loadRoom(); + clearSprites(); + initMan(); + entryTexts(); + entryAnims(); data.byte(kDestpos) = 3; - initialinv(); + initialInv(); data.byte(kLastflag) = 32; startup1(); data.byte(kVolumeto) = 0; - data.byte(kVolumedirection) = -1; + data.byte(kVolumedirection) = (uint8)-1; data.byte(kCommandtype) = 255; } @@ -135,19 +584,22 @@ void DreamGenContext::dreamweb() { // main loop while (true) { - if (data.byte(kQuitrequested)) - return; // exit game + if (quitRequested()) + goto done; - screenupdate(); + screenUpdate(); + + if (quitRequested()) + goto done; if (data.byte(kWongame) != 0) { // "endofgame" - clearbeforeload(); - fadescreendowns(); - hangon(200); - endgame(); - quickquit2(); - return; + clearBeforeLoad(); + fadeScreenDowns(); + hangOn(200); + endGame(); + quickQuit2(); + goto done; } if (data.byte(kMandead) == 1 || data.byte(kMandead) == 2) @@ -159,193 +611,229 @@ void DreamGenContext::dreamweb() { } if (data.word(kWatchingtime) == 0) { - // "notwatching" + // "notWatching" if (data.byte(kMandead) == 4) break; if (data.byte(kNewlocation) != 255) { - // "loadnew" - clearbeforeload(); - loadroom(); - clearsprites(); - initman(); - entrytexts(); - entryanims(); + // "loadNew" + clearBeforeLoad(); + loadRoom(); + clearSprites(); + initMan(); + entryTexts(); + entryAnims(); data.byte(kNewlocation) = 255; startup(); data.byte(kCommandtype) = 255; - worktoscreenm(); + workToScreenM(); } } } - // "gameover" - clearbeforeload(); - showgun(); - fadescreendown(); - hangon(100); + // "gameOver" + clearBeforeLoad(); + showGun(); + fadeScreenDown(); + hangOn(100); } +done: // The engine will need some cleaner finalization, let's put it here for now + // FIXME: This triggers "Deallocating non existent segment" errors when + // quitting from a menu. + getRidOfAll(); + engine->freeIcons1(); + engine->freeIcons2(); } -static Common::String getFilename(Context &context) { - uint16 name_ptr = context.dx; - Common::String name; - uint8 c; - while((c = context.cs.byte(name_ptr++)) != 0) - name += (char)c; - return name; +bool DreamBase::quitRequested() { + return data.byte(kQuitrequested); } -void DreamGenContext::seecommandtail() { - data.word(kSoundbaseadd) = 0x220; - data.byte(kSoundint) = 5; - data.byte(kSounddmachannel) = 1; - data.byte(kBrightness) = 1; - data.word(kHowmuchalloc) = 0x9360; -} +void DreamGenContext::screenUpdate() { + newPlace(); + mainScreen(); + if (quitRequested()) + return; + animPointer(); -void DreamGenContext::randomnumber() { - al = engine->randomNumber(); + showPointer(); + if ((data.word(kWatchingtime) == 0) && (data.byte(kNewlocation) != 0xff)) + return; + vSync(); + uint16 mouseState = 0; + mouseState |= readMouseState(); + dumpPointer(); + + dumpTextLine(); + delPointer(); + autoLook(); + spriteUpdate(); + watchCount(); + zoom(); + + showPointer(); + if (data.byte(kWongame)) + return; + vSync(); + mouseState |= readMouseState(); + dumpPointer(); + + dumpZoom(); + delPointer(); + delEverything(); + printSprites(); + reelsOnScreen(); + afterNewRoom(); + + showPointer(); + vSync(); + mouseState |= readMouseState(); + dumpPointer(); + + dumpMap(); + dumpTimedText(); + delPointer(); + + showPointer(); + vSync(); + data.word(kOldbutton) = data.word(kMousebutton); + mouseState |= readMouseState(); + data.word(kMousebutton) = mouseState; + dumpPointer(); + + dumpWatch(); + delPointer(); } -void DreamGenContext::quickquit() { - engine->quit(); +void DreamGenContext::startup() { + data.byte(kCurrentkey) = 0; + data.byte(kMainmode) = 0; + createPanel(); + data.byte(kNewobs) = 1; + drawFloor(); + showIcon(); + getUnderZoom(); + spriteUpdate(); + printSprites(); + underTextLine(); + reelsOnScreen(); + atmospheres(); } -void DreamGenContext::quickquit2() { - engine->quit(); +void DreamGenContext::startup1() { + clearPalette(); + data.byte(kThroughdoor) = 0; + + startup(); + + workToScreenCPP(); + fadeScreenUp(); } -void DreamGenContext::keyboardread() { - ::error("keyboardread"); //this keyboard int handler, must never be called +void DreamGenContext::switchRyanOn() { + data.byte(kRyanon) = 255; } -void DreamGenContext::resetkeyboard() { +void DreamGenContext::switchRyanOff() { + data.byte(kRyanon) = 1; } -void DreamGenContext::setkeyboardint() { +uint8 *DreamBase::textUnder() { + return getSegment(data.word(kBuffers)).ptr(kTextunder, 0); } -void DreamGenContext::readfromfile() { - uint16 dst_offset = dx; - uint16 size = cx; - debug(1, "readfromfile(%04x:%u, %u)", (uint16)ds, dst_offset, size); - ax = engine->readFromFile(ds.ptr(dst_offset, size), size); - flags._c = false; +uint16 DreamGenContext::standardLoad(const char *fileName, uint16 *outSizeInBytes) { + FileHeader header; + + Common::File file; + file.open(fileName); + file.read((uint8 *)&header, sizeof(FileHeader)); + uint16 sizeInBytes = header.len(0); + if (outSizeInBytes) + *outSizeInBytes = sizeInBytes; + uint16 result = allocateMem((sizeInBytes + 15) / 16); + file.read(getSegment(result).ptr(0, 0), sizeInBytes); + return result; } -void DreamGenContext::closefile() { - engine->closeFile(); - data.byte(kHandle) = 0; +void *DreamGenContext::standardLoadCPP(const char *fileName, uint16 *outSizeInBytes) { + uint16 sizeInBytes; + uint16 seg = standardLoad(fileName, &sizeInBytes); + void *buffer = malloc(sizeInBytes); + memcpy(buffer, getSegment(seg).ptr(0, 0), sizeInBytes); + deallocateMem(seg); + if (outSizeInBytes) + *outSizeInBytes = sizeInBytes; + return buffer; } -void DreamGenContext::openforsave() { - const char *name = (const char *)ds.ptr(dx, 13); - debug(1, "openforsave(%s)", name); - engine->openSaveFileForWriting(name); +void DreamGenContext::loadIntoTemp() { + loadIntoTemp((const char *)data.ptr(dx, 0)); } -void DreamGenContext::openfilenocheck() { - const char *name = (const char *)ds.ptr(dx, 13); - debug(1, "checksavefile(%s)", name); - bool ok = engine->openSaveFileForReading(name); - flags._c = !ok; +void DreamGenContext::loadIntoTemp(const char *fileName) { + data.word(kTempgraphics) = standardLoad(fileName); } -void DreamGenContext::openfilefromc() { - openfilenocheck(); +void DreamGenContext::loadIntoTemp2(const char *fileName) { + data.word(kTempgraphics2) = standardLoad(fileName); } -void DreamGenContext::openfile() { - Common::String name = getFilename(*this); - debug(1, "opening file: %s", name.c_str()); - engine->openFile(name); - cs.word(kHandle) = 1; //only one handle - flags._c = false; +void DreamGenContext::loadIntoTemp3(const char *fileName) { + data.word(kTempgraphics3) = standardLoad(fileName); } -void DreamGenContext::createfile() { - ::error("createfile"); +void DreamGenContext::loadTempCharset() { + loadTempCharset((const char *)data.ptr(dx, 0)); } -void DreamGenContext::dontloadseg() { - ax = es.word(di); - _add(di, 2); - dx = ax; - cx = 0; - unsigned pos = engine->skipBytes(dx); - dx = pos >> 16; - ax = pos & 0xffff; - flags._c = false; +void DreamGenContext::loadTempCharset(const char *fileName) { + engine->setTempCharset(standardLoadCPP(fileName)); } -void DreamGenContext::mousecall() { - uint16 x, y, state; - engine->mouseCall(&x, &y, &state); - cx = x; - dx = y; - bx = state; +void DreamGenContext::hangOnCurs(uint16 frameCount) { + for (uint16 i = 0; i < frameCount; ++i) { + printCurs(); + vSync(); + delCurs(); + } } -void DreamGenContext::readmouse() { - data.word(kOldbutton) = data.word(kMousebutton); - data.word(kOldx) = data.word(kMousex); - data.word(kOldy) = data.word(kMousey); - uint16 x, y, state; - engine->mouseCall(&x, &y, &state); - data.word(kMousex) = x; - data.word(kMousey) = y; - data.word(kMousebutton) = state; +void DreamGenContext::seeCommandTail() { + data.byte(kBrightness) = 1; } -void DreamGenContext::readmouse1() { - data.word(kOldx) = data.word(kMousex); - data.word(kOldy) = data.word(kMousey); - uint16 x, y, state; - engine->mouseCall(&x, &y, &state); - data.word(kMousex) = x; - data.word(kMousey) = y; - data.word(kMousebutton1) = state; +void DreamGenContext::randomNumber() { + al = engine->randomNumber(); } -void DreamGenContext::readmouse2() { - data.word(kOldx) = data.word(kMousex); - data.word(kOldy) = data.word(kMousey); - uint16 x, y, state; - engine->mouseCall(&x, &y, &state); - data.word(kMousex) = x; - data.word(kMousey) = y; - data.word(kMousebutton2) = state; +void DreamGenContext::quickQuit() { + engine->quit(); } -void DreamGenContext::readmouse3() { - data.word(kOldx) = data.word(kMousex); - data.word(kOldy) = data.word(kMousey); - uint16 x, y, state; - engine->mouseCall(&x, &y, &state); - data.word(kMousex) = x; - data.word(kMousey) = y; - data.word(kMousebutton3) = state; +void DreamGenContext::quickQuit2() { + engine->quit(); } -void DreamGenContext::readmouse4() { +void DreamBase::readMouse() { data.word(kOldbutton) = data.word(kMousebutton); + uint16 state = readMouseState(); + data.word(kMousebutton) = state; +} + +uint16 DreamBase::readMouseState() { data.word(kOldx) = data.word(kMousex); data.word(kOldy) = data.word(kMousey); uint16 x, y, state; engine->mouseCall(&x, &y, &state); data.word(kMousex) = x; data.word(kMousey) = y; - data.word(kMousebutton) = state | data.word(kMousebutton1) | data.word(kMousebutton2) | data.word(kMousebutton3); + return state; } -void DreamGenContext::setmouse() { - data.word(kOldpointerx) = 0xffff; -} - -void DreamGenContext::dumptextline() { +void DreamGenContext::dumpTextLine() { if (data.byte(kNewtextline) != 1) return; data.byte(kNewtextline) = 0; @@ -353,39 +841,39 @@ void DreamGenContext::dumptextline() { uint16 y = data.word(kTextaddressy); if (data.byte(kForeignrelease) != 0) y -= 3; - multidump(x, y, 228, 13); + multiDump(x, y, 228, 13); } -void DreamGenContext::getundertimed() { +void DreamGenContext::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(ds.ptr(si, 0), data.byte(kTimedx), y, 240, kUndertimedysize); } -void DreamGenContext::putundertimed() { +void DreamGenContext::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(ds.ptr(si, 0), data.byte(kTimedx), y, 240, kUndertimedysize); } -void DreamGenContext::usetimedtext() { +void DreamGenContext::useTimedText() { if (data.word(kTimecount) == 0) return; --data.word(kTimecount); if (data.word(kTimecount) == 0) { - putundertimed(); + putUnderTimed(); data.byte(kNeedtodumptimed) = 1; return; } if (data.word(kTimecount) == data.word(kCounttotimed)) - getundertimed(); + getUnderTimed(); else if (data.word(kTimecount) > data.word(kCounttotimed)) return; @@ -393,34 +881,20 @@ void DreamGenContext::usetimedtext() { si = data.word(kTimedoffset); const uint8 *string = es.ptr(si, 0); uint16 y = data.byte(kTimedy); - printdirect(&string, data.byte(kTimedx), &y, 237, true); + printDirect(&string, data.byte(kTimedx), &y, 237, true); data.byte(kNeedtodumptimed) = 1; } -void DreamGenContext::setuptimedtemp() { - setuptimedtemp(al, ah, bl, bh, cx, dx); -} - -void DreamGenContext::setuptimedtemp(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount) { +void DreamGenContext::setupTimedTemp(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount) { #if 1 // if cd if (voiceIndex != 0) { - push(ax); - push(bx); - push(cx); - push(dx); - dl = 'T'; - dh = voiceIndex; - cl = 'T'; - ah = 0; - loadspeech(); - if (data.byte(kSpeechloaded) == 1) { - al = 50+12; - playchannel1(); + if (loadSpeech('T', voiceIndex, 'T', textIndex)) { + playChannel1(50+12); } - dx = pop(); - cx = pop(); - bx = pop(); - ax = pop(); + + // FIXME: This fallthrough does not properly support subtitles+speech + // mode. The parameters to setuptimedtemp() are sometimes different + // for speech and for subtitles. See e.g., madmantext() if ((data.byte(kSpeechloaded) == 1) && (data.byte(kSubtitles) != 1)) return; } @@ -433,23 +907,23 @@ void DreamGenContext::setuptimedtemp(uint8 textIndex, uint8 voiceIndex, uint8 x, data.word(kCounttotimed) = countToTimed; data.word(kTimecount) = timeCount + countToTimed; data.word(kTimedseg) = data.word(kTextfile1); - data.word(kTimedoffset) = kTextstart + segRef(data.word(kTextfile1)).word(textIndex * 2); - const uint8 *string = segRef(data.word(kTextfile1)).ptr(data.word(kTimedoffset), 0); - debug(1, "setuptimedtemp: (%d, %d) => '%s'", textIndex, voiceIndex, string); + data.word(kTimedoffset) = kTextstart + getSegment(data.word(kTextfile1)).word(textIndex * 2); + const uint8 *string = getSegment(data.word(kTextfile1)).ptr(data.word(kTimedoffset), 0); + debug(1, "setupTimedTemp: (%d, %d) => '%s'", textIndex, voiceIndex, string); } -void DreamGenContext::dumptimedtext() { +void DreamGenContext::dumpTimedText() { if (data.byte(kNeedtodumptimed) != 1) return; uint8 y = data.byte(kTimedy); if (data.byte(kForeignrelease) != 0) y -= 3; - multidump(data.byte(kTimedx), y, 240, kUndertimedysize); + multiDump(data.byte(kTimedx), y, 240, kUndertimedysize); data.byte(kNeedtodumptimed) = 0; } -void DreamGenContext::gettime() { +void DreamGenContext::getTime() { TimeDate t; g_system->getTimeAndDate(t); debug(1, "\tgettime: %02d:%02d:%02d", t.tm_hour, t.tm_min, t.tm_sec); @@ -461,11 +935,7 @@ void DreamGenContext::gettime() { data.byte(kHourcount) = ch; } -void DreamGenContext::allocatemem() { - ax = allocatemem(bx); -} - -uint16 DreamGenContext::allocatemem(uint16 paragraphs) { +uint16 DreamGenContext::allocateMem(uint16 paragraphs) { uint size = (paragraphs + 2) * 16; debug(1, "allocate mem, %u bytes", size); flags._c = false; @@ -475,10 +945,9 @@ uint16 DreamGenContext::allocatemem(uint16 paragraphs) { return result; } -void DreamGenContext::deallocatemem() { - uint16 id = (uint16)es; - debug(1, "deallocating segment %04x", id); - deallocateSegment(id); +void DreamGenContext::deallocateMem(uint16 segment) { + debug(1, "deallocating segment %04x", segment); + deallocateSegment(segment); //fixing invalid entries in the sprite table es = data; @@ -486,190 +955,38 @@ void DreamGenContext::deallocatemem() { uint16 bseg = data.word(kBuffers); if (!bseg) return; - SegmentRef buffers(this); + MutableSegmentRef buffers(this); buffers = bseg; uint8 *ptr = buffers.ptr(kSpritetable, tsize); - for(uint i = 0; i < tsize; i += 32) { + for (uint i = 0; i < tsize; i += 32) { uint16 seg = READ_LE_UINT16(ptr + i + 6); //debug(1, "sprite segment = %04x", seg); - if (seg == id) + if (seg == segment) memset(ptr + i, 0xff, 32); } } -void DreamGenContext::removeemm() { - ::error("removeemm"); -} - -void DreamGenContext::setupemm() { - //good place for early initialization - switch(engine->getLanguage()) { - case Common::EN_ANY: - case Common::EN_GRB: - case Common::EN_USA: - return; - default: - data.byte(kForeignrelease) = 1; - } -} - -void DreamGenContext::pitinterupt() { - ::error("pitinterupt"); -} - -void DreamGenContext::getridofpit() { - ::error("getridofpit"); -} - -void DreamGenContext::setuppit() { - ::error("setuppit"); -} - -void DreamGenContext::startdmablock() { - ::error("startdmablock"); -} - -void DreamGenContext::dmaend() { - ::error("dmaend"); -} - -void DreamGenContext::restoreems() { - ::error("restoreems"); -} - -void DreamGenContext::saveems() { - ::error("saveems"); -} - -void DreamGenContext::bothchannels() { - ::error("bothchannels"); -} - -void DreamGenContext::channel1only() { - ::error("channel1only"); -} - -void DreamGenContext::channel0only() { - ::error("channel0only"); -} - -void DreamGenContext::out22c() { - ::error("out22c"); -} - -void DreamGenContext::soundstartup() {} -void DreamGenContext::soundend() {} -void DreamGenContext::interupttest() {} -void DreamGenContext::disablesoundint() {} -void DreamGenContext::enablesoundint() {} -void DreamGenContext::checksoundint() { - data.byte(kTestresult) = 1; -} - -void DreamGenContext::setsoundoff() { - warning("setsoundoff: STUB"); -} - -void DreamGenContext::loadsample() { - engine->loadSounds(0, (const char *)data.ptr(dx, 13)); -} - -void DreamGenContext::loadsecondsample() { - uint8 ch0 = data.byte(kCh0playing); - if (ch0 >= 12 && ch0 != 255) - cancelch0(); - uint8 ch1 = data.byte(kCh1playing); - if (ch1 >= 12) - cancelch1(); - engine->loadSounds(1, (const char *)data.ptr(dx, 13)); -} - -void DreamGenContext::loadspeech() { - cancelch1(); - data.byte(kSpeechloaded) = 0; - createname(); - const char *name = (const char *)data.ptr(di, 13); - //warning("name = %s", name); - if (engine->loadSpeech(name)) - data.byte(kSpeechloaded) = 1; -} - -void DreamGenContext::saveseg() { - cx = es.word(di); - _add(di, 2); - savefilewrite(); -} - -void DreamGenContext::savefilewrite() { - ax = engine->writeToSaveFile(ds.ptr(dx, cx), cx); -} - -void DreamGenContext::savefileread() { - ax = engine->readFromSaveFile(ds.ptr(dx, cx), cx); -} - -void DreamGenContext::loadseg() { - ax = es.word(di); - di += 2; - - uint16 dst_offset = dx; - uint16 size = ax; - - debug(1, "loadseg(%04x:%u, %u)", (uint16)ds, dst_offset, size); - ax = engine->readFromFile(ds.ptr(dst_offset, size), size); - flags._c = false; -} - -void DreamGenContext::error() { - ::error("error"); -} - -void DreamGenContext::generalerror() { - ::error("generalerror"); -} - -void DreamGenContext::dosreturn() { - - _cmp(data.byte(kCommandtype), 250); - if (!flags.z()) { +void DreamGenContext::DOSReturn() { + if (data.byte(kCommandtype) != 250) { data.byte(kCommandtype) = 250; - al = 46; - commandonly(); + commandOnly(46); } - ax = data.word(kMousebutton); - _and(ax, 1); - if (flags.z()) - return; - - data.word(kMousebutton) = 0; - engine->quit(); -} - -void DreamGenContext::set16colpalette() { -} - -void DreamGenContext::mode640x480() { - // Video mode 12h: 640x480 pixels, 16 colors, I believe - al = 0x12 + 128; - ah = 0; - initGraphics(640, 480, true); -} - -void DreamGenContext::showgroup() { - engine->setPalette(); + if (data.word(kMousebutton) & 1) { + data.word(kMousebutton) = 0; + engine->quit(); + } } -void DreamGenContext::fadedos() { - engine->fadeDos(); +void DreamGenContext::set16ColPalette() { } -void DreamGenContext::eraseoldobs() { +void DreamGenContext::eraseOldObs() { if (data.byte(kNewobs) == 0) return; - Sprite *sprites = spritetable(); - for (size_t i=0; i < 16; ++i) { + Sprite *sprites = spriteTable(); + for (size_t i = 0; i < 16; ++i) { Sprite &sprite = sprites[i]; if (sprite.objData() != 0xffff) { memset(&sprite, 0xff, sizeof(Sprite)); @@ -677,11 +994,7 @@ void DreamGenContext::eraseoldobs() { } } -void DreamGenContext::modifychar() { - al = engine->modifyChar(al); -} - -void DreamGenContext::lockmon() { +void DreamBase::lockMon() { // Pressing space pauses text output in the monitor. We use the "hard" // key because calling readkey() drains characters from the input // buffer, we we want the user to be able to type ahead while the text @@ -690,44 +1003,31 @@ void DreamGenContext::lockmon() { // Clear the keyboard buffer. Otherwise the space that caused // the pause will be read immediately unpause the game. do { - readkey(); + readKey(); } while (data.byte(kCurrentkey) != 0); - locklighton(); + lockLightOn(); while (!engine->shouldQuit()) { engine->waitForVSync(); - readkey(); + readKey(); if (data.byte(kCurrentkey) == ' ') break; } // Forget the last "hard" key, otherwise the space that caused // the unpausing will immediately re-pause the game. data.byte(kLasthardkey) = 0; - locklightoff(); + lockLightOff(); } } -void DreamGenContext::cancelch0() { - data.byte(kCh0repeat) = 0; - data.word(kCh0blockstocopy) = 0; - data.byte(kCh0playing) = 255; - engine->stopSound(0); -} - -void DreamGenContext::cancelch1() { - data.word(kCh1blockstocopy) = 0; - data.byte(kCh1playing) = 255; - engine->stopSound(1); -} - -void DreamGenContext::makebackob(SetObject *objData) { +void DreamGenContext::makeBackOb(SetObject *objData) { if (data.byte(kNewobs) == 0) return; uint8 priority = objData->priority; uint8 type = objData->type; - Sprite *sprite = makesprite(data.word(kObjectx), data.word(kObjecty), addr_backobject, data.word(kSetframes), 0); + Sprite *sprite = makeSprite(data.word(kObjectx), data.word(kObjecty), addr_backobject, data.word(kSetframes), 0); - uint16 objDataOffset = (uint8 *)objData - segRef(data.word(kSetdat)).ptr(0, 0); + uint16 objDataOffset = (uint8 *)objData - getSegment(data.word(kSetdat)).ptr(0, 0); assert(objDataOffset % sizeof(SetObject) == 0); assert(objDataOffset < 128 * sizeof(SetObject)); sprite->setObjData(objDataOffset); @@ -737,256 +1037,162 @@ void DreamGenContext::makebackob(SetObject *objData) { sprite->type = type; sprite->b16 = 0; sprite->delay = 0; - sprite->frame = 0; + sprite->animFrame = 0; } -void DreamGenContext::getroomdata() { - bx = kRoomdata + sizeof(Room) * al; +uint16 DreamGenContext::allocateAndLoad(unsigned int size) { + // allocatemem adds 32 bytes, so it doesn't matter that size/16 rounds down + uint16 result = allocateMem(size / 16); + engine->readFromFile(getSegment(result).ptr(0, size), size); + return result; } -void DreamGenContext::startloading() { - const Room *room = (Room *)cs.ptr(bx, sizeof(Room)); - startloading(room); +void DreamGenContext::clearAndLoad(uint8 *buf, uint8 c, + unsigned int size, unsigned int maxSize) { + assert(size <= maxSize); + memset(buf, c, maxSize); + engine->readFromFile(buf, size); } -void DreamGenContext::readheader() { - ax = engine->readFromFile(cs.ptr(kFileheader, kHeaderlen), kHeaderlen); - es = cs; - di = kFiledata; +void DreamGenContext::clearAndLoad(uint16 seg, uint8 c, + unsigned int size, unsigned int maxSize) { + assert(size <= maxSize); + uint8 *buf = getSegment(seg).ptr(0, maxSize); + clearAndLoad(buf, c, size, maxSize); } -void DreamGenContext::startloading(const Room *room) { +void DreamGenContext::startLoading(const Room &room) { data.byte(kCombatcount) = 0; - data.byte(kRoomssample) = room->roomsSample; - data.byte(kMapx) = room->mapX; - data.byte(kMapy) = room->mapY; - data.byte(kLiftflag) = room->liftFlag; - data.byte(kManspath) = room->b21; - data.byte(kDestination) = room->b21; - data.byte(kFinaldest) = room->b21; - data.byte(kFacing) = room->b22; - data.byte(kTurntoface) = room->b22; - data.byte(kCounttoopen) = room->countToOpen; - data.byte(kLiftpath) = room->liftPath; - data.byte(kDoorpath) = room->doorPath; - data.byte(kLastweapon) = -1; - al = room->b27; - push(ax); - al = room->b31; + data.byte(kRoomssample) = room.roomsSample; + data.byte(kMapx) = room.mapX; + data.byte(kMapy) = room.mapY; + data.byte(kLiftflag) = room.liftFlag; + data.byte(kManspath) = room.b21; + data.byte(kDestination) = room.b21; + data.byte(kFinaldest) = room.b21; + data.byte(kFacing) = room.facing; + data.byte(kTurntoface) = room.facing; + data.byte(kCounttoopen) = room.countToOpen; + data.byte(kLiftpath) = room.liftPath; + data.byte(kDoorpath) = room.doorPath; + data.byte(kLastweapon) = (uint8)-1; ah = data.byte(kReallocation); - data.byte(kReallocation) = al; - dx = bx; - Common::String name = getFilename(*this); - engine->openFile(name); - cs.word(kHandle) = 1; //only one handle - flags._c = false; - readheader(); - allocateload(); - ds = ax; - data.word(kBackdrop) = ax; - dx = (0); - loadseg(); - ds = data.word(kWorkspace); - dx = (0); - cx = 132*66; - al = 0; - fillspace(); - loadseg(); - sortoutmap(); - allocateload(); - data.word(kSetframes) = ax; - ds = ax; - dx = (0); - loadseg(); - ds = data.word(kSetdat); - dx = 0; - cx = (64*128); - al = 255; - fillspace(); - loadseg(); - allocateload(); - data.word(kReel1) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kReel2) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kReel3) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kReels) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kPeople) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kSetdesc) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kBlockdesc) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kRoomdesc) = ax; - ds = ax; - dx = 0; - loadseg(); - allocateload(); - data.word(kFreeframes) = ax; - ds = ax; - dx = 0; - loadseg(); - ds = data.word(kFreedat); - dx = 0; - cx = (16*80); - al = 255; - fillspace(); - loadseg(); - allocateload(); - data.word(kFreedesc) = ax; - ds = ax; - dx = (0); - loadseg(); - closefile(); - findroominloc(); - deletetaken(); - setallchanges(); - autoappear(); - al = data.byte(kNewlocation); - getroomdata(); - data.byte(kLastweapon) = -1; + data.byte(kReallocation) = room.realLocation; + + loadRoomData(room, false); + + findRoomInLoc(); + deleteTaken(); + 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; data.byte(kNewlocation) = 255; data.byte(kLinepointer) = 254; - ax = pop(); - if (al != 255) { - data.byte(kManspath) = al; + if (room.b27 != 255) { + data.byte(kManspath) = room.b27; push(bx); - autosetwalk(); + autoSetWalk(); bx = pop(); } - findxyfrompath(); -} - -void DreamGenContext::fillspace() { - memset(ds.ptr(dx, cx), al, cx); + findXYFromPath(); } -void DreamGenContext::dealwithspecial(uint8 firstParam, uint8 secondParam) { +void DreamGenContext::dealWithSpecial(uint8 firstParam, uint8 secondParam) { uint8 type = firstParam - 220; if (type == 0) { - placesetobject(secondParam); + placeSetObject(secondParam); data.byte(kHavedoneobs) = 1; } else if (type == 1) { - removesetobject(secondParam); + removeSetObject(secondParam); data.byte(kHavedoneobs) = 1; } else if (type == 2) { - al = secondParam; - placefreeobject(); + placeFreeObject(secondParam); data.byte(kHavedoneobs) = 1; } else if (type == 3) { - al = secondParam; - removefreeobject(); + removeFreeObject(secondParam); data.byte(kHavedoneobs) = 1; } else if (type == 4) { - switchryanoff(); + switchRyanOff(); } else if (type == 5) { data.byte(kTurntoface) = secondParam; data.byte(kFacing) = secondParam; - switchryanon(); + switchRyanOn(); } else if (type == 6) { data.byte(kNewlocation) = secondParam; } else { - movemap(secondParam); + moveMap(secondParam); } } -void DreamGenContext::plotreel() { - Reel *reel = getreelstart(); - while (true) { - if (reel->x < 220) - break; - if (reel->x == 255) - break; - dealwithspecial(reel->x, reel->y); - ++data.word(kReelpointer); +void DreamGenContext::plotReel(uint16 &reelPointer) { + Reel *reel = getReelStart(reelPointer); + while (reel->x >= 220 && reel->x != 255) { + dealWithSpecial(reel->x, reel->y); + ++reelPointer; reel += 8; } for (size_t i = 0; i < 8; ++i) { if (reel->frame() != 0xffff) - showreelframe(reel); + showReelFrame(reel); ++reel; } - push(es); - push(bx); - soundonreels(); - bx = pop(); - es = pop(); + soundOnReels(reelPointer); } -void DreamGenContext::crosshair() { +void DreamBase::crosshair() { uint8 frame; if ((data.byte(kCommandtype) != 3) && (data.byte(kCommandtype) < 10)) { frame = 9; } else { frame = 29; } - const Frame *src = (const Frame *)segRef(data.word(kIcons1)).ptr(0, 0); - showframe(src, kZoomx + 24, kZoomy + 19, frame, 0); + showFrame(engine->icons1(), kZoomx + 24, kZoomy + 19, frame, 0); } -void DreamGenContext::deltextline() { +void DreamGenContext::delTextLine() { uint16 x = data.word(kTextaddressx); uint16 y = data.word(kTextaddressy); if (data.byte(kForeignrelease) != 0) y -= 3; - multiput(segRef(data.word(kBuffers)).ptr(kTextunder, 0), x, y, kUndertextsizex, kUndertextsizey); + multiPut(textUnder(), x, y, kUndertextsizex, kUndertextsizey); } -void DreamGenContext::commandonly() { - commandonly(al); +void DreamGenContext::commandOnly() { + commandOnly(al); } -void DreamGenContext::commandonly(uint8 command) { - deltextline(); +void DreamGenContext::commandOnly(uint8 command) { + delTextLine(); uint16 index = command * 2; - uint16 offset = kTextstart + segRef(data.word(kCommandtext)).word(index); + uint16 offset = kTextstart + getSegment(data.word(kCommandtext)).word(index); uint16 y = data.word(kTextaddressy); - const uint8 *string = segRef(data.word(kCommandtext)).ptr(offset, 0); - printdirect(&string, data.word(kTextaddressx), &y, data.byte(kTextlen), (bool)(data.byte(kTextlen) & 1)); + const uint8 *string = getSegment(data.word(kCommandtext)).ptr(offset, 0); + printDirect(&string, data.word(kTextaddressx), &y, data.byte(kTextlen), (bool)(data.byte(kTextlen) & 1)); data.byte(kNewtextline) = 1; } -void DreamGenContext::checkifperson() { - flags._z = not checkifperson(al, ah); +void DreamGenContext::checkIfPerson() { + flags._z = !checkIfPerson(al, ah); } -bool DreamGenContext::checkifperson(uint8 x, uint8 y) { - People *people = (People *)segRef(data.word(kBuffers)).ptr(kPeoplelist, 0); +bool DreamGenContext::checkIfPerson(uint8 x, uint8 y) { + People *people = (People *)getSegment(data.word(kBuffers)).ptr(kPeoplelist, 0); for (size_t i = 0; i < 12; ++i, ++people) { if (people->b4 == 255) continue; - data.word(kReelpointer) = people->reelPointer(); - Reel *reel = getreelstart(); + Reel *reel = getReelStart(people->reelPointer()); if (reel->frame() == 0xffff) ++reel; - const Frame *frame = getreelframeax(reel->frame()); + const Frame *frame = getReelFrameAX(reel->frame()); uint8 xmin = reel->x + frame->x; uint8 ymin = reel->y + frame->y; uint8 xmax = xmin + frame->width; @@ -1000,86 +1206,70 @@ bool DreamGenContext::checkifperson(uint8 x, uint8 y) { if (y >= ymax) continue; data.word(kPersondata) = people->routinePointer(); - obname(people->b4, 5); + obName(people->b4, 5); return true; } return false; } -void DreamGenContext::checkiffree() { - flags._z = not checkiffree(al, ah); +void DreamGenContext::checkIfFree() { + flags._z = !checkIfFree(al, ah); } -bool DreamGenContext::checkiffree(uint8 x, uint8 y) { - const ObjPos *freeList = (const ObjPos *)segRef(data.word(kBuffers)).ptr(kFreelist, 80 * sizeof(ObjPos)); +bool DreamGenContext::checkIfFree(uint8 x, uint8 y) { + const ObjPos *freeList = (const ObjPos *)getSegment(data.word(kBuffers)).ptr(kFreelist, 80 * sizeof(ObjPos)); for (size_t i = 0; i < 80; ++i) { const ObjPos *objPos = freeList + 79 - i; - if (objPos->index == 0xff) - continue; - if (x < objPos->xMin) - continue; - if (x >= objPos->xMax) + if (objPos->index == 0xff || !objPos->contains(x,y)) continue; - if (y < objPos->yMin) - continue; - if (y >= objPos->yMax) - continue; - obname(objPos->index, 2); + obName(objPos->index, 2); return true; } return false; } -void DreamGenContext::checkifex() { - flags._z = not checkifex(al, ah); +void DreamGenContext::checkIfEx() { + flags._z = !checkIfEx(al, ah); } -bool DreamGenContext::checkifex(uint8 x, uint8 y) { - const ObjPos *exList = (const ObjPos *)segRef(data.word(kBuffers)).ptr(kExlist, 100 * sizeof(ObjPos)); +bool DreamGenContext::checkIfEx(uint8 x, uint8 y) { + const ObjPos *exList = (const ObjPos *)getSegment(data.word(kBuffers)).ptr(kExlist, 100 * sizeof(ObjPos)); for (size_t i = 0; i < 100; ++i) { const ObjPos *objPos = exList + 99 - i; - if (objPos->index == 0xff) - continue; - if (x < objPos->xMin) + if (objPos->index == 0xff || !objPos->contains(x,y)) continue; - if (x >= objPos->xMax) - continue; - if (y < objPos->yMin) - continue; - if (y >= objPos->yMax) - continue; - obname(objPos->index, 4); + obName(objPos->index, 4); return true; } return false; } -const uint8 *DreamGenContext::findobname(uint8 type, uint8 index) { +const uint8 *DreamGenContext::findObName(uint8 type, uint8 index) { if (type == 5) { uint16 i = 64 * 2 * (index & 127); - uint16 offset = segRef(data.word(kPeople)).word(kPersontxtdat + i) + kPersontext; - return segRef(data.word(kPeople)).ptr(offset, 0); + uint16 offset = getSegment(data.word(kPeople)).word(kPersontxtdat + i) + kPersontext; + return getSegment(data.word(kPeople)).ptr(offset, 0); } else if (type == 4) { - uint16 offset = segRef(data.word(kExtras)).word(kExtextdat + index * 2) + kExtext; - return segRef(data.word(kExtras)).ptr(offset, 0); + uint16 offset = getSegment(data.word(kExtras)).word(kExtextdat + index * 2) + kExtext; + return getSegment(data.word(kExtras)).ptr(offset, 0); } else if (type == 2) { - uint16 offset = segRef(data.word(kFreedesc)).word(kFreetextdat + index * 2) + kFreetext; - return segRef(data.word(kFreedesc)).ptr(offset, 0); + uint16 offset = getSegment(data.word(kFreedesc)).word(kFreetextdat + index * 2) + kFreetext; + return getSegment(data.word(kFreedesc)).ptr(offset, 0); } else if (type == 1) { - uint16 offset = segRef(data.word(kSetdesc)).word(kSettextdat + index * 2) + kSettext; - return segRef(data.word(kSetdesc)).ptr(offset, 0); + uint16 offset = getSegment(data.word(kSetdesc)).word(kSettextdat + index * 2) + kSettext; + return getSegment(data.word(kSetdesc)).ptr(offset, 0); } else { - uint16 offset = segRef(data.word(kBlockdesc)).word(kBlocktextdat + index * 2) + kBlocktext; - return segRef(data.word(kBlockdesc)).ptr(offset, 0); + uint16 offset = getSegment(data.word(kBlockdesc)).word(kBlocktextdat + index * 2) + kBlocktext; + return getSegment(data.word(kBlockdesc)).ptr(offset, 0); } } -void DreamGenContext::copyname() { - copyname(ah, al, cs.ptr(di, 0)); +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); +void DreamGenContext::copyName(uint8 type, uint8 index, uint8 *dst) { + const uint8 *src = findObName(type, index); size_t i; for (i = 0; i < 28; ++i) { char c = src[i]; @@ -1092,139 +1282,117 @@ void DreamGenContext::copyname(uint8 type, uint8 index, uint8 *dst) { dst[i] = 0; } -void DreamGenContext::commandwithob() { - commandwithob(al, bh, bl); +void DreamGenContext::commandWithOb() { + commandWithOb(al, bh, bl); } -void DreamGenContext::commandwithob(uint8 command, uint8 type, uint8 index) { +void DreamGenContext::commandWithOb(uint8 command, uint8 type, uint8 index) { uint8 commandLine[64] = "OBJECT NAME ONE "; - deltextline(); - uint16 commandText = kTextstart + segRef(data.word(kCommandtext)).word(command * 2); + delTextLine(); + uint16 commandText = kTextstart + getSegment(data.word(kCommandtext)).word(command * 2); uint8 textLen = data.byte(kTextlen); { - const uint8 *string = segRef(data.word(kCommandtext)).ptr(commandText, 0); - printdirect(string, data.word(kTextaddressx), data.word(kTextaddressy), textLen, (bool)(textLen & 1)); + const uint8 *string = getSegment(data.word(kCommandtext)).ptr(commandText, 0); + printDirect(string, data.word(kTextaddressx), data.word(kTextaddressy), textLen, (bool)(textLen & 1)); } - copyname(type, index, commandLine); + copyName(type, index, commandLine); uint16 x = data.word(kLastxpos); if (command != 0) x += 5; - printdirect(commandLine, x, data.word(kTextaddressy), textLen, (bool)(textLen & 1)); + printDirect(commandLine, x, data.word(kTextaddressy), textLen, (bool)(textLen & 1)); data.byte(kNewtextline) = 1; } -void DreamGenContext::examineobtext() { - commandwithob(1, data.byte(kCommandtype), data.byte(kCommand)); -} - -void DreamGenContext::showpanel() { - Frame *frame = (Frame *)segRef(data.word(kIcons1)).ptr(0, sizeof(Frame)); - showframe(frame, 72, 0, 19, 0); - showframe(frame, 192, 0, 19, 0); -} - -void DreamGenContext::blocknametext() { - commandwithob(0, data.byte(kCommandtype), data.byte(kCommand)); +void DreamGenContext::examineObText() { + commandWithOb(1, data.byte(kCommandtype), data.byte(kCommand)); } -void DreamGenContext::personnametext() { - commandwithob(2, data.byte(kCommandtype), data.byte(kCommand) & 127); +void DreamGenContext::blockNameText() { + commandWithOb(0, data.byte(kCommandtype), data.byte(kCommand)); } -void DreamGenContext::walktotext() { - commandwithob(3, data.byte(kCommandtype), data.byte(kCommand)); +void DreamGenContext::personNameText() { + commandWithOb(2, data.byte(kCommandtype), data.byte(kCommand) & 127); } -void DreamGenContext::findormake() { - uint8 b0 = al; - uint8 b2 = cl; - uint8 b3 = ch; - findormake(b0, b2, b3); +void DreamGenContext::walkToText() { + commandWithOb(3, data.byte(kCommandtype), data.byte(kCommand)); } -void DreamGenContext::findormake(uint8 index, uint8 value, uint8 type) { - Change *change = (Change *)segRef(data.word(kBuffers)).ptr(kListofchanges, sizeof(Change)); - while (true) { - if (change->index == 0xff) { - change->index = index; - change->location = data.byte(kReallocation); - change->value = value; - change->type = type; - return; - } - if ((index == change->index) && (data.byte(kReallocation) == change->location) && (type == change->type)) { +void DreamBase::findOrMake(uint8 index, uint8 value, uint8 type) { + Change *change = (Change *)getSegment(data.word(kBuffers)).ptr(kListofchanges, sizeof(Change)); + for (; change->index != 0xff; ++change) { + if (index == change->index && data.byte(kReallocation) == change->location && type == change->type) { change->value = value; return; } - ++change; } + + change->index = index; + change->location = data.byte(kReallocation); + change->value = value; + change->type = type; } -void DreamGenContext::setallchanges() { - Change *change = (Change *)segRef(data.word(kBuffers)).ptr(kListofchanges, sizeof(Change)); - while (change->index != 0xff) { +void DreamGenContext::setAllChanges() { + Change *change = (Change *)getSegment(data.word(kBuffers)).ptr(kListofchanges, sizeof(Change)); + for (; change->index != 0xff; ++change) if (change->location == data.byte(kReallocation)) - dochange(change->index, change->value, change->type); - ++change; - } + doChange(change->index, change->value, change->type); } -DynObject *DreamGenContext::getfreead(uint8 index) { - return (DynObject *)segRef(data.word(kFreedat)).ptr(0, 0) + index; +DynObject *DreamBase::getFreeAd(uint8 index) { + return (DynObject *)getSegment(data.word(kFreedat)).ptr(0, 0) + index; } -DynObject *DreamGenContext::getexad(uint8 index) { - return (DynObject *)segRef(data.word(kExtras)).ptr(kExdata, 0) + index; +DynObject *DreamBase::getExAd(uint8 index) { + return (DynObject *)getSegment(data.word(kExtras)).ptr(kExdata, 0) + index; } -DynObject *DreamGenContext::geteitheradCPP() { +DynObject *DreamBase::getEitherAdCPP() { if (data.byte(kObjecttype) == 4) - return getexad(data.byte(kItemframe)); + return getExAd(data.byte(kItemframe)); else - return getfreead(data.byte(kItemframe)); + return getFreeAd(data.byte(kItemframe)); } -void *DreamGenContext::getanyad(uint8 *value1, uint8 *value2) { +void *DreamBase::getAnyAd(uint8 *value1, uint8 *value2) { if (data.byte(kObjecttype) == 4) { - DynObject *exObject = getexad(data.byte(kCommand)); + DynObject *exObject = getExAd(data.byte(kCommand)); *value1 = exObject->b7; *value2 = exObject->b8; return exObject; } else if (data.byte(kObjecttype) == 2) { - DynObject *freeObject = getfreead(data.byte(kCommand)); + DynObject *freeObject = getFreeAd(data.byte(kCommand)); *value1 = freeObject->b7; *value2 = freeObject->b8; return freeObject; } else { - SetObject *setObject = getsetad(data.byte(kCommand)); + SetObject *setObject = getSetAd(data.byte(kCommand)); *value1 = setObject->b4; *value2 = setObject->priority; return setObject; } } -void *DreamGenContext::getanyaddir(uint8 index, uint8 flag) { +void *DreamGenContext::getAnyAdDir(uint8 index, uint8 flag) { if (flag == 4) - return getexad(index); + return getExAd(index); else if (flag == 2) - return getfreead(index); + return getFreeAd(index); else - return getsetad(index); -} - -SetObject *DreamGenContext::getsetad(uint8 index) { - return (SetObject *)segRef(data.word(kSetdat)).ptr(0, 0) + index; + return getSetAd(index); } -void DreamGenContext::dochange() { - dochange(al, cl, ch); +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 DreamGenContext::doChange(uint8 index, uint8 value, uint8 type) { if (type == 0) { //object - getsetad(index)->mapad[0] = value; - } else if (type == 1) { //freeobject - DynObject *freeObject = getfreead(index); + getSetAd(index)->mapad[0] = value; + } else if (type == 1) { //freeObject + DynObject *freeObject = getFreeAd(index); if (freeObject->mapad[0] == 0xff) freeObject->mapad[0] = value; } else { //path @@ -1234,10 +1402,10 @@ void DreamGenContext::dochange(uint8 index, uint8 value, uint8 type) { } } -void DreamGenContext::deletetaken() { - const DynObject *extraObjects = (const DynObject *)segRef(data.word(kExtras)).ptr(kExdata, 0); - DynObject *freeObjects = (DynObject *)segRef(data.word(kFreedat)).ptr(0, 0); - for(size_t i = 0; i < kNumexobjects; ++i) { +void DreamGenContext::deleteTaken() { + const DynObject *extraObjects = (const DynObject *)getSegment(data.word(kExtras)).ptr(kExdata, 0); + DynObject *freeObjects = (DynObject *)getSegment(data.word(kFreedat)).ptr(0, 0); + for (size_t i = 0; i < kNumexobjects; ++i) { uint8 location = extraObjects[i].initialLocation; if (location == data.byte(kReallocation)) { uint8 index = extraObjects[i].index; @@ -1246,9 +1414,9 @@ void DreamGenContext::deletetaken() { } } -void DreamGenContext::getexpos() { +void DreamGenContext::getExPos() { es = data.word(kExtras); - const DynObject *objects = (const DynObject *)segRef(data.word(kExtras)).ptr(kExdata, sizeof(DynObject)); + const DynObject *objects = (const DynObject *)getSegment(data.word(kExtras)).ptr(kExdata, sizeof(DynObject)); for (size_t i = 0; i < kNumexobjects; ++i) { if (objects[i].mapad[0] == 0xff) { data.byte(kExpos) = i; @@ -1260,75 +1428,75 @@ void DreamGenContext::getexpos() { di = kExdata + kNumexobjects * sizeof(DynObject); } -void DreamGenContext::placesetobject() { - placesetobject(al); +void DreamGenContext::placeSetObject() { + placeSetObject(al); } -void DreamGenContext::placesetobject(uint8 index) { - findormake(index, 0, 0); - getsetad(index)->mapad[0] = 0; +void DreamGenContext::placeSetObject(uint8 index) { + findOrMake(index, 0, 0); + getSetAd(index)->mapad[0] = 0; } -void DreamGenContext::removesetobject() { - removesetobject(al); +void DreamGenContext::removeSetObject() { + removeSetObject(al); } -void DreamGenContext::removesetobject(uint8 index) { - findormake(index, 0xff, 0); - getsetad(index)->mapad[0] = 0xff; +void DreamGenContext::removeSetObject(uint8 index) { + findOrMake(index, 0xff, 0); + getSetAd(index)->mapad[0] = 0xff; } -void DreamGenContext::finishedwalking() { - flags._z = finishedwalkingCPP(); +void DreamGenContext::finishedWalking() { + flags._z = finishedWalkingCPP(); } -bool DreamGenContext::finishedwalkingCPP() { +bool DreamGenContext::finishedWalkingCPP() { return (data.byte(kLinepointer) == 254) && (data.byte(kFacing) == data.byte(kTurntoface)); } -void DreamGenContext::getflagunderp() { +void DreamGenContext::getFlagUnderP() { uint8 flag, flagEx; - getflagunderp(&flag, &flagEx); + getFlagUnderP(&flag, &flagEx); cl = flag; ch = flagEx; } -void DreamGenContext::getflagunderp(uint8 *flag, uint8 *flagEx) { +void DreamGenContext::getFlagUnderP(uint8 *flag, uint8 *flagEx) { uint8 type, flagX, flagY; - checkone(data.word(kMousex) - data.word(kMapadx), data.word(kMousey) - data.word(kMapady), flag, flagEx, &type, &flagX, &flagY); + checkOne(data.word(kMousex) - data.word(kMapadx), data.word(kMousey) - data.word(kMapady), flag, flagEx, &type, &flagX, &flagY); cl = data.byte(kLastflag) = *flag; ch = data.byte(kLastflagex) = *flagEx; } -void DreamGenContext::walkandexamine() { - if (! finishedwalkingCPP()) +void DreamGenContext::walkAndExamine() { + if (!finishedWalkingCPP()) return; data.byte(kCommandtype) = data.byte(kWalkexamtype); data.byte(kCommand) = data.byte(kWalkexamnum); data.byte(kWalkandexam) = 0; if (data.byte(kCommandtype) != 5) - examineob(); + examineOb(); } -void DreamGenContext::obname() { - obname(al, ah); +void DreamGenContext::obName() { + obName(al, ah); } -void DreamGenContext::obname(uint8 command, uint8 commandType) { +void DreamGenContext::obName(uint8 command, uint8 commandType) { if (data.byte(kReasseschanges) == 0) { if ((commandType == data.byte(kCommandtype)) && (command == data.byte(kCommand))) { if (data.byte(kWalkandexam) == 1) { - walkandexamine(); + walkAndExamine(); return; } else if (data.word(kMousebutton) == 0) return; else if ((data.byte(kCommandtype) == 3) && (data.byte(kLastflag) < 2)) return; else if ((data.byte(kManspath) != data.byte(kPointerspath)) || (data.byte(kCommandtype) == 3)) { - setwalk(); + setWalk(); data.byte(kReasseschanges) = 1; return; - } else if (! finishedwalkingCPP()) + } else if (! finishedWalkingCPP()) return; else if (data.byte(kCommandtype) == 5) { if (data.word(kWatchingtime) == 0) @@ -1336,7 +1504,7 @@ void DreamGenContext::obname(uint8 command, uint8 commandType) { return; } else { if (data.word(kWatchingtime) == 0) - examineob(); + examineOb(); return; } } @@ -1346,56 +1514,56 @@ void DreamGenContext::obname(uint8 command, uint8 commandType) { data.byte(kCommand) = command; data.byte(kCommandtype) = commandType; if ((data.byte(kLinepointer) != 254) || (data.word(kWatchingtime) != 0) || (data.byte(kFacing) != data.byte(kTurntoface))) { - blocknametext(); + blockNameText(); return; } else if (data.byte(kCommandtype) != 3) { if (data.byte(kManspath) != data.byte(kPointerspath)) { - walktotext(); + walkToText(); return; } else if (data.byte(kCommandtype) == 3) { - blocknametext(); + blockNameText(); return; } else if (data.byte(kCommandtype) == 5) { - personnametext(); + personNameText(); return; } else { - examineobtext(); + examineObText(); return; } } if (data.byte(kManspath) == data.byte(kPointerspath)) { uint8 flag, flagEx, type, flagX, flagY; - checkone(data.byte(kRyanx) + 12, data.byte(kRyany) + 12, &flag, &flagEx, &type, &flagX, &flagY); + checkOne(data.byte(kRyanx) + 12, data.byte(kRyany) + 12, &flag, &flagEx, &type, &flagX, &flagY); if (flag < 2) { - blocknametext(); + blockNameText(); return; } } - getflagunderp(); + getFlagUnderP(); if (data.byte(kLastflag) < 2) { - blocknametext(); + blockNameText(); return; } else if (data.byte(kLastflag) >= 128) { - blocknametext(); + blockNameText(); return; } else { - walktotext(); + walkToText(); return; } } -void DreamGenContext::delpointer() { +void DreamBase::delPointer() { if (data.word(kOldpointerx) == 0xffff) return; data.word(kDelherex) = data.word(kOldpointerx); data.word(kDelherey) = data.word(kOldpointery); data.byte(kDelxs) = data.byte(kPointerxs); data.byte(kDelys) = data.byte(kPointerys); - multiput(segRef(data.word(kBuffers)).ptr(kPointerback, 0), data.word(kDelherex), data.word(kDelherey), data.byte(kPointerxs), data.byte(kPointerys)); + multiPut(getSegment(data.word(kBuffers)).ptr(kPointerback, 0), data.word(kDelherex), data.word(kDelherey), data.byte(kPointerxs), data.byte(kPointerys)); } -void DreamGenContext::showblink() { +void DreamBase::showBlink() { if (data.byte(kManisoffscreen) == 1) return; ++data.byte(kBlinkcount); @@ -1413,184 +1581,41 @@ void DreamGenContext::showblink() { blinkFrame = 6; static const uint8 blinkTab[] = { 16,18,18,17,16,16,16 }; uint8 width, height; - showframe((Frame *)segRef(data.word(kIcons1)).ptr(0, 0), 44, 32, blinkTab[blinkFrame], 0, &width, &height); + showFrame(engine->icons1(), 44, 32, blinkTab[blinkFrame], 0, &width, &height); } -void DreamGenContext::dumpblink() { +void DreamBase::dumpBlink() { if (data.byte(kShadeson) != 0) return; if (data.byte(kBlinkcount) != 0) return; if (data.byte(kBlinkframe) >= 6) return; - multidump(44, 32, 16, 12); + multiDump(44, 32, 16, 12); } -void DreamGenContext::dumppointer() { - dumpblink(); - multidump(data.word(kDelherex), data.word(kDelherey), data.byte(kDelxs), data.byte(kDelys)); +void DreamBase::dumpPointer() { + dumpBlink(); + multiDump(data.word(kDelherex), data.word(kDelherey), data.byte(kDelxs), data.byte(kDelys)); if ((data.word(kOldpointerx) != data.word(kDelherex)) || (data.word(kOldpointery) != data.word(kDelherey))) - multidump(data.word(kOldpointerx), data.word(kOldpointery), data.byte(kPointerxs), data.byte(kPointerys)); -} - -void DreamGenContext::checkcoords() { - checkcoords((const RectWithCallback *)cs.ptr(bx, 0)); + multiDump(data.word(kOldpointerx), data.word(kOldpointery), data.byte(kPointerxs), data.byte(kPointerys)); } -void DreamGenContext::checkcoords(const RectWithCallback *rectWithCallbacks) { +void DreamGenContext::checkCoords(const RectWithCallback *rectWithCallbacks) { if (data.byte(kNewlocation) != 0xff) return; - const RectWithCallback *rectWithCallback = rectWithCallbacks; - while (rectWithCallback->xMin() != 0xffff) { - if (rectWithCallback->contains(data.word(kMousex), data.word(kMousey))) { - uint16 callback = rectWithCallback->callback(); - - // common - if(callback == addr_blank) - blank(); - else if(callback == addr_getbackfromob) - getbackfromob(); - else if(callback == addr_incryanpage) - incryanpage(); - else if(callback == addr_getback1) - getback1(); - else if(callback == addr_quitkey) - quitkey(); - else if(callback == addr_dosreturn) - dosreturn(); - else if(callback == addr_getbacktoops) - getbacktoops(); - else if(callback == addr_selectslot) - selectslot(); - // examlist - else if(callback == addr_useobject) - useobject(); - else if(callback == addr_selectopenob) - selectopenob(); - else if(callback == addr_setpickup) - setpickup(); - else if(callback == addr_examinventory) - examinventory(); - // invlist1 - else if(callback == addr_dropobject) - dropobject(); - else if(callback == addr_useopened) - useopened(); - else if(callback == addr_setpickup) - setpickup(); - else if(callback == addr_intoinv) - intoinv(); - // withlist1 - else if(callback == addr_selectob) - selectob(); - // talklist - else if(callback == addr_moretalk) - moretalk(); - // quitlist - // destlist - else if(callback == addr_nextdest) - nextdest(); - else if(callback == addr_lastdest) - lastdest(); - else if(callback == addr_lookatplace) - lookatplace(); - else if(callback == addr_destselect) - destselect(); - // keypadlist - else if(callback == addr_buttonone) - buttonone(); - else if(callback == addr_buttontwo) - buttontwo(); - else if(callback == addr_buttonthree) - buttonthree(); - else if(callback == addr_buttonfour) - buttonfour(); - else if(callback == addr_buttonfive) - buttonfive(); - else if(callback == addr_buttonsix) - buttonsix(); - else if(callback == addr_buttonseven) - buttonseven(); - else if(callback == addr_buttoneight) - buttoneight(); - else if(callback == addr_buttonnine) - buttonnine(); - else if(callback == addr_buttonnought) - buttonnought(); - else if(callback == addr_buttonenter) - buttonenter(); - // menulist - // folderlist - else if(callback == addr_nextfolder) - nextfolder(); - else if(callback == addr_lastfolder) - lastfolder(); - // symbollist - else if(callback == addr_quitsymbol) - quitsymbol(); - else if(callback == addr_settopleft) - settopleft(); - else if(callback == addr_settopright) - settopright(); - else if(callback == addr_setbotleft) - setbotleft(); - else if(callback == addr_setbotright) - setbotright(); - // diarylist - else if(callback == addr_diarykeyn) - diarykeyn(); - else if(callback == addr_diarykeyp) - diarykeyp(); - else if(callback == addr_quitkey) - quitkey(); - // opslist - else if(callback == addr_getbackfromops) - getbackfromops(); - else if(callback == addr_discops) - discops(); - // discopslist - else if(callback == addr_loadgame) - loadgame(); - else if(callback == addr_savegame) - savegame(); - // mainlist, mainlist2 - else if(callback == addr_look) - look(); - else if(callback == addr_inventory) - inventory(); - else if(callback == addr_zoomonoff) - zoomonoff(); - else if(callback == addr_saveload) - saveload(); - else if(callback == addr_madmanrun) - madmanrun(); - else if(callback == addr_identifyob) - identifyob(); - // decidelist - else if(callback == addr_newgame) - newgame(); - else if(callback == addr_loadold) - loadold(); - // loadlist - else if(callback == addr_actualload) - actualload(); - // savelist - else if(callback == addr_actualsave) - actualsave(); - else { - debug("__dispatch_call remaining in checkcoords! %d", (int)callback); - __dispatch_call(callback); - } + const RectWithCallback *r; + for (r = rectWithCallbacks; r->_xMin != 0xffff; ++r) { + if (r->contains(data.word(kMousex), data.word(kMousey))) { + (this->*(r->_callback))(); return; } - ++rectWithCallback; } } -void DreamGenContext::showpointer() { - showblink(); - const Frame *icons1 = ((const Frame *)segRef(data.word(kIcons1)).ptr(0, 0)); +void DreamBase::showPointer() { + showBlink(); uint16 x = data.word(kMousex); data.word(kOldpointerx) = data.word(kMousex); uint16 y = data.word(kMousey); @@ -1598,9 +1623,9 @@ void DreamGenContext::showpointer() { if (data.byte(kPickup) == 1) { const Frame *frames; if (data.byte(kObjecttype) != 4) - frames = (const Frame *)segRef(data.word(kFreeframes)).ptr(0, 0); + frames = (const Frame *)getSegment(data.word(kFreeframes)).ptr(0, 0); else - frames = (const Frame *)segRef(data.word(kExtras)).ptr(0, 0); + frames = (const Frame *)getSegment(data.word(kExtras)).ptr(0, 0); const Frame *frame = frames + (3 * data.byte(kItemframe) + 1); uint8 width = frame->width; uint8 height = frame->height; @@ -1614,11 +1639,11 @@ void DreamGenContext::showpointer() { uint16 yMin = (y >= height / 2) ? y - height / 2 : 0; data.word(kOldpointerx) = xMin; data.word(kOldpointery) = yMin; - multiget(segRef(data.word(kBuffers)).ptr(kPointerback, 0), xMin, yMin, width, height); - showframe(frames, x, y, 3 * data.byte(kItemframe) + 1, 128); - showframe(icons1, x, y, 3, 128); + multiGet(getSegment(data.word(kBuffers)).ptr(kPointerback, 0), xMin, yMin, width, height); + showFrame(frames, x, y, 3 * data.byte(kItemframe) + 1, 128); + showFrame(engine->icons1(), x, y, 3, 128); } else { - const Frame *frame = icons1 + (data.byte(kPointerframe) + 20); + const Frame *frame = engine->icons1() + (data.byte(kPointerframe) + 20); uint8 width = frame->width; uint8 height = frame->height; if (width < 12) @@ -1627,12 +1652,12 @@ void DreamGenContext::showpointer() { height = 12; data.byte(kPointerxs) = width; data.byte(kPointerys) = height; - multiget(segRef(data.word(kBuffers)).ptr(kPointerback, 0), x, y, width, height); - showframe(icons1, x, y, data.byte(kPointerframe) + 20, 0); + multiGet(getSegment(data.word(kBuffers)).ptr(kPointerback, 0), x, y, width, height); + showFrame(engine->icons1(), x, y, data.byte(kPointerframe) + 20, 0); } } -void DreamGenContext::animpointer() { +void DreamGenContext::animPointer() { if (data.byte(kPointermode) == 2) { data.byte(kPointerframe) = 0; @@ -1662,7 +1687,7 @@ void DreamGenContext::animpointer() { if (data.byte(kPointerfirstpath) == 0) return; uint8 flag, flagEx; - getflagunderp(&flag, &flagEx); + getFlagUnderP(&flag, &flagEx); if (flag < 2) return; if (flag >= 128) @@ -1686,36 +1711,14 @@ void DreamGenContext::animpointer() { data.byte(kPointerframe) = 8; } -void DreamGenContext::printmessage() { - printmessage(di, bx, al, dl, (bool)(dl & 1)); -} - -void DreamGenContext::printmessage(uint16 x, uint16 y, uint8 index, uint8 maxWidth, bool centered) { - uint16 offset = kTextstart + segRef(data.word(kCommandtext)).word(index * 2); - const uint8 *string = segRef(data.word(kCommandtext)).ptr(offset, 0); - printdirect(&string, x, &y, maxWidth, centered); +void DreamGenContext::printMessage() { + printMessage(di, bx, al, dl, (bool)(dl & 1)); } -void DreamGenContext::obpicture() { - if (data.byte(kObjecttype) == 1) - return; - Frame *frames; - if (data.byte(kObjecttype) == 4) - frames = (Frame *)segRef(data.word(kExtras)).ptr(0, 0); - else - frames = (Frame *)segRef(data.word(kFreeframes)).ptr(0, 0); - uint8 frame = 3 * data.byte(kCommand) + 1; - showframe(frames, 160, 68, frame, 0x80); -} - -void DreamGenContext::obicons() { - uint8 value1, value2; - getanyad(&value1, &value2); - if (value1 == 0xff) { - showframe((Frame *)segRef(data.word(kIcons2)).ptr(0, 0), 260, 1, 1, 0); - } else { - showframe((Frame *)segRef(data.word(kIcons2)).ptr(0, 0), 210, 1, 4, 0); - } +void DreamGenContext::printMessage(uint16 x, uint16 y, uint8 index, uint8 maxWidth, bool centered) { + uint16 offset = kTextstart + getSegment(data.word(kCommandtext)).word(index * 2); + const uint8 *string = getSegment(data.word(kCommandtext)).ptr(offset, 0); + printDirect(&string, x, &y, maxWidth, centered); } void DreamGenContext::compare() { @@ -1724,18 +1727,18 @@ void DreamGenContext::compare() { } bool DreamGenContext::compare(uint8 index, uint8 flag, const char id[4]) { - void *ptr = getanyaddir(index, flag); + void *ptr = getAnyAdDir(index, flag); const char *objId = (const char *)(((const uint8 *)ptr) + 12); // whether it is a DynObject or a SetObject for (size_t i = 0; i < 4; ++i) { - if(id[i] != objId[i] + 'A') + if (id[i] != objId[i] + 'A') return false; } return true; } -bool DreamGenContext::isitdescribed(const ObjPos *pos) { - uint16 offset = segRef(data.word(kSetdesc)).word(kSettextdat + pos->index * 2); - uint8 result = segRef(data.word(kSetdesc)).byte(kSettext + offset); +bool DreamGenContext::isItDescribed(const ObjPos *pos) { + uint16 offset = getSegment(data.word(kSetdesc)).word(kSettextdat + pos->index * 2); + uint8 result = getSegment(data.word(kSetdesc)).byte(kSettext + offset); return result != 0; } @@ -1747,85 +1750,58 @@ bool DreamGenContext::isCD() { return (data.byte(kSpeechloaded) == 1); } -void DreamGenContext::checkifset() { - flags._z = !checkifset(al, ah); +void DreamGenContext::showIcon() { + if (data.byte(kReallocation) < 50) { + showPanel(); + showMan(); + roomName(); + panelIcons1(); + zoomIcon(); + } else { + Frame *tempSprites = (Frame *)getSegment(data.word(kTempsprites)).ptr(0, 0); + showFrame(tempSprites, 72, 2, 45, 0); + showFrame(tempSprites, 72+47, 2, 46, 0); + showFrame(tempSprites, 69-10, 21, 49, 0); + showFrame(tempSprites, 160+88, 2, 45, 4 & 0xfe); + showFrame(tempSprites, 160+43, 2, 46, 4 & 0xfe); + showFrame(tempSprites, 160+101, 21, 49, 4 & 0xfe); + middlePanel(); + } +} + +void DreamGenContext::checkIfSet() { + flags._z = !checkIfSet(al, ah); } -bool DreamGenContext::checkifset(uint8 x, uint8 y) { - const ObjPos *setList = (const ObjPos *)segRef(data.word(kBuffers)).ptr(kSetlist, sizeof(ObjPos) * 128); +bool DreamGenContext::checkIfSet(uint8 x, uint8 y) { + const ObjPos *setList = (const ObjPos *)getSegment(data.word(kBuffers)).ptr(kSetlist, sizeof(ObjPos) * 128); for (size_t i = 0; i < 128; ++i) { const ObjPos *pos = setList + 127 - i; - if (pos->index == 0xff) - continue; - if (x < pos->xMin) - continue; - if (x >= pos->xMax) - continue; - if (y < pos->yMin) + if (pos->index == 0xff || !pos->contains(x,y)) continue; - if (y >= pos->yMax) + if (! pixelCheckSet(pos, x, y)) continue; - if (! pixelcheckset(pos, x, y)) + if (! isItDescribed(pos)) continue; - if (! isitdescribed(pos)) - continue; - obname(pos->index, 1); + obName(pos->index, 1); return true; } return false; } -void DreamGenContext::isitworn() { - flags._z = isitworn((const DynObject *)es.ptr(bx, sizeof(DynObject))); -} - -bool DreamGenContext::isitworn(const DynObject *object) { - return (object->id[0] == 'W'-'A') && (object->id[1] == 'E'-'A'); -} - -void DreamGenContext::makeworn() { - makeworn((DynObject *)es.ptr(bx, sizeof(DynObject))); -} - -void DreamGenContext::makeworn(DynObject *object) { - object->id[0] = 'W'-'A'; - object->id[1] = 'E'-'A'; -} - -void DreamGenContext::obtoinv() { - obtoinv(al, ah, di, bx); -} - -void DreamGenContext::obtoinv(uint8 index, uint8 flag, uint16 x, uint16 y) { - Frame *icons1 = (Frame *)segRef(data.word(kIcons1)).ptr(0, 0); - showframe(icons1, x - 2, y - 1, 10, 0); - if (index == 0xff) - return; - - Frame *extras = (Frame *)segRef(data.word(kExtras)).ptr(0, 0); - Frame *frees = (Frame *)segRef(data.word(kFreeframes)).ptr(0, 0); - Frame *frames = (flag == 4) ? extras : frees; - showframe(frames, x + 18, y + 19, 3 * index + 1, 128); - const DynObject *object = (const DynObject *)getanyaddir(index, flag); - bool worn = isitworn(object); - if (worn) - showframe(icons1, x - 3, y - 2, 7, 0); -} - -void DreamGenContext::showryanpage() { - Frame *icons1 = (Frame *)segRef(data.word(kIcons1)).ptr(0, 0); - showframe(icons1, kInventx + 167, kInventy - 12, 12, 0); - showframe(icons1, kInventx + 167 + 18 * data.byte(kRyanpage), kInventy - 12, 13 + data.byte(kRyanpage), 0); +void DreamBase::showRyanPage() { + showFrame(engine->icons1(), kInventx + 167, kInventy - 12, 12, 0); + showFrame(engine->icons1(), kInventx + 167 + 18 * data.byte(kRyanpage), kInventy - 12, 13 + data.byte(kRyanpage), 0); } -void DreamGenContext::findallryan() { - findallryan(es.ptr(di, 60)); +void DreamGenContext::findAllRyan() { + findAllRyan(es.ptr(di, 60)); } -void DreamGenContext::findallryan(uint8 *inv) { +void DreamGenContext::findAllRyan(uint8 *inv) { memset(inv, 0xff, 60); for (size_t i = 0; i < kNumexobjects; ++i) { - DynObject *extra = getexad(i); + DynObject *extra = getExAd(i); if (extra->mapad[0] != 4) continue; if (extra->mapad[1] != 0xff) @@ -1837,78 +1813,82 @@ void DreamGenContext::findallryan(uint8 *inv) { } } -void DreamGenContext::fillryan() { - uint8 *inv = segRef(data.word(kBuffers)).ptr(kRyaninvlist, 60); - findallryan(inv); - inv += data.byte(kRyanpage) * 2 * 10; - for (size_t i = 0; i < 2; ++i) { - for (size_t j = 0; j < 5; ++j) { - uint8 objIndex = *inv++; - uint8 objType = *inv++; - obtoinv(objIndex, objType, kInventx + j * kItempicsize, kInventy + i * kItempicsize); - } +void DreamGenContext::hangOn() { + hangOn(cx); +} + +void DreamBase::hangOn(uint16 frameCount) { + while (frameCount) { + vSync(); + --frameCount; + if (quitRequested()) + break; } - showryanpage(); } -void DreamGenContext::hangon() { - hangon(cx); +void DreamGenContext::hangOnW() { + hangOnW(cx); } -void DreamGenContext::hangon(uint16 frameCount) { +void DreamGenContext::hangOnW(uint16 frameCount) { while (frameCount) { - vsync(); + delPointer(); + readMouse(); + animPointer(); + showPointer(); + vSync(); + dumpPointer(); --frameCount; - if (data.byte(kQuitrequested)) + if (quitRequested()) break; } } -void DreamGenContext::hangonp() { - hangonp(cx); +void DreamGenContext::hangOnP() { + hangOnP(cx); } -void DreamGenContext::hangonp(uint16 count) { +void DreamGenContext::hangOnP(uint16 count) { data.word(kMaintimer) = 0; uint8 pointerFrame = data.byte(kPointerframe); uint8 pickup = data.byte(kPickup); data.byte(kPointermode) = 3; data.byte(kPickup) = 0; data.byte(kCommandtype) = 255; - readmouse(); - animpointer(); - showpointer(); - vsync(); - dumppointer(); - for (size_t i = 0; i < count * 3; ++i) { - delpointer(); - readmouse(); - animpointer(); - showpointer(); - vsync(); - dumppointer(); - if (data.byte(kQuitrequested)) + readMouse(); + animPointer(); + showPointer(); + vSync(); + dumpPointer(); + + count *= 3; + for (uint16 i = 0; i < count; ++i) { + delPointer(); + readMouse(); + animPointer(); + showPointer(); + vSync(); + dumpPointer(); + if (quitRequested()) break; - if (data.word(kMousebutton) == 0) - continue; - if (data.word(kMousebutton) != data.word(kOldbutton)) + if (data.word(kMousebutton) != 0 && data.word(kMousebutton) != data.word(kOldbutton)) break; } - delpointer(); + delPointer(); data.byte(kPointerframe) = pointerFrame; data.byte(kPickup) = pickup; data.byte(kPointermode) = 0; } -void DreamGenContext::findnextcolon() { +void DreamGenContext::findNextColon() { uint8 *initialString = es.ptr(si, 0); uint8 *string = initialString; - al = findnextcolon(&string); + al = findNextColon(&string); si += (string - initialString); } -uint8 DreamGenContext::findnextcolon(uint8 **string) { +uint8 DreamGenContext::findNextColon(uint8 **string) { uint8 c; do { c = **string; @@ -1917,15 +1897,2424 @@ uint8 DreamGenContext::findnextcolon(uint8 **string) { return c; } -uint8 *DreamGenContext::getobtextstartCPP() { +uint8 *DreamGenContext::getObTextStartCPP() { push(es); push(si); - getobtextstart(); + getObTextStart(); uint8 *result = es.ptr(si, 0); si = pop(); es = pop(); return result; } -} /*namespace dreamgen */ +void DreamGenContext::enterSymbol() { + data.byte(kManisoffscreen) = 1; + getRidOfReels(); + loadIntoTemp("DREAMWEB.G12"); // symbol graphics + data.byte(kSymboltopx) = 24; + data.byte(kSymboltopdir) = 0; + data.byte(kSymbolbotx) = 24; + data.byte(kSymbolbotdir) = 0; + redrawMainScrn(); + showSymbol(); + underTextLine(); + workToScreenM(); + data.byte(kGetback) = 0; + do { + delPointer(); + updateSymbolTop(); + updateSymbolBot(); + showSymbol(); + readMouse(); + showPointer(); + vSync(); + dumpPointer(); + dumpTextLine(); + dumpSymbol(); + RectWithCallback symbolList[] = { + { kSymbolx+40,kSymbolx+64,kSymboly+2,kSymboly+16,&DreamGenContext::quitSymbol }, + { kSymbolx,kSymbolx+52,kSymboly+20,kSymboly+50,&DreamGenContext::setTopLeft }, + { kSymbolx+52,kSymbolx+104,kSymboly+20,kSymboly+50,&DreamGenContext::setTopRight }, + { kSymbolx,kSymbolx+52,kSymboly+50,kSymboly+80,&DreamGenContext::setBotLeft }, + { kSymbolx+52,kSymbolx+104,kSymboly+50,kSymboly+80,&DreamGenContext::setBotRight }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + checkCoords(symbolList); + } while ((data.byte(kGetback) == 0) && !quitRequested()); + if ((data.byte(kSymbolbotnum) == 3) && (data.byte(kSymboltopnum) == 5)) { + removeSetObject(43); + placeSetObject(46); + turnAnyPathOn(0, data.byte(kRoomnum) + 12); + data.byte(kManisoffscreen) = 0; + redrawMainScrn(); + getRidOfTemp(); + restoreReels(); + workToScreenM(); + playChannel1(13); + } else { + removeSetObject(46); + placeSetObject(43); + turnAnyPathOff(0, data.byte(kRoomnum) + 12); + data.byte(kManisoffscreen) = 0; + redrawMainScrn(); + getRidOfTemp(); + restoreReels(); + workToScreenM(); + } +} + +void DreamGenContext::zoomOnOff() { + if (data.word(kWatchingtime) != 0 || data.byte(kPointermode) == 2) { + blank(); + return; + } + + if (data.byte(kCommandtype) != 222) { + data.byte(kCommandtype) = 222; + commandOnly(39); + } + + if (!(data.word(kMousebutton) & 1) || (data.word(kMousebutton) == data.word(kOldbutton))) + return; + + data.byte(kZoomon) ^= 1; + createPanel(); + data.byte(kNewobs) = 0; + drawFloor(); + printSprites(); + reelsOnScreen(); + showIcon(); + getUnderZoom(); + underTextLine(); + commandOnly(39); + readMouse(); + workToScreenM(); +} + +void DreamGenContext::sortOutMap() { + const uint8 *src = workspace(); + uint8 *dst = (uint8 *)getSegment(data.word(kMapdata)).ptr(0, 0); + for (uint16 y = 0; y < kMaplength; ++y) { + memcpy(dst, src, kMapwidth); + dst += kMapwidth; + src += 132; + } +} + +void DreamGenContext::showCity() { + clearWork(); + showFrame(tempGraphics(), 57, 32, 0, 0); + showFrame(tempGraphics(), 120+57, 32, 1, 0); +} + +void DreamGenContext::mainScreen() { + data.byte(kInmaparea) = 0; + if (data.byte(kWatchon) == 1) { + RectWithCallback mainList[] = { + { 44,70,32,46,&DreamGenContext::look }, + { 0,50,0,180,&DreamGenContext::inventory }, + { 226,244,10,26,&DreamGenContext::zoomOnOff }, + { 226,244,26,40,&DreamGenContext::saveLoad }, + { 240,260,100,124,&DreamGenContext::madmanRun }, + { 0,320,0,200,&DreamGenContext::identifyOb }, + { 0xFFFF,0,0,0,0 } + }; + checkCoords(mainList); + } else { + RectWithCallback mainList2[] = { + { 44,70,32,46,&DreamGenContext::look }, + { 0,50,0,180,&DreamGenContext::inventory }, + { 226+48,244+48,10,26,&DreamGenContext::zoomOnOff }, + { 226+48,244+48,26,40,&DreamGenContext::saveLoad }, + { 240,260,100,124,&DreamGenContext::madmanRun }, + { 0,320,0,200,&DreamGenContext::identifyOb }, + { 0xFFFF,0,0,0,0 } + }; + checkCoords(mainList2); + } + + if (data.byte(kWalkandexam) != 0) + walkAndExamine(); +} + +void DreamBase::showWatch() { + if (data.byte(kWatchon)) { + showFrame(engine->icons1(), 250, 1, 6, 0); + showTime(); + } +} + +void DreamGenContext::dumpWatch() { + if (data.byte(kWatchdump) != 1) + return; + multiDump(256, 21, 40, 12); + data.byte(kWatchdump) = 0; +} + +void DreamBase::showTime() { + if (data.byte(kWatchon) == 0) + return; + Frame *charset = (Frame *)getSegment(data.word(kCharset1)).ptr(0, 0); + + int seconds = data.byte(kSecondcount); + int minutes = data.byte(kMinutecount); + int hours = data.byte(kHourcount); + + showFrame(charset, 282+5, 21, 91*3+10 + seconds / 10, 0); + showFrame(charset, 282+9, 21, 91*3+10 + seconds % 10, 0); + + showFrame(charset, 270+5, 21, 91*3 + minutes / 10, 0); + showFrame(charset, 270+11, 21, 91*3 + minutes % 10, 0); + + showFrame(charset, 256+5, 21, 91*3 + hours / 10, 0); + showFrame(charset, 256+11, 21, 91*3 + hours % 10, 0); + + showFrame(charset, 267+5, 21, 91*3+20, 0); +} + +void DreamGenContext::watchCount() { + if (data.byte(kWatchon) == 0) + return; + ++data.byte(kTimercount); + if (data.byte(kTimercount) == 9) { + showFrame((Frame *)getSegment(data.word(kCharset1)).ptr(0, 0), 268+4, 21, 91*3+21, 0); + data.byte(kWatchdump) = 1; + } else if (data.byte(kTimercount) == 18) { + data.byte(kTimercount) = 0; + ++data.byte(kSecondcount); + if (data.byte(kSecondcount) == 60) { + data.byte(kSecondcount) = 0; + ++data.byte(kMinutecount); + if (data.byte(kMinutecount) == 60) { + data.byte(kMinutecount) = 0; + ++data.byte(kHourcount); + if (data.byte(kHourcount) == 24) + data.byte(kHourcount) = 0; + } + } + showTime(); + data.byte(kWatchdump) = 1; + } +} + +void DreamGenContext::roomName() { + printMessage(88, 18, 53, 240, false); + uint16 textIndex = data.byte(kRoomnum); + if (textIndex >= 32) + textIndex -= 32; + data.word(kLinespacing) = 7; + uint8 maxWidth = (data.byte(kWatchon) == 1) ? 120 : 160; + uint16 descOffset = getSegment(data.word(kRoomdesc)).word(kIntextdat + textIndex * 2); + const uint8 *string = getSegment(data.word(kRoomdesc)).ptr(kIntext + descOffset, 0); + printDirect(string, 88, 25, maxWidth, false); + data.word(kLinespacing) = 10; + useCharset1(); +} + +void DreamGenContext::zoomIcon() { + if (data.byte(kZoomon) == 0) + return; + showFrame(engine->icons1(), kZoomx, kZoomy-1, 8, 0); +} + +void DreamGenContext::loadRoom() { + data.byte(kRoomloaded) = 1; + data.word(kTimecount) = 0; + data.word(kMaintimer) = 0; + data.word(kMapoffsetx) = 104; + data.word(kMapoffsety) = 38; + data.word(kTextaddressx) = 13; + data.word(kTextaddressy) = 182; + data.byte(kTextlen) = 240; + data.byte(kLocation) = data.byte(kNewlocation); + const Room &room = g_roomData[data.byte(kNewlocation)]; + startLoading(room); + loadRoomsSample(); + switchRyanOn(); + drawFlags(); + getDimension(); +} + +void DreamGenContext::readSetData() { + data.word(kCharset1) = standardLoad("DREAMWEB.C00"); + + void *icons1Buffer = standardLoadCPP("DREAMWEB.G00"); + engine->setIcons1(icons1Buffer); + void *icons2Buffer = standardLoadCPP("DREAMWEB.G01"); + engine->setIcons2(icons2Buffer); + + data.word(kMainsprites) = standardLoad("DREAMWEB.S00"); + data.word(kPuzzletext) = standardLoad("DREAMWEB.T80"); + data.word(kCommandtext) = standardLoad("DREAMWEB.T84"); + useCharset1(); + + // FIXME: Why is this commented out? + //engine->openFile("DREAMWEB.VOL"); + //uint8 *volumeTab = getSegment(data.word(kSoundbuffer)).ptr(16384, 0); + //engine->readFromFile(volumeTab, 2048-256); + //engine->closeFile(); +} + +Frame * DreamBase::tempGraphics() { + return (Frame *)getSegment(data.word(kTempgraphics)).ptr(0, 0); +} + +Frame * DreamBase::tempGraphics2() { + return (Frame *)getSegment(data.word(kTempgraphics2)).ptr(0, 0); +} + +Frame * DreamBase::tempGraphics3() { + return (Frame *)getSegment(data.word(kTempgraphics3)).ptr(0, 0); +} + +void DreamGenContext::findRoomInLoc() { + uint8 x = data.byte(kMapx) / 11; + uint8 y = data.byte(kMapy) / 10; + uint8 roomNum = y * 6 + x; + data.byte(kRoomnum) = roomNum; +} + +void DreamGenContext::autoLook() { + if ((data.word(kMousex) != data.word(kOldx)) || (data.word(kMousey) != data.word(kOldy))) { + data.word(kLookcounter) = 1000; + return; + } + + --data.word(kLookcounter); + if (data.word(kLookcounter)) + return; + if (data.word(kWatchingtime)) + return; + doLook(); +} + +void DreamGenContext::look() { + if (data.word(kWatchingtime) || (data.byte(kPointermode) == 2)) { + blank(); + return; + } + if (data.byte(kCommandtype) != 241) { + data.byte(kCommandtype) = 241; + commandOnly(25); + } + if ((data.word(kMousebutton) == 1) && (data.word(kMousebutton) != data.word(kOldbutton))) + doLook(); +} + +void DreamGenContext::doLook() { + createPanel(); + showIcon(); + underTextLine(); + workToScreenM(); + data.byte(kCommandtype) = 255; + dumpTextLine(); + uint8 index = data.byte(kRoomnum) & 31; + uint16 offset = getSegment(data.word(kRoomdesc)).word(kIntextdat + index * 2); + uint8 *string = getSegment(data.word(kRoomdesc)).ptr(kIntext, 0) + offset; + findNextColon(&string); + uint16 x; + if (data.byte(kReallocation) < 50) + x = 66; + else + x = 40; + if (printSlow(string, x, 80, 241, true) != 1) + hangOnP(400); + + data.byte(kPointermode) = 0; + data.byte(kCommandtype) = 0; + redrawMainScrn(); + workToScreenM(); +} + +void DreamGenContext::useCharset1() { + engine->setCurrentCharset((Frame *)getSegment(data.word(kCharset1)).ptr(0, 0)); +} + +void DreamGenContext::useTempCharset() { + engine->setCurrentCharset(engine->tempCharset()); +} + +void DreamGenContext::getRidOfTemp() { + deallocateMem(data.word(kTempgraphics)); +} + +void DreamGenContext::getRidOfTempText() { + deallocateMem(data.word(kTextfile1)); +} + +void DreamGenContext::getRidOfTemp2() { + deallocateMem(data.word(kTempgraphics2)); +} + +void DreamGenContext::getRidOfTemp3() { + deallocateMem(data.word(kTempgraphics3)); +} + +void DreamGenContext::getRidOfTempCharset() { + engine->freeTempCharset(); +} + +void DreamGenContext::getRidOfTempsP() { + deallocateMem(data.word(kTempsprites)); +} + +void DreamGenContext::getRidOfAll() { + deallocateMem(data.word(kBackdrop)); + deallocateMem(data.word(kSetframes)); + deallocateMem(data.word(kReel1)); + deallocateMem(data.word(kReel2)); + deallocateMem(data.word(kReel3)); + deallocateMem(data.word(kReels)); + deallocateMem(data.word(kPeople)); + deallocateMem(data.word(kSetdesc)); + deallocateMem(data.word(kBlockdesc)); + deallocateMem(data.word(kRoomdesc)); + deallocateMem(data.word(kFreeframes)); + deallocateMem(data.word(kFreedesc)); +} + +// if skipDat, skip clearing and loading Setdat and Freedat +void DreamGenContext::loadRoomData(const Room &room, bool skipDat) { + engine->openFile(room.name); + + FileHeader header; + engine->readFromFile((uint8 *)&header, sizeof(FileHeader)); + + // read segment lengths from room file header + int len[15]; + for (int i = 0; i < 15; ++i) + len[i] = header.len(i); + + data.word(kBackdrop) = allocateAndLoad(len[0]); + clearAndLoad(workspace(), 0, len[1], 132*66); // 132*66 = maplen + sortOutMap(); + data.word(kSetframes) = allocateAndLoad(len[2]); + if (!skipDat) + clearAndLoad(data.word(kSetdat), 255, len[3], kSetdatlen); + else + engine->skipBytes(len[3]); + // NB: The skipDat version of this function as called by restoreall + // had a 'call bloc' instead of 'call loadseg' for reel1, + // but 'bloc' was not defined. + data.word(kReel1) = allocateAndLoad(len[4]); + data.word(kReel2) = allocateAndLoad(len[5]); + data.word(kReel3) = allocateAndLoad(len[6]); + data.word(kReels) = allocateAndLoad(len[7]); + data.word(kPeople) = allocateAndLoad(len[8]); + data.word(kSetdesc) = allocateAndLoad(len[9]); + data.word(kBlockdesc) = allocateAndLoad(len[10]); + data.word(kRoomdesc) = allocateAndLoad(len[11]); + data.word(kFreeframes) = allocateAndLoad(len[12]); + if (!skipDat) + clearAndLoad(data.word(kFreedat), 255, len[13], kFreedatlen); + else + engine->skipBytes(len[13]); + data.word(kFreedesc) = allocateAndLoad(len[14]); + + engine->closeFile(); +} + +void DreamGenContext::restoreAll() { + const Room &room = g_roomData[data.byte(kLocation)]; + loadRoomData(room, true); + setAllChanges(); +} + +void DreamGenContext::restoreReels() { + if (data.byte(kRoomloaded) == 0) + return; + + const Room &room = g_roomData[data.byte(kReallocation)]; + + engine->openFile(room.name); + + FileHeader header; + engine->readFromFile((uint8 *)&header, sizeof(FileHeader)); + + // read segment lengths from room file header + int len[15]; + for (int i = 0; i < 15; ++i) + len[i] = header.len(i); + + engine->skipBytes(len[0]); + engine->skipBytes(len[1]); + engine->skipBytes(len[2]); + engine->skipBytes(len[3]); + data.word(kReel1) = allocateAndLoad(len[4]); + data.word(kReel2) = allocateAndLoad(len[5]); + data.word(kReel3) = allocateAndLoad(len[6]); + + engine->closeFile(); +} + +void DreamGenContext::loadFolder() { + loadIntoTemp("DREAMWEB.G09"); // folder graphics 1 + loadIntoTemp2("DREAMWEB.G10"); // folder graphics 2 + loadIntoTemp3("DREAMWEB.G11"); // folder graphics 3 + loadTempCharset("DREAMWEB.C02"); // character set 3 + loadTempText("DREAMWEB.T50"); // folder text +} + +void DreamGenContext::showFolder() { + data.byte(kCommandtype) = 255; + if (data.byte(kFolderpage)) { + useTempCharset(); + createPanel2(); + showFrame(tempGraphics(), 0, 0, 0, 0); + showFrame(tempGraphics(), 143, 0, 1, 0); + showFrame(tempGraphics(), 0, 92, 2, 0); + showFrame(tempGraphics(), 143, 92, 3, 0); + folderExit(); + if (data.byte(kFolderpage) != 1) + showLeftPage(); + if (data.byte(kFolderpage) != 12) + showRightPage(); + useCharset1(); + underTextLine(); + } else { + createPanel2(); + showFrame(tempGraphics3(), 143-28, 0, 0, 0); + showFrame(tempGraphics3(), 143-28, 92, 1, 0); + folderExit(); + underTextLine(); + } +} + +void DreamGenContext::showLeftPage() { + showFrame(tempGraphics2(), 0, 12, 3, 0); + uint16 y = 12+5; + for (size_t i = 0; i < 9; ++i) { + showFrame(tempGraphics2(), 0, y, 4, 0); + y += 16; + } + showFrame(tempGraphics2(), 0, y, 5, 0); + data.word(kLinespacing) = 8; + data.word(kCharshift) = 91; + data.byte(kKerning) = 1; + uint8 pageIndex = data.byte(kFolderpage) - 2; + const uint8 *string = getTextInFile1(pageIndex * 2); + y = 48; + for (size_t i = 0; i < 2; ++i) { + uint8 lastChar; + do { + lastChar = printDirect(&string, 2, &y, 140, false); + y += data.word(kLinespacing); + } while (lastChar != '\0'); + } + data.byte(kKerning) = 0; + data.word(kCharshift) = 0; + data.word(kLinespacing) = 10; + uint8 *bufferToSwap = workspace() + (48*320)+2; + for (size_t i = 0; i < 120; ++i) { + for (size_t j = 0; j < 65; ++j) { + SWAP(bufferToSwap[j], bufferToSwap[130 - j]); + } + bufferToSwap += 320; + } +} + +void DreamGenContext::showRightPage() { + showFrame(tempGraphics2(), 143, 12, 0, 0); + uint16 y = 12+37; + for (size_t i = 0; i < 7; ++i) { + showFrame(tempGraphics2(), 143, y, 1, 0); + y += 16; + } + + showFrame(tempGraphics2(), 143, y, 2, 0); + data.word(kLinespacing) = 8; + data.byte(kKerning) = 1; + uint8 pageIndex = data.byte(kFolderpage) - 1; + const uint8 *string = getTextInFile1(pageIndex * 2); + y = 48; + for (size_t i = 0; i < 2; ++i) { + uint8 lastChar; + do { + lastChar = printDirect(&string, 152, &y, 140, false); + y += data.word(kLinespacing); + } while (lastChar != '\0'); + } + data.byte(kKerning) = 0; + data.word(kLinespacing) = 10; +} + +void DreamBase::showExit() { + showFrame(engine->icons1(), 274, 154, 11, 0); +} + +void DreamBase::showMan() { + showFrame(engine->icons1(), 0, 0, 0, 0); + showFrame(engine->icons1(), 0, 114, 1, 0); + if (data.byte(kShadeson)) + showFrame(engine->icons1(), 28, 25, 2, 0); +} + +void DreamBase::panelIcons1() { + uint16 x; + if (data.byte(kWatchon) != 1) + x = 48; + else + x = 0; + showFrame(engine->icons2(), 204 + x, 4, 2, 0); + if (data.byte(kZoomon) != 1) + showFrame(engine->icons1(), 228 + x, 8, 5, 0); + showWatch(); +} + +void DreamGenContext::examIcon() { + showFrame(engine->icons2(), 254, 5, 3, 0); +} + +uint8 DreamGenContext::getLocation(uint8 index) { + return data.byte(kRoomscango + index); +} + +void DreamGenContext::getLocation() { + al = getLocation(al); +} + +void DreamGenContext::setLocation(uint8 index) { + data.byte(kRoomscango + index) = 1; +} + +void DreamGenContext::setLocation() { + setLocation(al); +} + +const uint8 *DreamBase::getTextInFile1(uint16 index) { + SegmentRef text = getSegment(data.word(kTextfile1)); + uint16 offset = text.word(index * 2) + kTextstart; + const uint8 *string = text.ptr(offset, 0); + return string; +} + +void DreamGenContext::checkFolderCoords() { + RectWithCallback folderList[] = { + { 280,320,160,200, &DreamGenContext::quitKey }, + { 143,300,6,194, &DreamGenContext::nextFolder }, + { 0,143,6,194, &DreamGenContext::lastFolder }, + { 0,320,0,200, &DreamGenContext::blank }, + { 0xFFFF,0,0,0, 0 } + }; + checkCoords(folderList); +} + +void DreamGenContext::nextFolder() { + if (data.byte(kFolderpage) == 12) { + blank(); + return; + } + if (data.byte(kCommandtype) != 201) { + data.byte(kCommandtype) = 201; + commandOnly(16); + } + if ((data.word(kMousebutton) == 1) && (data.word(kMousebutton) != data.word(kOldbutton))) { + ++data.byte(kFolderpage); + folderHints(); + delPointer(); + showFolder(); + data.word(kMousebutton) = 0; + checkFolderCoords(); + workToScreenM(); + } +} + +void DreamGenContext::lastFolder() { + if (data.byte(kFolderpage) == 0) { + blank(); + return; + } + if (data.byte(kCommandtype) != 202) { + data.byte(kCommandtype) = 202; + commandOnly(17); + } + + if ((data.word(kMousebutton) == 1) && (data.word(kMousebutton) != data.word(kOldbutton))) { + --data.byte(kFolderpage); + delPointer(); + showFolder(); + data.word(kMousebutton) = 0; + checkFolderCoords(); + workToScreenM(); + } +} + +void DreamGenContext::folderHints() { + if (data.byte(kFolderpage) == 5) { + if ((data.byte(kAidedead) != 1) && (getLocation(13) != 1)) { + setLocation(13); + showFolder(); + const uint8 *string = getTextInFile1(30); + printDirect(string, 0, 86, 141, true); + workToScreenM(); + hangOnP(200); + } + } else if (data.byte(kFolderpage) == 9) { + if (getLocation(7) != 1) { + setLocation(7); + showFolder(); + const uint8 *string = getTextInFile1(31); + printDirect(string, 0, 86, 141, true); + workToScreenM(); + hangOnP(200); + } + } +} + +void DreamGenContext::folderExit() { + showFrame(tempGraphics2(), 296, 178, 6, 0); +} + +void DreamGenContext::loadTravelText() { + data.word(kTraveltext) = standardLoad("DREAMWEB.T81"); // location descs +} + +void DreamGenContext::loadTempText() { + loadTempText((const char *)data.ptr(dx, 0)); +} + +void DreamGenContext::loadTempText(const char *fileName) { + data.word(kTextfile1) = standardLoad(fileName); +} + +void DreamGenContext::drawFloor() { + eraseOldObs(); + drawFlags(); + calcMapAd(); + doBlocks(); + showAllObs(); + showAllFree(); + showAllEx(); + panelToMap(); + initRain(); + data.byte(kNewobs) = 0; +} + +void DreamGenContext::allocateBuffers() { + data.word(kExtras) = allocateMem(kLengthofextra/16); + data.word(kMapdata) = allocateMem(kLengthofmap/16); + data.word(kBuffers) = allocateMem(kLengthofbuffer/16); + data.word(kFreedat) = allocateMem(kFreedatlen/16); + data.word(kSetdat) = allocateMem(kSetdatlen/16); + data.word(kMapstore) = allocateMem(kLenofmapstore/16); + data.word(kSounddata) = allocateMem(2048/16); + data.word(kSounddata2) = allocateMem(2048/16); +} + +void DreamGenContext::workToScreenM() { + animPointer(); + readMouse(); + showPointer(); + vSync(); + workToScreenCPP(); + delPointer(); +} + +void DreamGenContext::loadMenu() { + loadIntoTemp("DREAMWEB.S02"); // sprite name 3 + loadIntoTemp2("DREAMWEB.G07"); // mon. graphics 2 +} + +void DreamGenContext::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() { + multiDump(kMenux, kMenuy, 48, 48); +} + +void DreamGenContext::useMenu() { + getRidOfReels(); + loadMenu(); + createPanel(); + showPanel(); + showIcon(); + data.byte(kNewobs) = 0; + drawFloor(); + printSprites(); + showFrame(tempGraphics2(), kMenux-48, kMenuy-4, 4, 0); + getUnderMenu(); + showFrame(tempGraphics2(), kMenux+54, kMenuy+72, 5, 0); + workToScreenM(); + data.byte(kGetback) = 0; + do { + delPointer(); + putUnderMenu(); + showMenu(); + readMouse(); + showPointer(); + vSync(); + dumpPointer(); + dumpMenu(); + dumpTextLine(); + RectWithCallback menuList[] = { + { kMenux+54,kMenux+68,kMenuy+72,kMenuy+88,&DreamGenContext::quitKey }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + checkCoords(menuList); + } while ((data.byte(kGetback) != 1) && !quitRequested()); + data.byte(kManisoffscreen) = 0; + redrawMainScrn(); + getRidOfTemp(); + getRidOfTemp2(); + restoreReels(); + workToScreenM(); +} + +void DreamGenContext::atmospheres() { + + const Atmosphere *a = &g_atmosphereList[0]; + + for (; a->_location != 255; ++a) { + if (a->_location != data.byte(kReallocation)) + continue; + if (a->_mapX != data.byte(kMapx) || a->_mapY != data.byte(kMapy)) + continue; + if (a->_sound != data.byte(kCh0playing)) { + + if (data.byte(kLocation) == 45 && data.word(kReeltowatch) == 45) + continue; // "web" + + playChannel0(a->_sound, a->_repeat); + + // NB: The asm here reads + // cmp reallocation,2 + // cmp mapy,0 + // jz fullvol + // jnz notlouisvol + // I'm interpreting this as if the cmp reallocation is below the jz + + if (data.byte(kMapy) == 0) { + data.byte(kVolume) = 0; // "fullvol" + return; + } + + if (data.byte(kReallocation) == 2 && data.byte(kMapx) == 22 && data.byte(kMapy) == 10) + data.byte(kVolume) = 5; // "louisvol" + + if (isCD() && data.byte(kReallocation) == 14) { + if (data.byte(kMapx) == 33) { + data.byte(kVolume) = 0; // "ismad2" + return; + } + + if (data.byte(kMapx) == 22) { + data.byte(kVolume) = 5; + return; + } + + } + } + + if (data.byte(kReallocation) == 2) { + if (data.byte(kMapx) == 22) { + data.byte(kVolume) = 5; // "louisvol" + return; + } + + if (data.byte(kMapx) == 11) { + data.byte(kVolume) = 0; // "fullvol" + return; + } + } + return; + } + + cancelCh0(); +} + +void DreamGenContext::readCityPic() { + loadIntoTemp("DREAMWEB.G04"); +} + +void DreamGenContext::readDestIcon() { + loadIntoTemp("DREAMWEB.G05"); + loadIntoTemp2("DREAMWEB.G06"); + loadIntoTemp3("DREAMWEB.G08"); +} + +uint8 DreamGenContext::nextSymbol(uint8 symbol) { + uint8 result = symbol + 1; + if (result == 6) + return 0; + if (result == 12) + return 6; + return result; +} + +void DreamGenContext::showSymbol() { + showFrame(tempGraphics(), kSymbolx, kSymboly, 12, 0); + + showFrame(tempGraphics(), data.byte(kSymboltopx) + kSymbolx-44, kSymboly+20, data.byte(kSymboltopnum), 32); + uint8 nextTopSymbol = nextSymbol(data.byte(kSymboltopnum)); + showFrame(tempGraphics(), data.byte(kSymboltopx) + kSymbolx+5, kSymboly+20, nextTopSymbol, 32); + uint8 nextNextTopSymbol = nextSymbol(nextTopSymbol); + showFrame(tempGraphics(), data.byte(kSymboltopx) + kSymbolx+54, kSymboly+20, nextNextTopSymbol, 32); + + showFrame(tempGraphics(), data.byte(kSymbolbotx) + kSymbolx-44, kSymboly+49, 6 + data.byte(kSymbolbotnum), 32); + uint8 nextBotSymbol = nextSymbol(data.byte(kSymbolbotnum)); + showFrame(tempGraphics(), data.byte(kSymbolbotx) + kSymbolx+5, kSymboly+49, 6 + nextBotSymbol, 32); + uint8 nextNextBotSymbol = nextSymbol(nextBotSymbol); + showFrame(tempGraphics(), data.byte(kSymbolbotx) + kSymbolx+54, kSymboly+49, 6 + nextNextBotSymbol, 32); +} + +void DreamBase::readKey() { + uint16 bufOut = data.word(kBufferout); + + if (bufOut == data.word(kBufferin)) { + // empty buffer + data.byte(kCurrentkey) = 0; + return; + } + + bufOut = (bufOut + 1) & 15; // The buffer has size 16 + data.byte(kCurrentkey) = g_keyBuffer[bufOut]; + data.word(kBufferout) = bufOut; +} + +void DreamGenContext::hangOne(uint16 delay) { + do { + vSync(); + if (data.byte(kLasthardkey) == 1) + return; // "hangonearly" + } while (--delay); +} + +void DreamGenContext::hangOne() { + hangOne(cx); +} + +void DreamGenContext::bibleQuote() { + initGraphics(640, 480, true); + + showPCX("DREAMWEB.I00"); + fadeScreenUps(); + + hangOne(80); + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "biblequotearly" + } + + hangOne(560); + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "biblequotearly" + } + + fadeScreenDowns(); + + hangOne(200); + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "biblequotearly" + } + + cancelCh0(); + + data.byte(kLasthardkey) = 0; +} + +void DreamGenContext::realCredits() { + data.byte(kRoomssample) = 33; + loadRoomsSample(); + data.byte(kVolume) = 0; + + initGraphics(640, 480, true); + hangOn(35); + + showPCX("DREAMWEB.I01"); + playChannel0(12, 0); + + hangOne(2); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "realcreditsearly" + } + + allPalette(); + hangOne(80); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "realcreditsearly" + } + + fadeScreenDowns(); + hangOne(256); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "realcreditsearly" + } + + showPCX("DREAMWEB.I02"); + playChannel0(12, 0); + hangOne(2); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "realcreditsearly" + } + + allPalette(); + hangOne(80); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "realcreditsearly" + } + + fadeScreenDowns(); + hangOne(256); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "realcreditsearly" + } + + showPCX("DREAMWEB.I03"); + playChannel0(12, 0); + hangOne(2); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "realcreditsearly" + } + + allPalette(); + hangOne(80); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "realcreditsearly" + } + + fadeScreenDowns(); + hangOne(256); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "realcreditsearly" + } + + showPCX("DREAMWEB.I04"); + playChannel0(12, 0); + hangOne(2); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "realcreditsearly" + } + + allPalette(); + hangOne(80); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "realcreditsearly" + } + + fadeScreenDowns(); + hangOne(256); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "realcreditsearly" + } + + showPCX("DREAMWEB.I05"); + playChannel0(12, 0); + hangOne(2); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "realcreditsearly" + } + + allPalette(); + hangOne(80); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "realcreditsearly" + } + + fadeScreenDowns(); + hangOne(256); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "realcreditsearly" + } + + showPCX("DREAMWEB.I06"); + fadeScreenUps(); + hangOne(60); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "realcreditsearly" + } + + playChannel0(13, 0); + hangOne(350); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "realcreditsearly" + } + + fadeScreenDowns(); + hangOne(256); + + data.byte(kLasthardkey) = 0; +} + +void DreamGenContext::runIntroSeq() { + data.byte(kGetback) = 0; + + do { + vSync(); + + if (data.byte(kLasthardkey) == 1) + break; + + spriteUpdate(); + vSync(); + + if (data.byte(kLasthardkey) == 1) + break; + + delEverything(); + printSprites(); + reelsOnScreen(); + afterIntroRoom(); + useTimedText(); + vSync(); + + if (data.byte(kLasthardkey) == 1) + break; + + dumpMap(); + dumpTimedText(); + vSync(); + + if (data.byte(kLasthardkey) == 1) + break; + + } while (data.byte(kGetback) != 1); + + + if (data.byte(kLasthardkey) == 1) { + getRidOfTempText(); + clearBeforeLoad(); + } + + // These were not called in this program arc + // in the original code.. Bug? + //getRidOfTempText(); + //clearBeforeLoad(); +} + +void DreamGenContext::intro() { + loadTempText("DREAMWEB.T82"); + loadPalFromIFF(); + setMode(); + data.byte(kNewlocation) = 50; + clearPalette(); + loadIntroRoom(); + data.byte(kVolume) = 7; + data.byte(kVolumedirection) = (uint8)-1; + data.byte(kVolumeto) = 4; + playChannel0(12, 255); + fadeScreenUps(); + runIntroSeq(); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "introearly" + } + + clearBeforeLoad(); + data.byte(kNewlocation) = 52; + loadIntroRoom(); + runIntroSeq(); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "introearly" + } + + clearBeforeLoad(); + data.byte(kNewlocation) = 53; + loadIntroRoom(); + runIntroSeq(); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "introearly" + } + + clearBeforeLoad(); + allPalette(); + data.byte(kNewlocation) = 54; + loadIntroRoom(); + runIntroSeq(); + + if (data.byte(kLasthardkey) == 1) { + data.byte(kLasthardkey) = 0; + return; // "introearly" + } + + getRidOfTempText(); + clearBeforeLoad(); + + data.byte(kLasthardkey) = 0; +} + +void DreamGenContext::setTopLeft() { + if (data.byte(kSymboltopdir) != 0) { + blank(); + return; + } + + if (data.byte(kCommandtype) != 210) { + data.byte(kCommandtype) = 210; + commandOnly(19); + } + + if (data.word(kMousebutton) != 0) + data.byte(kSymboltopdir) = 0xFF; +} + +void DreamGenContext::setTopRight() { + if (data.byte(kSymboltopdir) != 0) { + blank(); + return; + } + + if (data.byte(kCommandtype) != 211) { + data.byte(kCommandtype) = 211; + commandOnly(20); + } + + if (data.word(kMousebutton) != 0) + data.byte(kSymboltopdir) = 1; +} + +void DreamGenContext::setBotLeft() { + if (data.byte(kSymbolbotdir) != 0) { + blank(); + return; + } + + if (data.byte(kCommandtype) != 212) { + data.byte(kCommandtype) = 212; + commandOnly(21); + } + + if (data.word(kMousebutton) != 0) + data.byte(kSymbolbotdir) = 0xFF; +} + +void DreamGenContext::setBotRight() { + if (data.byte(kSymbolbotdir) != 0) { + blank(); + return; + } + + if (data.byte(kCommandtype) != 213) { + data.byte(kCommandtype) = 213; + commandOnly(22); + } + + if (data.word(kMousebutton) != 0) + data.byte(kSymbolbotdir) = 1; +} + +void DreamGenContext::newGame() { + if (data.byte(kCommandtype) != 251) { + data.byte(kCommandtype) = 251; + commandOnly(47); + } + + if (data.word(kMousebutton) == 1) + data.byte(kGetback) = 3; +} + +void DreamGenContext::getBackFromOps() { + if (data.byte(kMandead) == 2) + blank(); + else + getBack1(); +} + +void DreamGenContext::getBackToOps() { + if (data.byte(kCommandtype) != 201) { + data.byte(kCommandtype) = 201; + commandOnly(42); + } + + if (data.word(kMousebutton) != data.word(kOldbutton)) { + if (data.word(kMousebutton) & 1) { + oldToNames(); + data.byte(kGetback) = 2; + } + } +} + +void DreamGenContext::pickupOb(uint8 command, uint8 pos) { + data.byte(kLastinvpos) = pos; + data.byte(kObjecttype) = 2; + data.byte(kItemframe) = command; + data.byte(kCommand) = command; + getAnyAd(); + transferToEx(); +} + +void DreamGenContext::initialInv() { + if (data.byte(kReallocation) != 24) + return; + + pickupOb(11, 5); + pickupOb(12, 6); + pickupOb(13, 7); + pickupOb(14, 8); + pickupOb(18, 0); + pickupOb(19, 1); + pickupOb(20, 9); + pickupOb(16, 2); + data.byte(kWatchmode) = 1; + data.word(kReeltohold) = 0; + data.word(kEndofholdreel) = 6; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + switchRyanOff(); +} + +void DreamGenContext::walkIntoRoom() { + if (data.byte(kLocation) == 14 && data.byte(kMapx) == 22) { + data.byte(kDestination) = 1; + data.byte(kFinaldest) = 1; + autoSetWalk(); + } +} + +void DreamGenContext::loadIntroRoom() { + data.byte(kIntrocount) = 0; + data.byte(kLocation) = 255; + loadRoom(); + data.word(kMapoffsetx) = 72; + data.word(kMapoffsety) = 16; + clearSprites(); + data.byte(kThroughdoor) = 0; + data.byte(kCurrentkey) = '0'; + data.byte(kMainmode) = 0; + clearWork(); + data.byte(kNewobs) = 1; + drawFloor(); + reelsOnScreen(); + spriteUpdate(); + printSprites(); + workToScreenCPP(); +} + +void DreamGenContext::afterIntroRoom() { + if (data.byte(kNowinnewroom) == 0) + return; // notnewintro + + clearWork(); + findRoomInLoc(); + data.byte(kNewobs) = 1; + drawFloor(); + reelsOnScreen(); + spriteUpdate(); + printSprites(); + workToScreenCPP(); + data.byte(kNowinnewroom) = 0; +} + +void DreamGenContext::gettingShot() { + data.byte(kNewlocation) = 55; + clearPalette(); + loadIntroRoom(); + fadeScreenUps(); + data.byte(kVolumeto) = 0; + data.byte(kVolumedirection) = 0xFF; + runEndSeq(); + clearBeforeLoad(); +} + +void DreamGenContext::redrawMainScrn() { + data.word(kTimecount) = 0; + createPanel(); + data.byte(kNewobs) = 0; + drawFloor(); + printSprites(); + reelsOnScreen(); + showIcon(); + getUnderZoom(); + underTextLine(); + readMouse(); + data.byte(kCommandtype) = 255; +} + +void DreamGenContext::selectSlot2() { + if (data.word(kMousebutton)) + data.byte(kLoadingorsave) = 2; + selectSlot(); +} + +void DreamGenContext::blank() { + if (data.byte(kCommandtype) != 199) { + data.byte(kCommandtype) = 199; + commandOnly(0); + } +} + +void DreamGenContext::allPointer() { + readMouse(); + showPointer(); + dumpPointer(); +} + +void DreamGenContext::makeMainScreen() { + createPanel(); + data.byte(kNewobs) = 1; + drawFloor(); + spriteUpdate(); + printSprites(); + reelsOnScreen(); + showIcon(); + getUnderZoom(); + underTextLine(); + data.byte(kCommandtype) = 255; + animPointer(); + workToScreenM(); + data.byte(kCommandtype) = 200; + data.byte(kManisoffscreen) = 0; +} + +void DreamGenContext::openInv() { + data.byte(kInvopen) = 1; + printMessage(80, 58 - 10, 61, 240, (240 & 1)); + fillRyan(); + data.byte(kCommandtype) = 255; +} + +void DreamGenContext::obsThatDoThings() { + char id[4] = { 'M', 'E', 'M', 'B' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kCommand), data.byte(kObjecttype), id)) + return; // notlouiscard + + if (getLocation(4) != 1) { + setLocation(4); + lookAtCard(); + } +} + +void DreamGenContext::delEverything() { + if (data.byte(kMapysize) + data.word(kMapoffsety) < 182) { + mapToPanel(); + } else { + // Big room + data.byte(kMapysize) -= 8; + mapToPanel(); + data.byte(kMapysize) += 8; + } +} + +void DreamGenContext::errorMessage1() { + delPointer(); + printMessage(76, 21, 58, 240, (240 & 1)); + readMouse(); + showPointer(); + workToScreenCPP(); + delPointer(); + hangOnP(50); + showPanel(); + showMan(); + examIcon(); + readMouse(); + useOpened(); + showPointer(); + workToScreenCPP(); + delPointer(); +} + +void DreamGenContext::errorMessage2() { + data.byte(kCommandtype) = 255; + delPointer(); + printMessage(76, 21, 59, 240, (240 & 1)); + readMouse(); + showPointer(); + workToScreenCPP(); + delPointer(); + hangOnP(50); + showPanel(); + showMan(); + examIcon(); + readMouse(); + useOpened(); + showPointer(); + workToScreenCPP(); + delPointer(); +} + +void DreamGenContext::errorMessage3() { + delPointer(); + printMessage(76, 21, 60, 240, (240 & 1)); + workToScreenM(); + hangOnP(50); + showPanel(); + showMan(); + examIcon(); + readMouse(); + useOpened(); + showPointer(); + workToScreenCPP(); + delPointer(); +} + +void DreamGenContext::reExFromOpen() { + +} + +void DreamGenContext::nextDest() { + if (data.byte(kCommandtype) != 218) { + data.byte(kCommandtype) = 218; + commandOnly(28); + } + + if (!(data.word(kMousebutton) & 1) || data.word(kOldbutton) == 1) + return; // nodu + + do { + data.byte(kDestpos)++; + if (data.byte(kDestpos) == 15) + data.byte(kDestpos) = 0; // last destination + + getDestInfo(); + } while (al == 0); + + data.byte(kNewtextline) = 1; + delTextLine(); + delPointer(); + showPanel(); + showMan(); + showArrows(); + locationPic(); + underTextLine(); + readMouse(); + showPointer(); + workToScreenCPP(); + delPointer(); +} + +void DreamGenContext::lastDest() { + if (data.byte(kCommandtype) != 219) { + data.byte(kCommandtype) = 219; + commandOnly(29); + } + + if (!(data.word(kMousebutton) & 1) || data.word(kOldbutton) == 1) + return; // nodd + + do { + data.byte(kDestpos)--; + if (data.byte(kDestpos) == 0xFF) + data.byte(kDestpos) = 15; // first destination + + getDestInfo(); + } while (al == 0); + + data.byte(kNewtextline) = 1; + delTextLine(); + delPointer(); + showPanel(); + showMan(); + showArrows(); + locationPic(); + underTextLine(); + readMouse(); + showPointer(); + workToScreenCPP(); + delPointer(); +} + +void DreamGenContext::destSelect() { + if (data.byte(kCommandtype) != 222) { + data.byte(kCommandtype) = 222; + commandOnly(30); + } + + if (!(data.word(kMousebutton) & 1) || data.word(kOldbutton) == 1) + return; // notrav + + getDestInfo(); + data.byte(kNewlocation) = data.byte(kDestpos); +} + +void DreamGenContext::putBackObStuff() { + createPanel(); + showPanel(); + showMan(); + obIcons(); + showExit(); + obPicture(); + describeOb(); + underTextLine(); + data.byte(kCommandtype) = 255; + readMouse(); + showPointer(); + workToScreenCPP(); + delPointer(); +} + +void DreamGenContext::redes() { + if (data.byte(kCh1playing) != 255 || data.byte(kTalkmode) != 2) { + blank(); + return; + } + + if (data.byte(kCommandtype) != 217) { + data.byte(kCommandtype) = 217; + commandOnly(50); + } + + if (!(data.word(kMousebutton) & 1)) + return; + + delPointer(); + createPanel(); + showPanel(); + showMan(); + showExit(); + convIcons(); + startTalk(); + readMouse(); + showPointer(); + workToScreenCPP(); + delPointer(); +} + +void DreamGenContext::moreTalk() { + if (data.byte(kTalkmode) != 0) { + redes(); + return; + } + + if (data.byte(kCommandtype) != 215) { + data.byte(kCommandtype) = 215; + commandOnly(49); + } + + if (data.word(kMousebutton) == data.word(kOldbutton)) + return; // nomore + + if (!(data.word(kMousebutton) & 1)) + return; + + data.byte(kTalkmode) = 2; + data.byte(kTalkpos) = 4; + + if (data.byte(kCharacter) >= 100) + data.byte(kTalkpos) = 48; // second part + doSomeTalk(); +} + +bool DreamGenContext::isSetObOnMap(uint8 index) { + return (getSetAd(index)->mapad[0] == 0); +} + +void DreamGenContext::isSetObOnMap() { + flags._z = isSetObOnMap(al); +} + +void DreamGenContext::dumpZoom() { + if (data.byte(kZoomon) == 1) + multiDump(kZoomx + 5, kZoomy + 4, 46, 40); +} + +void DreamGenContext::selectLocation() { + data.byte(kInmaparea) = 0; + clearBeforeLoad(); + data.byte(kGetback) = 0; + data.byte(kPointerframe) = 22; + readCityPic(); + showCity(); + getRidOfTemp(); + readDestIcon(); + loadTravelText(); + showPanel(); + showMan(); + showArrows(); + showExit(); + locationPic(); + underTextLine(); + data.byte(kCommandtype) = 255; + readMouse(); + data.byte(kPointerframe) = 0; + showPointer(); + workToScreenCPP(); + playChannel0(9, 255); + data.byte(kNewlocation) = 255; + + while (data.byte(kNewlocation) == 255) { + if (quitRequested()) + break; + + delPointer(); + readMouse(); + showPointer(); + vSync(); + dumpPointer(); + dumpTextLine(); + + if (data.byte(kGetback) == 1) + break; + + RectWithCallback destList[] = { + { 238,258,4,44,&DreamGenContext::nextDest }, + { 104,124,4,44,&DreamGenContext::lastDest }, + { 280,308,4,44,&DreamGenContext::lookAtPlace }, + { 104,216,138,192,&DreamGenContext::destSelect }, + { 273,320,157,198,&DreamGenContext::getBack1 }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + checkCoords(destList); + } + + if (quitRequested() || data.byte(kGetback) == 1 || data.byte(kNewlocation) == data.byte(kLocation)) { + data.byte(kNewlocation) = data.byte(kReallocation); + data.byte(kGetback) = 0; + } + + getRidOfTemp(); + getRidOfTemp2(); + getRidOfTemp3(); + deallocateMem(data.word(kTraveltext)); +} + + +void DreamGenContext::examineInventory() { + if (data.byte(kCommandtype) != 249) { + data.byte(kCommandtype) = 249; + commandOnly(32); + } + + if (!(data.word(kMousebutton) & 1)) + return; + + createPanel(); + showPanel(); + showMan(); + showExit(); + examIcon(); + data.byte(kPickup) = 0; + data.byte(kInvopen) = 2; + openInv(); + workToScreenM(); +} + +void DreamBase::showArrows() { + showFrame(tempGraphics(), 116 - 12, 16, 0, 0); + showFrame(tempGraphics(), 226 + 12, 16, 1, 0); + showFrame(tempGraphics(), 280, 14, 2, 0); +} + +void DreamBase::showOpBox() { + showFrame(tempGraphics(), kOpsx, kOpsy, 0, 0); + + // CHECKME: There seem to be versions of dreamweb in which this call + // should be removed. It displays a red dot on the ops dialogs if left in. + showFrame(tempGraphics(), kOpsx, kOpsy + 55, 4, 0); +} + +void DreamGenContext::showLoadOps() { + showFrame(tempGraphics(), kOpsx + 128 + 4, kOpsy + 12, 1, 0); + showFrame(tempGraphics(), kOpsx + 176 + 2, kOpsy + 60 - 4, 5, 0); + printMessage(kOpsx + 104, kOpsy + 14, 55, 101, (101 & 1)); +} + +void DreamGenContext::showSaveOps() { + showFrame(tempGraphics(), kOpsx + 128 + 4, kOpsy + 12, 1, 0); + showFrame(tempGraphics(), kOpsx + 176 + 2, kOpsy + 60 - 4, 5, 0); + printMessage(kOpsx + 104, kOpsy + 14, 54, 101, (101 & 1)); +} + +void DreamBase::middlePanel() { + Frame *tempSprites = (Frame *)getSegment(data.word(kTempsprites)).ptr(0, 0); + showFrame(tempSprites, 72 + 47 + 20, 0, 48, 0); + showFrame(tempSprites, 72 + 19, 21, 47, 0); + showFrame(tempSprites, 160 + 23, 0, 48, 4); + showFrame(tempSprites, 160 + 71, 21, 47, 4); +} + +void DreamBase::showDiary() { + showFrame(tempGraphics(), kDiaryx, kDiaryy + 37, 1, 0); + showFrame(tempGraphics(), kDiaryx + 176, kDiaryy + 108, 2, 0); +} + +void DreamGenContext::underTextLine() { + uint16 y = data.word(kTextaddressy); + if (data.byte(kForeignrelease)) + y -= 3; + ds = data.word(kBuffers); + si = kTextunder; + multiGet(ds.ptr(si, 0), data.byte(kTextaddressx), y, kUndertextsizex, kUndertextsizey); +} + +void DreamGenContext::showDecisions() { + createPanel2(); + showOpBox(); + showFrame(tempGraphics(), kOpsx + 17, kOpsy + 13, 6, 0); + underTextLine(); +} + +void DreamGenContext::getUnderZoom() { + ds = data.word(kBuffers); + si = kZoomspace; + multiGet(ds.ptr(si, 0), kZoomx + 5, kZoomy + 4, 46, 40); +} + +void DreamGenContext::putUnderZoom() { + ds = data.word(kBuffers); + si = kZoomspace; + multiPut(ds.ptr(si, 0), kZoomx + 5, kZoomy + 4, 46, 40); +} + +void DreamGenContext::showWatchReel() { + uint16 reelPointer = data.word(kReeltowatch); + plotReel(reelPointer); + data.word(kReeltowatch) = reelPointer; + + // check for shake + if (data.byte(kReallocation) == 26 && reelPointer == 104) + data.byte(kShakecounter) = 0xFF; +} + +void DreamGenContext::watchReel() { + if (data.word(kReeltowatch) != 0xFFFF) { + if (data.byte(kManspath) != data.byte(kFinaldest)) + return; // Wait until stopped walking + if (data.byte(kTurntoface) != data.byte(kFacing)) + return; + + if (--data.byte(kSpeedcount) != 0xFF) { + showWatchReel(); + return; + } + data.byte(kSpeedcount) = data.byte(kWatchspeed); + if (data.word(kReeltowatch) != data.word(kEndwatchreel)) { + ++data.word(kReeltowatch); + showWatchReel(); + return; + } + if (data.word(kWatchingtime)) { + showWatchReel(); + return; + } + data.word(kReeltowatch) = 0xFFFF; + data.byte(kWatchmode) = 0xFF; + if (data.word(kReeltohold) == 0xFFFF) + return; // No more reel + data.byte(kWatchmode) = 1; + } else if (data.byte(kWatchmode) != 1) { + if (data.byte(kWatchmode) != 2) + return; // "notreleasehold" + if (--data.byte(kSpeedcount) == 0xFF) { + data.byte(kSpeedcount) = data.byte(kWatchspeed); + ++data.word(kReeltohold); + } + if (data.word(kReeltohold) == data.word(kEndofholdreel)) { + data.word(kReeltohold) = 0xFFFF; + data.byte(kWatchmode) = 0xFF; + data.byte(kDestination) = data.byte(kDestafterhold); + data.byte(kFinaldest) = data.byte(kDestafterhold); + autoSetWalk(); + return; + } + } + + uint16 reelPointer = data.word(kReeltohold); + plotReel(reelPointer); +} + +void DreamGenContext::afterNewRoom() { + if (data.byte(kNowinnewroom) == 0) + return; // notnew + + data.word(kTimecount) = 0; + createPanel(); + data.byte(kCommandtype) = 0; + findRoomInLoc(); + if (data.byte(kRyanon) != 1) { + al = data.byte(kRyanx) + 12; + ah = data.byte(kRyany) + 12; + findPathOfPoint(); + data.byte(kManspath) = dl; + findXYFromPath(); + data.byte(kResetmanxy) = 1; + } + data.byte(kNewobs) = 1; + drawFloor(); + data.word(kLookcounter) = 160; + data.byte(kNowinnewroom) = 0; + showIcon(); + spriteUpdate(); + printSprites(); + underTextLine(); + reelsOnScreen(); + mainScreen(); + getUnderZoom(); + zoom(); + workToScreenM(); + walkIntoRoom(); + reminders(); + atmospheres(); +} + +void DreamGenContext::madmanRun() { + if (data.byte(kLocation) != 14 || + data.byte(kMapx) != 22 || + data.byte(kPointermode) != 2 || + data.byte(kMadmanflag) != 0) { + identifyOb(); + return; + } + + if (data.byte(kCommandtype) != 211) { + data.byte(kCommandtype) = 211; + commandOnly(52); + } + + if (data.word(kMousebutton) == 1 && + data.word(kMousebutton) != data.word(kOldbutton)) + data.byte(kLastweapon) = 8; +} + + +void DreamGenContext::decide() { + setMode(); + loadPalFromIFF(); + clearPalette(); + data.byte(kPointermode) = 0; + data.word(kWatchingtime) = 0; + data.byte(kPointerframe) = 0; + data.word(kTextaddressx) = 70; + data.word(kTextaddressy) = 182 - 8; + data.byte(kTextlen) = 181; + data.byte(kManisoffscreen) = 1; + loadSaveBox(); + showDecisions(); + workToScreenCPP(); + fadeScreenUp(); + data.byte(kGetback) = 0; + + RectWithCallback decideList[] = { + { kOpsx+69,kOpsx+124,kOpsy+30,kOpsy+76,&DreamGenContext::newGame }, + { kOpsx+20,kOpsx+87,kOpsy+10,kOpsy+59,&DreamGenContext::DOSReturn }, + { kOpsx+123,kOpsx+190,kOpsy+10,kOpsy+59,&DreamGenContext::loadOld }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + + do { + if (data.byte(kQuitrequested) != 0) + return; + + readMouse(); + showPointer(); + vSync(); + dumpPointer(); + dumpTextLine(); + delPointer(); + checkCoords(decideList); + } while (!data.byte(kGetback)); + + if (data.byte(kGetback) != 4) + getRidOfTemp(); // room not loaded + + data.word(kTextaddressx) = 13; + data.word(kTextaddressy) = 182; + data.byte(kTextlen) = 240; +} + +void DreamGenContext::talk() { + data.byte(kTalkpos) = 0; + data.byte(kInmaparea) = 0; + data.byte(kCharacter) = data.byte(kCommand); + createPanel(); + showPanel(); + showMan(); + showExit(); + underTextLine(); + convIcons(); + startTalk(); + data.byte(kCommandtype) = 255; + readMouse(); + showPointer(); + workToScreenCPP(); + + RectWithCallback talkList[] = { + { 273,320,157,198,&DreamGenContext::getBack1 }, + { 240,290,2,44,&DreamGenContext::moreTalk }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + + do { + delPointer(); + readMouse(); + animPointer(); + showPointer(); + vSync(); + dumpPointer(); + dumpTextLine(); + data.byte(kGetback) = 0; + checkCoords(talkList); + if (data.byte(kQuitrequested)) + break; + } while (!data.byte(kGetback)); + + bx = data.word(kPersondata); + es = cs; + + if (data.byte(kTalkpos) >= 4) + es.byte(bx+7) |= 128; + + redrawMainScrn(); + workToScreenM(); + if (data.byte(kSpeechloaded) == 1) { + cancelCh1(); + data.byte(kVolumedirection) = 0xFF; + data.byte(kVolumeto) = 0; + } +} + + +void DreamGenContext::discOps() { + if (data.byte(kCommandtype) != 249) { + data.byte(kCommandtype) = 249; + commandOnly(43); + } + + if (data.word(kMousebutton) == data.word(kOldbutton) || !(data.word(kMousebutton) & 1)) + return; + + scanForNames(); + data.byte(kLoadingorsave) = 2; + showOpBox(); + showDiscOps(); + data.byte(kCurrentslot) = 0; + workToScreenM(); + data.byte(kGetback) = 0; + + RectWithCallback discOpsList[] = { + { kOpsx+59,kOpsx+114,kOpsy+30,kOpsy+76,&DreamGenContext::loadGame }, + { kOpsx+10,kOpsx+79,kOpsy+10,kOpsy+59,&DreamGenContext::saveGame }, + { kOpsx+176,kOpsx+192,kOpsy+60,kOpsy+76,&DreamGenContext::getBackToOps }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + + do { + if (data.byte(kQuitrequested) != 0) + return; // quitdiscops + + delPointer(); + readMouse(); + showPointer(); + vSync(); + dumpPointer(); + dumpTextLine(); + checkCoords(discOpsList); + } while (!data.byte(kGetback)); +} + +void DreamGenContext::doSaveLoad() { + data.byte(kPointerframe) = 0; + data.word(kTextaddressx) = 70; + data.word(kTextaddressy) = 182-8; + data.byte(kTextlen) = 181; + data.byte(kManisoffscreen) = 1; + clearWork(); + createPanel2(); + underTextLine(); + getRidOfAll(); + loadSaveBox(); + showOpBox(); + showMainOps(); + workToScreenCPP(); + + RectWithCallback opsList[] = { + { kOpsx+59,kOpsx+114,kOpsy+30,kOpsy+76,&DreamGenContext::getBackFromOps }, + { kOpsx+10,kOpsx+77,kOpsy+10,kOpsy+59,&DreamGenContext::DOSReturn }, + { kOpsx+128,kOpsx+190,kOpsy+16,kOpsy+100,&DreamGenContext::discOps }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + + bool firstOps = true; + + do { // restart ops + if (firstOps) { + firstOps = false; + } else { + showOpBox(); + showMainOps(); + workToScreenM(); + } + data.byte(kGetback) = 0; + + do { // wait ops + if (data.byte(kQuitrequested)) { + data.byte(kManisoffscreen) = 0; + return; + } + + readMouse(); + showPointer(); + vSync(); + dumpPointer(); + dumpTextLine(); + delPointer(); + checkCoords(opsList); + } while (!data.byte(kGetback)); + } while (data.byte(kGetback) == 2); + + data.word(kTextaddressx) = 13; + data.word(kTextaddressy) = 182; + data.byte(kTextlen) = 240; + if (data.byte(kGetback) != 4) { + getRidOfTemp(); + restoreAll(); + redrawMainScrn(); + workToScreenM(); + data.byte(kCommandtype) = 200; + } + data.byte(kManisoffscreen) = 0; +} + +void DreamGenContext::hangOnPQ() { + data.byte(kGetback) = 0; + + RectWithCallback quitList[] = { + { 273,320,157,198,&DreamGenContext::getBack1 }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + + uint16 speechFlag = 0; + + do { + delPointer(); + readMouse(); + animPointer(); + showPointer(); + vSync(); + dumpPointer(); + dumpTextLine(); + checkCoords(quitList); + + if (data.byte(kGetback) == 1 || data.byte(kQuitrequested)) { + // Quit conversation + delPointer(); + data.byte(kPointermode) = 0; + cancelCh1(); + flags._c = true; + return; + } + + if (data.byte(kSpeechloaded) == 1 && data.byte(kCh1playing) == 255) { + speechFlag++; + if (speechFlag == 40) + break; + } + } while (!data.word(kMousebutton) || data.word(kOldbutton)); + + delPointer(); + data.byte(kPointermode) = 0; + flags._c = false; + } + +void DreamGenContext::endGame() { + loadTempText("DREAMWEB.T83"); + monkSpeaking(); + gettingShot(); + getRidOfTempText(); + data.byte(kVolumeto) = 7; + data.byte(kVolumedirection) = 1; + hangOn(200); +} + +void DreamGenContext::showGun() { + data.byte(kAddtored) = 0; + data.byte(kAddtogreen) = 0; + data.byte(kAddtoblue) = 0; + palToStartPal(); + palToEndPal(); + greyscaleSum(); + data.byte(kFadedirection) = 1; + data.byte(kFadecount) = 63; + data.byte(kColourpos) = 0; + data.byte(kNumtofade) = 128; + hangOn(130); + endPalToStart(); + clearEndPal(); + data.byte(kFadedirection) = 1; + data.byte(kFadecount) = 63; + data.byte(kColourpos) = 0; + data.byte(kNumtofade) = 128; + hangOn(200); + data.byte(kRoomssample) = 34; + loadRoomsSample(); + data.byte(kVolume) = 0; + loadIntoTemp("DREAMWEB.G13"); + createPanel2(); + showFrame(tempGraphics(), 100, 4, 0, 0); + showFrame(tempGraphics(), 158, 106, 1, 0); + workToScreenCPP(); + getRidOfTemp(); + fadeScreenUp(); + hangOn(160); + playChannel0(12, 0); + loadTempText("DREAMWEB.T83"); + rollEndCredits2(); + getRidOfTempText(); +} + +void DreamGenContext::diaryKeyP() { + if (data.byte(kCommandtype) != 214) { + data.byte(kCommandtype) = 214; + commandOnly(23); + } + + if (!data.word(kMousebutton) || + data.word(kOldbutton) == data.word(kMousebutton) || + data.byte(kPresscount)) + return; // notkeyp + + playChannel1(16); + data.byte(kPresscount) = 12; + data.byte(kPressed) = 'P'; + data.byte(kDiarypage)--; + + if (data.byte(kDiarypage) == 0xFF) + data.byte(kDiarypage) = 11; +} + +void DreamGenContext::diaryKeyN() { + if (data.byte(kCommandtype) != 213) { + data.byte(kCommandtype) = 213; + commandOnly(23); + } + + if (!data.word(kMousebutton) || + data.word(kOldbutton) == data.word(kMousebutton) || + data.byte(kPresscount)) + return; // notkeyn + + playChannel1(16); + data.byte(kPresscount) = 12; + data.byte(kPressed) = 'N'; + data.byte(kDiarypage)++; + + if (data.byte(kDiarypage) == 12) + data.byte(kDiarypage) = 0; +} + +void DreamGenContext::dropError() { + data.byte(kCommandtype) = 255; + delPointer(); + printMessage(76, 21, 56, 240, 240 & 1); + workToScreenM(); + hangOnP(50); + showPanel(); + showMan(); + examIcon(); + data.byte(kCommandtype) = 255; + workToScreenM(); +} + +void DreamGenContext::cantDrop() { + data.byte(kCommandtype) = 255; + delPointer(); + printMessage(76, 21, 24, 240, 240 & 1); + workToScreenM(); + hangOnP(50); + showPanel(); + showMan(); + examIcon(); + data.byte(kCommandtype) = 255; + workToScreenM(); +} + +void DreamGenContext::getBack1() { + if (data.byte(kPickup) != 0) { + blank(); + return; + } + + + if (data.byte(kCommandtype) != 202) { + data.byte(kCommandtype) = 202; + commandOnly(26); + } + + if (data.word(kMousebutton) == data.word(kOldbutton)) + return; + + if (data.word(kMousebutton) & 1) { + // Get back + data.byte(kGetback) = 1; + data.byte(kPickup) = 0; + } +} + +void DreamGenContext::newPlace() { + if (data.byte(kNeedtotravel) == 1) { + data.byte(kNeedtotravel) = 0; + selectLocation(); + } else if (data.byte(kAutolocation) != 0xFF) { + data.byte(kNewlocation) = data.byte(kAutolocation); + data.byte(kAutolocation) = 0xFF; + } +} + +void DreamGenContext::showPuzText() { + showPuzText(al, cx); +} + +void DreamGenContext::showPuzText(uint16 command, uint16 count) { + findPuzText(); // FIXME: Unnecessary? (Input: al, Output: es:si) + createPanel(); + showPanel(); + showMan(); + showExit(); + obIcons(); + uint16 offset = kTextstart + getSegment(data.word(kPuzzletext)).word(command * 2); + const uint8 *string = getSegment(data.word(kPuzzletext)).ptr(offset, 0); + printDirect(string, 36, 104, 241, 241 & 1); + workToScreenM(); + hangOnP(count); +} + +void DreamGenContext::monkSpeaking() { + // FIXME: This is the CD version only. + + data.byte(kRoomssample) = 35; + loadRoomsSample(); + loadIntoTemp("DREAMWEB.G15"); + clearWork(); + showFrame(tempGraphics(), 160, 72, 0, 128); // show monk + workToScreen(); + data.byte(kVolume) = 7; + data.byte(kVolumedirection) = 0xFF; + data.byte(kVolumeto) = 5; + playChannel0(12, 255); + fadeScreenUps(); + hangOn(300); + + for (int i = 40; i <= 48; i++) { + loadSpeech('T', 83, 'T', i); + + playChannel1(50 + 12); + + do { + engine->waitForVSync(); + } while (data.byte(kCh1playing) != 255); + } + + data.byte(kVolumedirection) = 1; + data.byte(kVolumeto) = 7; + fadeScreenDowns(); + hangOn(300); + getRidOfTemp(); +} + +void DreamGenContext::useButtonA() { + if (!isSetObOnMap(95)) { + showFirstUse(); + turnAnyPathOn(0, data.byte(kRoomnum) - 1); + removeSetObject(9); + placeSetObject(95); + data.word(kWatchingtime) = 15 * 2; + data.word(kReeltowatch) = 71; + data.word(kEndwatchreel) = 85; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; + } else { + // Done this bit + showSecondUse(); + putBackObStuff(); + } +} + +void DreamGenContext::autoAppear() { + if (data.byte(kLocation) == 32) { + // In alley + al = 5; + resetLocation(); + setLocation(10); + data.byte(kDestpos) = 10; + return; + } + + if (data.byte(kReallocation) == 24) { + // In Eden's apartment + if (data.byte(kGeneraldead) == 1) { + data.byte(kGeneraldead)++; + placeSetObject(44); + placeSetObject(18); + placeSetObject(93); + removeSetObject(92); + removeSetObject(55); + removeSetObject(75); + removeSetObject(84); + removeSetObject(85); + } else if (data.byte(kSartaindead) == 1) { + // Eden's part 2 + removeSetObject(44); + removeSetObject(93); + placeSetObject(55); + data.byte(kSartaindead)++; + } + } else { + // Not in Eden's + if (data.byte(kReallocation) == 25) { + // Sart roof + data.byte(kNewsitem) = 3; + al = 6; + resetLocation(); + setLocation(11); + data.byte(kDestpos) = 11; + } else { + if (data.byte(kReallocation) == 2 && data.byte(kRockstardead) != 0) + placeSetObject(23); + } + } +} + +void DreamGenContext::quitKey() { + if (data.byte(kCommandtype) != 222) { + data.byte(kCommandtype) = 222; + commandOnly(4); + } + + if (data.word(kMousebutton) != data.word(kOldbutton) && (data.word(kMousebutton) & 1)) + data.byte(kGetback) = 1; +} +} // End of namespace DreamGen diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index d25a8d13b7..4308bd54ea 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -19,231 +19,554 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ - uint16 allocatemem(uint16 paragraphs); - uint8 *workspace(); - void allocatework(); - void clearwork(); - void multidump(); - void multidump(uint16 x, uint16 y, uint8 width, uint8 height); - void frameoutv(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, int16 x, int16 y); - void frameoutnm(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y); - void frameoutbh(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y); - void frameoutfx(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y); - void worktoscreen(); - void multiget(); - void multiget(uint8 *dst, uint16 x, uint16 y, uint8 width, uint8 height); - void convertkey(); - void cls(); - void printsprites(); - void quickquit(); - void readoneblock(); - void printundermon(); - void seecommandtail(); - void randomnumber(); - void quickquit2(); - uint8 getnextword(const Frame *charSet, const uint8 *string, uint8 *totalWidth, uint8 *charCount); - void printboth(const Frame* charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar); - void printchar(); - void printchar(const Frame* charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height); - void printdirect(); - void printdirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered); - void printdirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered); - void printmessage(uint16 x, uint16 y, uint8 index, uint8 maxWidth, bool centered); - void printmessage(); - void usetimedtext(); - void dumptimedtext(); - void setuptimedtemp(); - void setuptimedtemp(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount); - void getundertimed(); - void putundertimed(); - uint8 printslow(const uint8 *string, uint16 x, uint16 y, uint8 maxWidth, bool centered); - void printslow(); - void dumptextline(); - void getnumber(); - uint8 getnumber(const Frame *charSet, const uint8 *string, uint16 maxWidth, bool centered, uint16 *offset); - uint8 kernchars(uint8 firstChar, uint8 secondChar, uint8 width); - void getroomdata(); - void readheader(); - void fillspace(); - void startloading(); - void startloading(const Room *room); - Sprite *spritetable(); - void showframe(); - void showframe(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height); - void showframe(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag); - void printasprite(const Sprite *sprite); +#ifndef DREAMWEB_STUBS_H +#define DREAMWEB_STUBS_H + + void screenUpdate(); + void startup(); + void startup1(); + void switchRyanOn(); + void switchRyanOff(); + uint16 allocateMem(uint16 paragraphs); + void deallocateMem(uint16 segment); + uint16 standardLoad(const char *fileName, uint16 *outSizeInBytes = NULL); // Returns a segment handle which needs to be freed with deallocatemem for symmetry + void *standardLoadCPP(const char *fileName, uint16 *outSizeInBytes = NULL); // And this one should be 'free'd + void loadIntoTemp(); + void loadIntoTemp(const char *fileName); + void loadIntoTemp2(const char *fileName); + void loadIntoTemp3(const char *fileName); + void loadTempCharset(); + void loadTempCharset(const char *fileName); + void saveLoad(); + void delChar(); + void hangOnCurs(uint16 frameCount); + void hangOnCurs(); + void workToScreen(); + void multiGet(); + void multiGet(uint8 *dst, uint16 x, uint16 y, uint8 width, uint8 height) { + DreamBase::multiGet(dst, x, y, width, height); + } + void multiPut(); + void multiPut(const uint8 *src, uint16 x, uint16 y, uint8 width, uint8 height) { + DreamBase::multiPut(src, x, y, width, height); + } + void multiDump(); + 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) { + return DreamBase::printDirect(string, x, y, maxWidth, centered); + } + uint8 printDirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered) { + return DreamBase::printDirect(string, x, y, maxWidth, centered); + } + void printMessage(uint16 x, uint16 y, uint8 index, uint8 maxWidth, bool centered); + void printMessage(); + void useTimedText(); + void dumpTimedText(); + void setupTimedTemp(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount); + void getUnderTimed(); + void putUnderTimed(); + void dumpTextLine(); + void oldToNames(); + void namesToOld(); + void startLoading(const Room &room); + void showFrame(); + void showFrame(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height) { + DreamBase::showFrame(frameData, x, y, frameNumber, effectsFlag, width, height); + } + 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 multiput(const uint8 *src, uint16 x, uint16 y, uint8 width, uint8 height); - void multiput(); - void eraseoldobs(); - void clearsprites(); - Sprite *makesprite(uint8 x, uint8 y, uint16 updateCallback, uint16 frameData, uint16 somethingInDi); - void spriteupdate(); - void initman(); - void mainman(Sprite *sprite); - void facerightway(); + void eraseOldObs(); + 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 autosetwalk(); - void checkdest(const RoomPaths *roomsPaths); - void aboutturn(Sprite *sprite); - void backobject(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 random(Sprite *sprite, SetObject *objData); - void dodoor(); - void dodoor(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 findsource(); - Frame *findsourceCPP(); - void showgamereel(); - void showgamereel(ReelRoutine *routine); - void showreelframe(); - void showreelframe(Reel *reel); - const Frame *getreelframeax(uint16 frame); - 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(); - RoomPaths *getroomspaths(); - void makebackob(SetObject *objData); - void modifychar(); - void lockmon(); - void cancelch0(); - void cancelch1(); - void plotreel(); - Reel *getreelstart(); - void dealwithspecial(uint8 firstParam, uint8 secondParam); + void wideDoor(Sprite *sprite, SetObject *objData); + void lockedDoorway(Sprite *sprite, SetObject *objData); + void liftSprite(Sprite *sprite, SetObject *objData); + void showGameReel(); + 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 crosshair(); - void showrain(); - void deltextline(); - void commandonly(); - void commandonly(uint8 command); - void doblocks(); - void checkifperson(); - bool checkifperson(uint8 x, uint8 y); - void checkiffree(); - bool checkiffree(uint8 x, uint8 y); - 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 showpanel(); - void updatepeople(); - void madmantext(); - void madmode(); - void movemap(uint8 param); - bool addalong(const uint8 *mapFlags); - bool addlength(const uint8 *mapFlags); - void getdimension(); - void getdimension(uint8 *mapXstart, uint8 *mapYstart, uint8 *mapXsize, uint8 *mapYsize); - void getmapad(); - void calcmapad(); - uint8 getmapad(const uint8 *setData); - uint8 getxad(const uint8 *setData, uint8 *result); - uint8 getyad(const uint8 *setData, uint8 *result); - void calcfrframe(); - void calcfrframe(uint8* width, uint8* height); - void finalframe(); - void finalframe(uint16 *x, uint16 *y); - void showallobs(); - void blocknametext(); - void walktotext(); - void personnametext(); - void findxyfrompath(); - void findormake(); - void findormake(uint8 index, uint8 value, uint8 type); - DynObject *getfreead(uint8 index); - DynObject *getexad(uint8 index); - DynObject *geteitheradCPP(); - SetObject *getsetad(uint8 index); - void *getanyad(uint8 *value1, uint8 *value2); - void *getanyaddir(uint8 index, uint8 flag); - void setallchanges(); - void dochange(); - void dochange(uint8 index, uint8 value, uint8 type); - void deletetaken(); + void showRain(); + void delTextLine(); + void commandOnly(); + void commandOnly(uint8 command); + void doBlocks(); + void checkIfPerson(); + bool checkIfPerson(uint8 x, uint8 y); + void checkIfFree(); + bool checkIfFree(uint8 x, uint8 y); + 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(); + void getDimension(uint8 *mapXstart, uint8 *mapYstart, uint8 *mapXsize, uint8 *mapYsize); + void getMapAd(); + void calcMapAd(); + uint8 getMapAd(const uint8 *setData); + uint8 getXAd(const uint8 *setData, uint8 *result); + uint8 getYAd(const uint8 *setData, uint8 *result); + void calcFrFrame(uint16 frame); + void calcFrFrame(uint16 frame, uint8* width, uint8* height); + void finalFrame(); + void finalFrame(uint16 *x, uint16 *y); + void showAllObs(); + void blockNameText(); + void walkToText(); + void personNameText(); + DynObject *getFreeAd(uint8 index) { + return DreamBase::getFreeAd(index); + } + DynObject *getExAd(uint8 index) { + return DreamBase::getExAd(index); + } + DynObject *getEitherAdCPP(); + void *getAnyAd(uint8 *value1, uint8 *value2) { + return DreamBase::getAnyAd(value1, value2); + } + SetObject *getSetAd(uint8 index) { + return DreamBase::getSetAd(index); + } + void *getAnyAdDir(uint8 index, uint8 flag); + void setAllChanges(); + void doChange(uint8 index, uint8 value, uint8 type); + void deleteTaken(); bool isCD(); - void placesetobject(); - void placesetobject(uint8 index); - void removesetobject(); - void removesetobject(uint8 index); - void showallfree(); - void showallex(); - bool finishedwalkingCPP(); - void finishedwalking(); - void checkone(); - void checkone(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uint8 *type, uint8 *flagX, uint8 *flagY); - void getflagunderp(); - void getflagunderp(uint8 *flag, uint8 *flagEx); - void walkandexamine(); - void obname(); - void obname(uint8 command, uint8 commandType); - void delpointer(); - void showblink(); - void dumpblink(); - void dumppointer(); - void showpointer(); - void animpointer(); - void checkcoords(); - void checkcoords(const RectWithCallback *rectWithCallbacks); - void readmouse(); - void readmouse1(); - void readmouse2(); - void readmouse3(); - void readmouse4(); - uint16 waitframes(); - void drawflags(); - void addtopeoplelist(); - void addtopeoplelist(ReelRoutine *routine); - void getexpos(); - void paneltomap(); - void maptopanel(); - void dumpmap(); - void obpicture(); - void transferinv(); - void obicons(); + void placeSetObject(); + void placeSetObject(uint8 index); + void removeSetObject(); + void removeSetObject(uint8 index); + void showAllFree(); + void showAllEx(); + bool finishedWalkingCPP(); + void finishedWalking(); + void checkOne(); + void checkOne(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uint8 *type, uint8 *flagX, uint8 *flagY); + void getFlagUnderP(); + void getFlagUnderP(uint8 *flag, uint8 *flagEx); + void walkAndExamine(); + void obName(); + void obName(uint8 command, uint8 commandType); + void animPointer(); + void checkCoords(const RectWithCallback *rectWithCallbacks); + void drawFlags(); + void addToPeopleList(); + void addToPeopleList(ReelRoutine *routine); + void getExPos(); + void obPicture(); void compare(); bool compare(uint8 index, uint8 flag, const char id[4]); - bool pixelcheckset(const ObjPos *pos, uint8 x, uint8 y); - bool isitdescribed(const ObjPos *objPos); - void checkifset(); - bool checkifset(uint8 x, uint8 y); - void checkifpathison(); - bool checkifpathison(uint8 index); - void isitworn(); - bool isitworn(const DynObject *object); - void makeworn(); - void makeworn(DynObject *object); - void obtoinv(); - void obtoinv(uint8 index, uint8 flag, uint16 x, uint16 y); - void showryanpage(); - void findallryan(); - void findallryan(uint8 *inv); - void fillryan(); - void useroutine(); - void hangon(); - void hangon(uint16 frameCount); - void hangonp(); - void hangonp(uint16 count); - uint8 findnextcolon(uint8 **string); - void findnextcolon(); - uint8 *getobtextstartCPP(); - void usetext(const uint8 *string); - void usetext(); - void getblockofpixel(); - uint8 getblockofpixel(uint8 x, uint8 y); - void bresenhams(); - void examineobtext(); - + bool pixelCheckSet(const ObjPos *pos, uint8 x, uint8 y); + bool isItDescribed(const ObjPos *objPos); + void checkIfSet(); + bool checkIfSet(uint8 x, uint8 y); + void checkIfPathIsOn(); + bool checkIfPathIsOn(uint8 index); + void isItWorn(); + bool isItWorn(const DynObject *object); + void wornError(); + void makeWorn(); + void makeWorn(DynObject *object); + void obToInv(); + void obToInv(uint8 index, uint8 flag, uint16 x, uint16 y); + void findAllRyan(); + void findAllRyan(uint8 *inv); + void fillRyan(); + void useRoutine(); + void hangOn(); + void hangOn(uint16 frameCount) { + DreamBase::hangOn(frameCount); + } + void hangOnW(); + void hangOnW(uint16 frameCount); + void hangOnP(); + void hangOnP(uint16 count); + void showIcon(); + uint8 findNextColon(uint8 **string); + void findNextColon(); + uint8 *getObTextStartCPP(); + void useText(const uint8 *string); + void useText(); + void getBlockOfPixel(); + uint8 getBlockOfPixel(uint8 x, uint8 y); + void examineObText(); + void sortOutMap(); + void showCity(); + uint16 getPersFrame(uint8 index); + void convIcons(); + void examineOb(bool examineAgain = true); + void dumpWatch(); + void roomName(); + void transferText(); + void initRain(); + Rain *splitIntoLines(uint8 x, uint8 y, Rain *rain); + void watchCount(); + void zoomIcon(); + void loadRoom(); + void getUnderMenu(); + void putUnderMenu(); + void textForMonk(); + void textForMonkHelper(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount); + void textForEnd(); + 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 input(); + void monPrint(); + const char *monPrint(const char *string) { + return DreamBase::monPrint(string); + } + void randomAccess(uint16 count); + void randomAccess(); + void monMessage(uint8 index); + void monMessage(); + void netError(); + void playChannel1(); + void playChannel1(uint8 index) { + DreamBase::playChannel1(index); + } + void showMainOps(); + void showDiscOps(); + void findRoomInLoc(); + void reelsOnScreen(); + void reconstruct(); + void look(); + void autoLook(); + void doLook(); + void useTempCharset(); + void useCharset1(); + void getBackFromOb(); + void getRidOfAll(); + void getRidOfTemp(); + void getRidOfTempText(); + void getRidOfTemp2(); + void getRidOfTemp3(); + void getRidOfTempCharset(); + void getRidOfTempsP(); + void showFirstUse(); + void showSecondUse(); + void actualSave(); + void actualLoad(); + void loadPosition(unsigned int slot); + void savePosition(unsigned int slot, const char *descbuf); + uint16 allocateAndLoad(unsigned int size); + void clearAndLoad(uint8 *buf, uint8 c, unsigned int size, unsigned int maxSize); + void clearAndLoad(uint16 seg, uint8 c, unsigned int size, unsigned int maxSize); + void loadRoomData(const Room &room, bool skipDat); + void restoreAll(); + void restoreReels(); + void enterSymbol(); + void viewFolder(); + void edensCDPlayer(); + void hotelBell(); + void playGuitar(); + void callEdensDLift(); + void callEdensLift(); + void sitDownInBar(); + void trapDoor(); + void useBalcony(); + void useChurchHole(); + void useCoveredBox(); + void useElevator1(); + void useElevator2(); + void useElevator3(); + void useElevator4(); + void useElevator5(); + void useDryer(); + void useRailing(); + void useWindow(); + void useHatch(); + void useLighter(); + void wheelSound(); + void callHotelLift(); + void useShield(); + void useWall(); + void useChurchGate(); + void useFullCart(); + void useClearBox(); + void usePlate(); + void usePlinth(); + void useElvDoor(); + void useObject(); + void useWinch(); + void useCardReader1(); + void useCardReader2(); + void useCardReader3(); + void usePoolReader(); + void useCooker(); + void useWire(); + bool defaultUseHandler(const char *id); + void openTVDoor(); + void wearWatch(); + void wearShades(); + void checkFolderCoords(); + void loadFolder(); + void showFolder(); + void showLeftPage(); + void showRightPage(); + void nextFolder(); + void lastFolder(); + void folderHints(); + void folderExit(); + uint8 getLocation(uint8 index); + void getLocation(); + void setLocation(uint8 index); + void setLocation(); + void loadTempText(); + void loadTempText(const char *fileName); + void loadTravelText(); + void drawFloor(); + void allocateBuffers(); + void workToScreenM(); + bool checkSpeed(ReelRoutine &routine); + void checkSpeed(); + void sparkyDrip(ReelRoutine &routine); + 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 priestText(ReelRoutine &routine); + void monkAndRyan(ReelRoutine &routine); + void copper(ReelRoutine &routine); + void introMonks1(ReelRoutine &routine); + void introMonks2(ReelRoutine &routine); + void soldier1(ReelRoutine &routine); + void singleKey(uint8 key, uint16 x, uint16 y); + void loadSaveBox(); + void loadKeypad(); + void showKeypad(); + void showOuterPad(); + uint8 nextSymbol(uint8 symbol); + void showSymbol(); + void examIcon(); + void buttonOne(); + void buttonTwo(); + void buttonThree(); + void buttonFour(); + void buttonFive(); + void buttonSix(); + void buttonSeven(); + void buttonEight(); + void buttonNine(); + void buttonNought(); + void buttonEnter(); + void buttonPress(uint8 buttonId); + void addToPressList(); + bool isItRight(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3); + void enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3); + unsigned int scanForNames(); + void doLoad(int slot); + void loadOld(); + void inventory(); + void mainScreen(); + void loadGame(); + void saveGame(); + void zoomOnOff(); + void atmospheres(); + void loadPersonal(); + void loadNews(); + void loadCart(); + void hangOne(uint16 delay); + void hangOne(); + void bibleQuote(); + void realCredits(); + void runIntroSeq(); + void intro(); + void clearBeforeLoad(); + void clearReels(); + void getRidOfReels(); + void liftNoise(uint8 index); + void setTopLeft(); + void setTopRight(); + void setBotLeft(); + void setBotRight(); + void newGame(); + void getBackFromOps(); + void getBackToOps(); + void pickupOb(uint8 command, uint8 pos); + void initialInv(); + void walkIntoRoom(); + void loadIntroRoom(); + void afterIntroRoom(); + void gettingShot(); + void redrawMainScrn(); + void selectSlot2(); + void blank(); + void allPointer(); + void openYourNeighbour(); + void openRyan(); + void openPoolBoss(); + void openEden(); + void openSarters(); + void openLouis(); + void DOSReturn(); + void useLadder(); + void useLadderB(); + void useCart(); + void useTrainer(); + void useHole(); + void chewy(); + void sLabDoorA(); + void sLabDoorB(); + void sLabDoorC(); + void sLabDoorE(); + void sLabDoorD(); + void sLabDoorF(); + void openHotelDoor(); + void openHotelDoor2(); + void grafittiDoor(); + void openTomb(); + void hotelControl(); + void obsThatDoThings(); + void makeMainScreen(); + void openInv(); + void delEverything(); + void clearPalette(); + void errorMessage1(); + void errorMessage2(); + void errorMessage3(); + void reExFromOpen(); + void nextDest(); + void lastDest(); + void destSelect(); + void putBackObStuff(); + void moreTalk(); + void redes(); + void isSetObOnMap(); + bool isSetObOnMap(uint8 index); + void dumpKeypad(); + void dumpSymbol(); + void dumpSymBox(); + 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 examineInventory(); + 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(); + void underTextLine(); + void getUnderZoom(); + void putUnderZoom(); + void decide(); + void talk(); + void discOps(); + void doSaveLoad(); + void useDiary(); + void hangOnPQ(); + void showGun(); + void endGame(); + void monitorLogo(); + void quitSymbol(); + void diaryKeyP(); + void diaryKeyN(); + void checkInput(); + void dropError(); + void cantDrop(); + void getBack1(); + void newPlace(); + void showPuzText(uint16 command, uint16 count); + void showPuzText(); + void monkSpeaking(); + void rollEndCredits2(); + void useButtonA(); + void autoAppear(); + void quitKey(); +#endif diff --git a/engines/dreamweb/talk.cpp b/engines/dreamweb/talk.cpp new file mode 100644 index 0000000000..86d1b886ef --- /dev/null +++ b/engines/dreamweb/talk.cpp @@ -0,0 +1,38 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "dreamweb/dreamweb.h" + +namespace DreamGen { + +uint16 DreamGenContext::getPersFrame(uint8 index) { + return getSegment(data.word(kPeople)).word(kPersonframes + index * 2); +} + +void DreamGenContext::convIcons() { + uint8 index = data.byte(kCharacter) & 127; + uint16 frame = getPersFrame(index); + const Frame *base = findSource(frame); + showFrame(base, 234, 2, frame, 0); +} + +} // End of namespace DreamGen diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index d6648b556e..0990e5ba5e 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -27,95 +27,98 @@ namespace DreamGen { typedef void (DreamGenContext::*UseCallback)(void); +// Note: The callback pointer has been placed before the +// ID to keep MSVC happy (otherwise, it throws warnings +// that alignment of a member was sensitive to packing) struct UseListEntry { - uint8 id[5]; // 0-terminal because it is easier syntatically to initialize the array UseCallback callback; + const char *id; }; -void DreamGenContext::useroutine() { +void DreamGenContext::useRoutine() { static const UseListEntry kUseList[] = { - { "NETW", &DreamGenContext::usemon }, - { "ELVA", &DreamGenContext::useelevator1 }, - { "ELVB", &DreamGenContext::useelevator2 }, - { "ELVC", &DreamGenContext::useelevator3 }, - { "ELVE", &DreamGenContext::useelevator4 }, - { "ELVF", &DreamGenContext::useelevator5 }, - { "CGAT", &DreamGenContext::usechurchgate }, - { "REMO", &DreamGenContext::usestereo }, - { "BUTA", &DreamGenContext::usebuttona }, - { "CBOX", &DreamGenContext::usewinch }, - { "LITE", &DreamGenContext::uselighter }, - { "PLAT", &DreamGenContext::useplate }, - { "LIFT", &DreamGenContext::usecontrol }, - { "WIRE", &DreamGenContext::usewire }, - { "HNDL", &DreamGenContext::usehandle }, - { "HACH", &DreamGenContext::usehatch }, - { "DOOR", &DreamGenContext::useelvdoor }, - { "CSHR", &DreamGenContext::usecashcard }, - { "GUNA", &DreamGenContext::usegun }, - { "CRAA", &DreamGenContext::usecardreader1 }, - { "CRBB", &DreamGenContext::usecardreader2 }, - { "CRCC", &DreamGenContext::usecardreader3 }, - { "SEAT", &DreamGenContext::sitdowninbar }, - { "MENU", &DreamGenContext::usemenu }, - { "COOK", &DreamGenContext::usecooker }, - { "ELCA", &DreamGenContext::callhotellift }, - { "EDCA", &DreamGenContext::calledenslift }, - { "DDCA", &DreamGenContext::calledensdlift }, - { "ALTR", &DreamGenContext::usealtar }, - { "LOKA", &DreamGenContext::openhoteldoor }, - { "LOKB", &DreamGenContext::openhoteldoor2 }, - { "ENTA", &DreamGenContext::openlouis }, - { "ENTB", &DreamGenContext::openryan }, - { "ENTE", &DreamGenContext::openpoolboss }, - { "ENTC", &DreamGenContext::openyourneighbour }, - { "ENTD", &DreamGenContext::openeden }, - { "ENTH", &DreamGenContext::opensarters }, - { "WWAT", &DreamGenContext::wearwatch }, - { "POOL", &DreamGenContext::usepoolreader }, - { "WSHD", &DreamGenContext::wearshades }, - { "GRAF", &DreamGenContext::grafittidoor }, - { "TRAP", &DreamGenContext::trapdoor }, - { "CDPE", &DreamGenContext::edenscdplayer }, - { "DLOK", &DreamGenContext::opentvdoor }, - { "HOLE", &DreamGenContext::usehole }, - { "DRYR", &DreamGenContext::usedryer }, - { "HOLY", &DreamGenContext::usechurchhole }, - { "WALL", &DreamGenContext::usewall }, - { "BOOK", &DreamGenContext::usediary }, - { "AXED", &DreamGenContext::useaxe }, - { "SHLD", &DreamGenContext::useshield }, - { "BCNY", &DreamGenContext::userailing }, - { "LIDC", &DreamGenContext::usecoveredbox }, - { "LIDU", &DreamGenContext::useclearbox }, - { "LIDO", &DreamGenContext::useopenbox }, - { "PIPE", &DreamGenContext::usepipe }, - { "BALC", &DreamGenContext::usebalcony }, - { "WIND", &DreamGenContext::usewindow }, - { "PAPR", &DreamGenContext::viewfolder }, - { "UWTA", &DreamGenContext::usetrainer }, - { "UWTB", &DreamGenContext::usetrainer }, - { "STAT", &DreamGenContext::entersymbol }, - { "TLID", &DreamGenContext::opentomb }, - { "SLAB", &DreamGenContext::useslab }, - { "CART", &DreamGenContext::usecart }, - { "FCAR", &DreamGenContext::usefullcart }, - { "SLBA", &DreamGenContext::slabdoora }, - { "SLBB", &DreamGenContext::slabdoorb }, - { "SLBC", &DreamGenContext::slabdoorc }, - { "SLBD", &DreamGenContext::slabdoord }, - { "SLBE", &DreamGenContext::slabdoore }, - { "SLBF", &DreamGenContext::slabdoorf }, - { "PLIN", &DreamGenContext::useplinth }, - { "LADD", &DreamGenContext::useladder }, - { "LADB", &DreamGenContext::useladderb }, - { "GUMA", &DreamGenContext::chewy }, - { "SQEE", &DreamGenContext::wheelsound }, - { "TAPP", &DreamGenContext::runtap }, - { "GUIT", &DreamGenContext::playguitar }, - { "CONT", &DreamGenContext::hotelcontrol }, - { "BELL", &DreamGenContext::hotelbell }, + { &DreamGenContext::useMon, "NETW" }, + { &DreamGenContext::useElevator1, "ELVA" }, + { &DreamGenContext::useElevator2, "ELVB" }, + { &DreamGenContext::useElevator3, "ELVC" }, + { &DreamGenContext::useElevator4, "ELVE" }, + { &DreamGenContext::useElevator5, "ELVF" }, + { &DreamGenContext::useChurchGate, "CGAT" }, + { &DreamGenContext::useStereo, "REMO" }, + { &DreamGenContext::useButtonA, "BUTA" }, + { &DreamGenContext::useWinch, "CBOX" }, + { &DreamGenContext::useLighter, "LITE" }, + { &DreamGenContext::usePlate, "PLAT" }, + { &DreamGenContext::useControl, "LIFT" }, + { &DreamGenContext::useWire, "WIRE" }, + { &DreamGenContext::useHandle, "HNDL" }, + { &DreamGenContext::useHatch, "HACH" }, + { &DreamGenContext::useElvDoor, "DOOR" }, + { &DreamGenContext::useCashCard, "CSHR" }, + { &DreamGenContext::useGun, "GUNA" }, + { &DreamGenContext::useCardReader1, "CRAA" }, + { &DreamGenContext::useCardReader2, "CRBB" }, + { &DreamGenContext::useCardReader3, "CRCC" }, + { &DreamGenContext::sitDownInBar, "SEAT" }, + { &DreamGenContext::useMenu, "MENU" }, + { &DreamGenContext::useCooker, "COOK" }, + { &DreamGenContext::callHotelLift, "ELCA" }, + { &DreamGenContext::callEdensLift, "EDCA" }, + { &DreamGenContext::callEdensDLift, "DDCA" }, + { &DreamGenContext::useAltar, "ALTR" }, + { &DreamGenContext::openHotelDoor, "LOKA" }, + { &DreamGenContext::openHotelDoor2, "LOKB" }, + { &DreamGenContext::openLouis, "ENTA" }, + { &DreamGenContext::openRyan, "ENTB" }, + { &DreamGenContext::openPoolBoss, "ENTE" }, + { &DreamGenContext::openYourNeighbour, "ENTC" }, + { &DreamGenContext::openEden, "ENTD" }, + { &DreamGenContext::openSarters, "ENTH" }, + { &DreamGenContext::wearWatch, "WWAT" }, + { &DreamGenContext::usePoolReader, "POOL" }, + { &DreamGenContext::wearShades, "WSHD" }, + { &DreamGenContext::grafittiDoor, "GRAF" }, + { &DreamGenContext::trapDoor, "TRAP" }, + { &DreamGenContext::edensCDPlayer, "CDPE" }, + { &DreamGenContext::openTVDoor, "DLOK" }, + { &DreamGenContext::useHole, "HOLE" }, + { &DreamGenContext::useDryer, "DRYR" }, + { &DreamGenContext::useChurchHole, "HOLY" }, + { &DreamGenContext::useWall, "WALL" }, + { &DreamGenContext::useDiary, "BOOK" }, + { &DreamGenContext::useAxe, "AXED" }, + { &DreamGenContext::useShield, "SHLD" }, + { &DreamGenContext::useRailing, "BCNY" }, + { &DreamGenContext::useCoveredBox, "LIDC" }, + { &DreamGenContext::useClearBox, "LIDU" }, + { &DreamGenContext::useOpenBox, "LIDO" }, + { &DreamGenContext::usePipe, "PIPE" }, + { &DreamGenContext::useBalcony, "BALC" }, + { &DreamGenContext::useWindow, "WIND" }, + { &DreamGenContext::viewFolder, "PAPR" }, + { &DreamGenContext::useTrainer, "UWTA" }, + { &DreamGenContext::useTrainer, "UWTB" }, + { &DreamGenContext::enterSymbol, "STAT" }, + { &DreamGenContext::openTomb, "TLID" }, + { &DreamGenContext::useSLab, "SLAB" }, + { &DreamGenContext::useCart, "CART" }, + { &DreamGenContext::useFullCart, "FCAR" }, + { &DreamGenContext::sLabDoorA, "SLBA" }, + { &DreamGenContext::sLabDoorB, "SLBB" }, + { &DreamGenContext::sLabDoorC, "SLBC" }, + { &DreamGenContext::sLabDoorD, "SLBD" }, + { &DreamGenContext::sLabDoorE, "SLBE" }, + { &DreamGenContext::sLabDoorF, "SLBF" }, + { &DreamGenContext::usePlinth, "PLIN" }, + { &DreamGenContext::useLadder, "LADD" }, + { &DreamGenContext::useLadderB, "LADB" }, + { &DreamGenContext::chewy, "GUMA" }, + { &DreamGenContext::wheelSound, "SQEE" }, + { &DreamGenContext::runTap, "TAPP" }, + { &DreamGenContext::playGuitar, "GUIT" }, + { &DreamGenContext::hotelControl, "CONT" }, + { &DreamGenContext::hotelBell, "BELL" }, }; if (data.byte(kReallocation) >= 50) { @@ -124,7 +127,7 @@ void DreamGenContext::useroutine() { data.byte(kPointerpower) = 0; } - getanyad(); + getAnyAd(); const uint8 *id = es.ptr(bx + 12, 4); for (size_t i = 0; i < sizeof(kUseList)/sizeof(UseListEntry); ++i) { @@ -135,44 +138,1090 @@ void DreamGenContext::useroutine() { } } - delpointer(); - uint8 *obText = getobtextstartCPP(); - if (findnextcolon(&obText) != 0) { - if (findnextcolon(&obText) != 0) { + delPointer(); + uint8 *obText = getObTextStartCPP(); + if (findNextColon(&obText) != 0) { + if (findNextColon(&obText) != 0) { if (*obText != 0) { - usetext(obText); - hangonp(400); - putbackobstuff(); + useText(obText); + hangOnP(400); + putBackObStuff(); return; } } } - createpanel(); - showpanel(); - showman(); - showexit(); - obicons(); - printmessage(33, 100, 63, 241, true); - worktoscreenm(); - hangonp(50); - putbackobstuff(); + createPanel(); + showPanel(); + showMan(); + showExit(); + obIcons(); + printMessage(33, 100, 63, 241, true); + workToScreenM(); + hangOnP(50); + putBackObStuff(); data.byte(kCommandtype) = 255; } -void DreamGenContext::usetext() { - usetext(es.ptr(si, 0)); +void DreamGenContext::useText() { + useText(es.ptr(si, 0)); } -void DreamGenContext::usetext(const uint8 *string) { - createpanel(); - showpanel(); - showman(); - showexit(); - obicons(); - printdirect(string, 36, 104, 241, true); - worktoscreenm(); +void DreamGenContext::useText(const uint8 *string) { + createPanel(); + showPanel(); + showMan(); + showExit(); + obIcons(); + printDirect(string, 36, 104, 241, true); + workToScreenM(); } -} /*namespace dreamgen */ +void DreamGenContext::showFirstUse() { + uint8 *obText = getObTextStartCPP(); + findNextColon(&obText); + findNextColon(&obText); + useText(obText); + hangOnP(400); +} + +void DreamGenContext::showSecondUse() { + uint8 *obText = getObTextStartCPP(); + findNextColon(&obText); + findNextColon(&obText); + findNextColon(&obText); + useText(obText); + hangOnP(400); +} + +void DreamGenContext::viewFolder() { + data.byte(kManisoffscreen) = 1; + getRidOfAll(); + loadFolder(); + data.byte(kFolderpage) = 0; + showFolder(); + workToScreenM(); + data.byte(kGetback) = 0; + do { + if (quitRequested()) + break; + delPointer(); + readMouse(); + showPointer(); + vSync(); + dumpPointer(); + dumpTextLine(); + checkFolderCoords(); + } while (data.byte(kGetback) == 0); + data.byte(kManisoffscreen) = 0; + getRidOfTemp(); + getRidOfTemp2(); + getRidOfTemp3(); + getRidOfTempCharset(); + restoreAll(); + redrawMainScrn(); + workToScreenM(); +} + +void DreamGenContext::edensCDPlayer() { + showFirstUse(); + data.word(kWatchingtime) = 18 * 2; + data.word(kReeltowatch) = 25; + data.word(kEndwatchreel) = 42; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::hotelBell() { + playChannel1(12); + showFirstUse(); + putBackObStuff(); +} + +void DreamGenContext::playGuitar() { + playChannel1(14); + showFirstUse(); + putBackObStuff(); +} + +void DreamGenContext::useElevator1() { + showFirstUse(); + selectLocation(); + data.byte(kGetback) = 1; +} + +void DreamGenContext::useElevator2() { + showFirstUse(); + + if (data.byte(kLocation) == 23) // In pool hall + data.byte(kNewlocation) = 31; + else + data.byte(kNewlocation) = 23; + + data.byte(kCounttoclose) = 20; + data.byte(kCounttoopen) = 0; + data.word(kWatchingtime) = 80; + data.byte(kGetback) = 1; +} + +void DreamGenContext::useElevator3() { + showFirstUse(); + data.byte(kCounttoclose) = 20; + data.byte(kNewlocation) = 34; + data.word(kReeltowatch) = 46; + data.word(kEndwatchreel) = 63; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kWatchingtime) = 80; + data.byte(kGetback) = 1; +} + +void DreamGenContext::useElevator4() { + showFirstUse(); + data.word(kReeltowatch) = 0; + data.word(kEndwatchreel) = 11; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kCounttoclose) = 20; + data.word(kWatchingtime) = 80; + data.byte(kGetback) = 1; + data.byte(kNewlocation) = 24; +} + +void DreamGenContext::useElevator5() { + placeSetObject(4); + removeSetObject(0); + data.byte(kNewlocation) = 20; + data.word(kWatchingtime) = 80; + data.byte(kLiftflag) = 1; + data.byte(kCounttoclose) = 8; + data.byte(kGetback) = 1; +} + +void DreamGenContext::useHatch() { + showFirstUse(); + data.byte(kNewlocation) = 40; + data.byte(kGetback) = 1; +} + +void DreamGenContext::wheelSound() { + playChannel1(17); + showFirstUse(); + putBackObStuff(); +} + +void DreamGenContext::callHotelLift() { + playChannel1(12); + showFirstUse(); + data.byte(kCounttoopen) = 8; + data.byte(kGetback) = 1; + data.byte(kDestination) = 5; + data.byte(kFinaldest) = 5; + autoSetWalk(); + turnPathOn(4); +} + +void DreamGenContext::useShield() { + if (data.byte(kReallocation) != 20 || data.byte(kCombatcount) == 0) { + // Not in Sart room + showFirstUse(); + putBackObStuff(); + } else { + data.byte(kLastweapon) = 3; + showSecondUse(); + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; + removeObFromInv(); + } +} + +void DreamGenContext::useCoveredBox() { + data.byte(kProgresspoints)++; + showFirstUse(); + data.word(kWatchingtime) = 50; + data.word(kReeltowatch) = 41; + data.word(kEndwatchreel) = 66; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::useRailing() { + showFirstUse(); + data.word(kWatchingtime) = 80; + data.word(kReeltowatch) = 0; + data.word(kEndwatchreel) = 30; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + data.byte(kMandead) = 4; +} + +void DreamGenContext::wearWatch() { + if (data.byte(kWatchon) == 1) { + // Already wearing watch + showSecondUse(); + putBackObStuff(); + } else { + showFirstUse(); + data.byte(kWatchon) = 1; + data.byte(kGetback) = 1; + getAnyAd(); + makeWorn(); + } +} + +void DreamGenContext::wearShades() { + if (data.byte(kShadeson) == 1) { + // Already wearing shades + showSecondUse(); + putBackObStuff(); + } else { + data.byte(kShadeson) = 1; + showFirstUse(); + data.byte(kGetback) = 1; + getAnyAd(); + makeWorn(); + } +} + +void DreamGenContext::useChurchHole() { + showFirstUse(); + data.byte(kGetback) = 1; + data.word(kWatchingtime) = 28; + data.word(kReeltowatch) = 13; + data.word(kEndwatchreel) = 26; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; +} + +void DreamGenContext::sitDownInBar() { + if (data.byte(kWatchmode) != 0xFF) { + // Sat down + showSecondUse(); + putBackObStuff(); + } else { + showFirstUse(); + data.word(kWatchingtime) = 50; + data.word(kReeltowatch) = 55; + data.word(kEndwatchreel) = 71; + data.word(kReeltohold) = 73; + data.word(kEndofholdreel) = 83; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::useDryer() { + playChannel1(12); + showFirstUse(); + data.byte(kGetback) = 1; +} + +void DreamGenContext::useBalcony() { + showFirstUse(); + turnPathOn(6); + turnPathOff(0); + turnPathOff(1); + turnPathOff(2); + turnPathOff(3); + turnPathOff(4); + turnPathOff(5); + data.byte(kProgresspoints)++; + data.byte(kManspath) = 6; + data.byte(kDestination) = 6; + data.byte(kFinaldest) = 6; + findXYFromPath(); + switchRyanOff(); + data.byte(kResetmanxy) = 1; + data.word(kWatchingtime) = 30 * 2; + data.word(kReeltowatch) = 183; + data.word(kEndwatchreel) = 212; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::useWindow() { + if (data.byte(kManspath) != 6) { + // Not on balcony + showSecondUse(); + putBackObStuff(); + } else { + data.byte(kProgresspoints)++; + showFirstUse(); + data.byte(kNewlocation) = 29; + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::trapDoor() { + data.byte(kProgresspoints)++; + showFirstUse(); + switchRyanOff(); + data.word(kWatchingtime) = 20 * 2; + data.word(kReeltowatch) = 181; + data.word(kEndwatchreel) = 197; + data.byte(kNewlocation) = 26; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::callEdensLift() { + showFirstUse(); + data.byte(kCounttoopen) = 8; + data.byte(kGetback) = 1; + turnPathOn(2); +} + +void DreamGenContext::callEdensDLift() { + if (data.byte(kLiftflag) == 1) { + // Eden's D here + showSecondUse(); + putBackObStuff(); + } else { + showFirstUse(); + data.byte(kCounttoopen) = 8; + data.byte(kGetback) = 1; + turnPathOn(2); + } +} + +void DreamGenContext::openYourNeighbour() { + enterCode(255, 255, 255, 255); + data.byte(kGetback) = 1; +} + +void DreamGenContext::openRyan() { + enterCode(5, 1, 0, 6); + data.byte(kGetback) = 1; +} + +void DreamGenContext::openPoolBoss() { + enterCode(5, 2, 2, 2); + data.byte(kGetback) = 1; +} + +void DreamGenContext::openEden() { + enterCode(2, 8, 6, 5); + data.byte(kGetback) = 1; +} + +void DreamGenContext::openSarters() { + enterCode(7, 8, 3, 3); + data.byte(kGetback) = 1; +} + +void DreamGenContext::openLouis() { + enterCode(5, 2, 3, 8); + data.byte(kGetback) = 1; +} + + +void DreamGenContext::useWall() { + showFirstUse(); + + if (data.byte(kManspath) != 3) { + data.word(kWatchingtime) = 30*2; + data.word(kReeltowatch) = 2; + data.word(kEndwatchreel) = 31; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + turnPathOn(3); + turnPathOn(4); + turnPathOff(0); + turnPathOff(1); + turnPathOff(2); + turnPathOff(5); + data.byte(kManspath) = 3; + data.byte(kFinaldest) = 3; + findXYFromPath(); + data.byte(kResetmanxy) = 1; + switchRyanOff(); + } else { + // Go back over + data.word(kWatchingtime) = 30 * 2; + data.word(kReeltowatch) = 34; + data.word(kEndwatchreel) = 60; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + turnPathOff(3); + turnPathOff(4); + turnPathOn(0); + turnPathOn(1); + turnPathOn(2); + turnPathOn(5); + data.byte(kManspath) = 5; + data.byte(kFinaldest) = 5; + findXYFromPath(); + data.byte(kResetmanxy) = 1; + switchRyanOff(); + } +} + +void DreamGenContext::useLadder() { + showFirstUse(); + data.byte(kMapx) = data.byte(kMapx) - 11; + findRoomInLoc(); + data.byte(kFacing) = 6; + data.byte(kTurntoface) = 6; + data.byte(kManspath) = 0; + data.byte(kDestination) = 0; + data.byte(kFinaldest) = 0; + findXYFromPath(); + data.byte(kResetmanxy) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::useLadderB() { + showFirstUse(); + data.byte(kMapx) = data.byte(kMapx) + 11; + findRoomInLoc(); + data.byte(kFacing) = 2; + data.byte(kTurntoface) = 2; + data.byte(kManspath) = 1; + data.byte(kDestination) = 1; + data.byte(kFinaldest) = 1; + findXYFromPath(); + data.byte(kResetmanxy) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::sLabDoorA() { + showFirstUse(); + data.byte(kGetback) = 1; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kReeltowatch) = 13; + if (data.byte(kDreamnumber) != 3) { + // Wrong + data.word(kWatchingtime) = 40; + data.word(kEndwatchreel) = 34; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + } else { + data.byte(kProgresspoints)++; + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 42; + data.byte(kNewlocation) = 47; + } +} + +void DreamGenContext::sLabDoorB() { + if (data.byte(kDreamnumber) != 1) { + // Wrong + showFirstUse(); + data.byte(kGetback) = 1; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kReeltowatch) = 44; + data.word(kWatchingtime) = 40; + data.word(kEndwatchreel) = 63; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + } else { + al = 'S'; + ah = 'H'; + cl = 'L'; + ch = 'D'; + isRyanHolding(); + + if (flags.z()) { + // No crystal + showPuzText(44, 200); + putBackObStuff(); + } else { + // Got crystal + showFirstUse(); + data.byte(kProgresspoints)++; + data.byte(kGetback) = 1; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kReeltowatch) = 44; + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 71; + data.byte(kNewlocation) = 47; + } + } +} + +void DreamGenContext::sLabDoorC() { + showFirstUse(); + data.byte(kGetback) = 1; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kReeltowatch) = 108; + if (data.byte(kDreamnumber) != 4) { + // Wrong + data.word(kWatchingtime) = 40; + data.word(kEndwatchreel) = 127; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + } else { + data.byte(kProgresspoints)++; + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 135; + data.byte(kNewlocation) = 47; + } +} + +void DreamGenContext::sLabDoorD() { + showFirstUse(); + data.byte(kGetback) = 1; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kReeltowatch) = 75; + if (data.byte(kDreamnumber) != 0) { + // Wrong + data.word(kWatchingtime) = 40; + data.word(kEndwatchreel) = 94; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + } else { + data.byte(kProgresspoints)++; + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 102; + data.byte(kNewlocation) = 47; + } +} + +void DreamGenContext::sLabDoorE() { + showFirstUse(); + data.byte(kGetback) = 1; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kReeltowatch) = 141; + if (data.byte(kDreamnumber) != 5) { + // Wrong + data.word(kWatchingtime) = 40; + data.word(kEndwatchreel) = 160; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + } else { + data.byte(kProgresspoints)++; + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 168; + data.byte(kNewlocation) = 47; + } +} + +void DreamGenContext::sLabDoorF() { + showFirstUse(); + data.byte(kGetback) = 1; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kReeltowatch) = 171; + if (data.byte(kDreamnumber) != 2) { + // Wrong + data.word(kWatchingtime) = 40; + data.word(kEndwatchreel) = 189; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + } else { + data.byte(kProgresspoints)++; + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 197; + data.byte(kNewlocation) = 47; + } +} + +bool DreamGenContext::defaultUseHandler(const char *id) { + if (data.byte(kWithobject) == 255) { + withWhat(); + return true; // event handled + } + + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + // Wrong item + showPuzText(14, 300); + putBackObStuff(); + return true; // event handled + } + + return false; // continue with the original event +} + +void DreamGenContext::useChurchGate() { + char id[4] = { 'C', 'U', 'T', 'T' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + // Cut gate + showFirstUse(); + data.word(kWatchingtime) = 64 * 2; + data.word(kReeltowatch) = 4; + data.word(kEndwatchreel) = 70; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; + turnPathOn(3); + if (data.byte(kAidedead) != 0) + turnPathOn(2); // Open church +} + +void DreamGenContext::useFullCart() { + data.byte(kProgresspoints)++; + turnAnyPathOn(2, data.byte(kRoomnum) + 6); + data.byte(kManspath) = 4; + data.byte(kFacing) = 4; + data.byte(kTurntoface) = 4; + data.byte(kFinaldest) = 4; + findXYFromPath(); + data.byte(kResetmanxy) = 1; + showFirstUse(); + data.word(kWatchingtime) = 72 * 2; + data.word(kReeltowatch) = 58; + data.word(kEndwatchreel) = 142; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::useClearBox() { + char id[4] = { 'R', 'A', 'I', 'L' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + // Open box + data.byte(kProgresspoints)++; + showFirstUse(); + data.word(kWatchingtime) = 80; + data.word(kReeltowatch) = 67; + data.word(kEndwatchreel) = 105; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::openTVDoor() { + char id[4] = { 'U', 'L', 'O', 'K' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + // Key on TV + showFirstUse(); + data.byte(kLockstatus) = 0; + data.byte(kGetback) = 1; +} + +void DreamGenContext::usePlate() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char screw[4] = { 'S', 'C', 'R', 'W' }; // TODO: convert to string with trailing zero + char knife[4] = { 'K', 'N', 'F', 'E' }; // TODO: convert to string with trailing zero + if (compare(data.byte(kWithobject), data.byte(kWithtype), screw)) { + // Unscrew plate + playChannel1(20); + showFirstUse(); + placeSetObject(28); + placeSetObject(24); + removeSetObject(25); + placeFreeObject(0); + data.byte(kProgresspoints)++; + data.byte(kGetback) = 1; + } else if (compare(data.byte(kWithobject), data.byte(kWithtype), knife)) { + // Tried knife + showPuzText(54, 300); + putBackObStuff(); + } else { + // Wrong item + showPuzText(14, 300); + putBackObStuff(); + } +} + +void DreamGenContext::usePlinth() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'D', 'K', 'E', 'Y' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + // Wrong key + showFirstUse(); + putBackObStuff(); + } else { + data.byte(kProgresspoints)++; + showSecondUse(); + data.word(kWatchingtime) = 220; + data.word(kReeltowatch) = 0; + data.word(kEndwatchreel) = 104; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + data.byte(kNewlocation) = data.byte(kRoomafterdream); + } +} + +void DreamGenContext::useElvDoor() { + char id[4] = { 'A', 'X', 'E', 'D' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + // Axe on door + showPuzText(15, 300); + _inc(data.byte(kProgresspoints)); + data.word(kWatchingtime) = 46 * 2; + data.word(kReeltowatch) = 31; + data.word(kEndwatchreel) = 77; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::useObject() { + data.byte(kWithobject) = 255; + + if (data.byte(kCommandtype) != 229) { + data.byte(kCommandtype) = 229; + commandWithOb(51, data.byte(kObjecttype), data.byte(kCommand)); + } + + if (data.word(kMousebutton) == data.word(kOldbutton)) + return; // nouse + + if (data.word(kMousebutton) & 1) + useRoutine(); +} + +void DreamGenContext::useWinch() { + al = 40; + ah = 1; + checkInside(); + + char id[4] = { 'F', 'U', 'S', 'E' }; // TODO: convert to string with trailing zero + if (cl == kNumexobjects || !compare(cl, 4, id)) { + // No winch + showFirstUse(); + putBackObStuff(); + return; + } + + data.word(kWatchingtime) = 217 * 2; + data.word(kReeltowatch) = 0; + data.word(kEndwatchreel) = 217; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kDestpos) = 1; + data.byte(kNewlocation) = 45; + data.byte(kDreamnumber) = 1; + data.byte(kRoomafterdream) = 44; + data.byte(kGeneraldead) = 1; + data.byte(kNewsitem) = 2; + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; +} + +void DreamGenContext::useCart() { + char id[4] = { 'R', 'O', 'C', 'K' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + DynObject *exObject = getExAd(data.byte(kWithobject)); + exObject->mapad[0] = 0; + removeSetObject(data.byte(kCommand)); + placeSetObject(data.byte(kCommand) + 1); + data.byte(kProgresspoints)++; + playChannel1(17); + showFirstUse(); + data.byte(kGetback) = 1; +} + +void DreamGenContext::useTrainer() { + // TODO: Use the C++ version of getAnyAd() + getAnyAd(); + if (es.byte(bx + 2) != 4) { + notHeldError(); + } else { + data.byte(kProgresspoints)++; + makeWorn(); + showSecondUse(); + putBackObStuff(); + } +} + +void DreamGenContext::chewy() { + showFirstUse(); + // TODO: Use the C++ version of getAnyAd() + getAnyAd(); + es.byte(bx + 2) = 255; + data.byte(kGetback) = 1; +} + +void DreamGenContext::useHole() { + char id[4] = { 'H', 'N', 'D', 'A' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + showFirstUse(); + removeSetObject(86); + DynObject *exObject = getExAd(data.byte(kWithobject)); + exObject->mapad[0] = 255; + data.byte(kCanmovealtar) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::openHotelDoor() { + char id[4] = { 'K', 'E', 'Y', 'A' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + playChannel1(16); + showFirstUse(); + data.byte(kLockstatus) = 0; + data.byte(kGetback) = 1; +} + +void DreamGenContext::openHotelDoor2() { + char id[4] = { 'K', 'E', 'Y', 'A' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + playChannel1(16); + showFirstUse(); + putBackObStuff(); +} + +void DreamGenContext::grafittiDoor() { + char id[4] = { 'A', 'P', 'E', 'N' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + showFirstUse(); + putBackObStuff(); +} + +void DreamGenContext::usePoolReader() { + char id[4] = { 'M', 'E', 'M', 'B' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + if (data.byte(kTalkedtoattendant) != 1) { + // Can't open pool + showSecondUse(); + putBackObStuff(); + } else { + playChannel1(17); + showFirstUse(); + data.byte(kCounttoopen) = 6; + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::useCardReader1() { + char id[4] = { 'C', 'S', 'H', 'R' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + if (data.byte(kTalkedtosparky) == 0) { + // Not yet + showFirstUse(); + putBackObStuff(); + } else if (data.word(kCard1money) != 0) { + // No cash + showPuzText(17, 300); + putBackObStuff(); + } else { + // Get cash + playChannel1(16); + showPuzText(18, 300); + data.byte(kProgresspoints)++; + data.word(kCard1money) = 12432; + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::useCardReader2() { + char id[4] = { 'C', 'S', 'H', 'R' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + if (data.byte(kTalkedtoboss) == 0) { + // Haven't talked to boss + showFirstUse(); + putBackObStuff(); + } else if (data.byte(kCard1money) == 0) { + // No cash + showPuzText(20, 300); + putBackObStuff(); + } else if (data.byte(kGunpassflag) == 2) { + // Already got new + showPuzText(22, 300); + putBackObStuff(); + } else { + playChannel1(18); + showPuzText(19, 300); + placeSetObject(94); + data.byte(kGunpassflag) = 1; + data.word(kCard1money) -= 2000; + data.byte(kProgresspoints)++; + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::useCardReader3() { + char id[4] = { 'C', 'S', 'H', 'R' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + if (data.byte(kTalkedtorecep) == 0) { + // Haven't talked to receptionist + showFirstUse(); + putBackObStuff(); + } else if (data.byte(kCardpassflag) != 0) { + // Already used it + showPuzText(26, 300); + putBackObStuff(); + } else { + playChannel1(16); + showPuzText(25, 300); + data.byte(kProgresspoints)++; + data.word(kCard1money) -= 8300; + data.byte(kCardpassflag) = 1; + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::useLighter() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'S', 'M', 'K', 'E' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + showFirstUse(); + putBackObStuff(); + } else { + showPuzText(9, 300); + DynObject *withObj = getExAd(data.byte(kWithobject)); + withObj->mapad[0] = 255; + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::useWire() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char knife[4] = { 'K', 'N', 'F', 'E' }; // TODO: convert to string with trailing zero + if (compare(data.byte(kWithobject), data.byte(kWithtype), knife)) { + removeSetObject(51); + placeSetObject(52); + showPuzText(11, 300); + data.byte(kProgresspoints)++; + data.byte(kGetback) = 1; + return; + } + + char axe[4] = { 'A', 'X', 'E', 'D' }; // TODO: convert to string with trailing zero + if (compare(data.byte(kWithobject), data.byte(kWithtype), axe)) { + showPuzText(16, 300); + putBackObStuff(); + return; + } + + showPuzText(14, 300); + putBackObStuff(); +} + +void DreamGenContext::openTomb() { + data.byte(kProgresspoints)++; + showFirstUse(); + data.word(kWatchingtime) = 35 * 2; + data.word(kReeltowatch) = 1; + data.word(kEndwatchreel) = 33; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::hotelControl() { + if (data.byte(kReallocation) != 21 || data.byte(kMapx) != 33) + showSecondUse(); // Not right control + else + showFirstUse(); + + putBackObStuff(); +} + +void DreamGenContext::useCooker() { + al = data.byte(kCommand); + ah = data.byte(kObjecttype); + checkInside(); + + if (cl == 114) + showFirstUse(); + else + showSecondUse(); // Food inside + + putBackObStuff(); +} + +void DreamBase::placeFreeObject(uint8 index) { + findOrMake(index, 0, 1); + getFreeAd(index)->mapad[0] = 0; +} + +void DreamBase::removeFreeObject(uint8 index) { + getFreeAd(index)->mapad[0] = 0xFF; +} + +void DreamGenContext::useDiary() { + getRidOfReels(); + loadIntoTemp("DREAMWEB.G14"); + loadTempText("DREAMWEB.T51"); + loadTempCharset("DREAMWEB.C02"); + createPanel(); + showIcon(); + showDiary(); + underTextLine(); + showDiaryPage(); + readMouse(); + showPointer(); + workToScreenCPP(); + delPointer(); + data.byte(kGetback) = 0; + + RectWithCallback diaryList[] = { + { kDiaryx+94,kDiaryx+110,kDiaryy+97,kDiaryy+113,&DreamGenContext::diaryKeyN }, + { kDiaryx+151,kDiaryx+167,kDiaryy+71,kDiaryy+87,&DreamGenContext::diaryKeyP }, + { kDiaryx+176,kDiaryx+192,kDiaryy+108,kDiaryy+124,&DreamGenContext::quitKey }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + + do { + delPointer(); + readMouse(); + showDiaryKeys(); + showPointer(); + vSync(); + dumpPointer(); + dumpDiaryKeys(); + dumpTextLine(); + checkCoords(diaryList); + } while (!data.byte(kGetback)); + + getRidOfTemp(); + getRidOfTempText(); + getRidOfTempCharset(); + restoreReels(); + data.byte(kManisoffscreen) = 0; + redrawMainScrn(); + workToScreenM(); +} +} // End of namespace DreamGen diff --git a/engines/dreamweb/vgafades.cpp b/engines/dreamweb/vgafades.cpp new file mode 100644 index 0000000000..ca63b7308c --- /dev/null +++ b/engines/dreamweb/vgafades.cpp @@ -0,0 +1,255 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "dreamweb/dreamweb.h" + +namespace DreamGen { + +uint8 *DreamBase::mainPalette() { + return getSegment(data.word(kBuffers)).ptr(kMaingamepal, 256 * 3); +} + +uint8 *DreamBase::startPalette() { + return getSegment(data.word(kBuffers)).ptr(kStartpal, 256 * 3); +} + +uint8 *DreamBase::endPalette() { + return getSegment(data.word(kBuffers)).ptr(kEndpal, 256 * 3); +} + +void DreamBase::clearStartPal() { + memset(startPalette(), 0, 256 * 3); +} + +void DreamBase::clearEndPal() { + memset(endPalette(), 0, 256 * 3); +} + +void DreamBase::palToStartPal() { + memcpy(startPalette(), mainPalette(), 256 * 3); +} + +void DreamBase::endPalToStart() { + memcpy(startPalette(), endPalette(), 256 * 3); +} + +void DreamBase::startPalToEnd() { + memcpy(endPalette(), startPalette(), 256 * 3); +} + +void DreamBase::palToEndPal() { + memcpy(endPalette(), mainPalette(), 256 * 3); +} + +void DreamBase::fadeDOS() { + return; // FIXME later + + engine->waitForVSync(); + //processEvents will be called from vsync + uint8 *dst = startPalette(); + engine->getPalette(dst, 0, 64); + for (int fade = 0; fade < 64; ++fade) { + for (int c = 0; c < 768; ++c) { //original sources decrement 768 values -> 256 colors + if (dst[c]) { + --dst[c]; + } + } + engine->setPalette(dst, 0, 64); + engine->waitForVSync(); + } +} + +void DreamBase::doFade() { + if (data.byte(kFadedirection) == 0) + return; + + engine->processEvents(); + uint8 *src = startPalette() + 3 * data.byte(kColourpos); + engine->setPalette(src, data.byte(kColourpos), data.byte(kNumtofade)); + + data.byte(kColourpos) += data.byte(kNumtofade); + if (data.byte(kColourpos) == 0) + fadeCalculation(); +} + +void DreamBase::fadeCalculation() { + if (data.byte(kFadecount) == 0) { + data.byte(kFadedirection) = 0; + return; + } + + uint8 *startPal = startPalette(); + const uint8 *endPal = endPalette(); + for (size_t i = 0; i < 256 * 3; ++i) { + uint8 s = startPal[i]; + uint8 e = endPal[i]; + if (s == e) + continue; + else if (s > e) + --startPal[i]; + else { + if (data.byte(kFadecount) <= e) + ++startPal[i]; + } + } + --data.byte(kFadecount); +} + +void DreamGenContext::fadeupYellows() { + palToEndPal(); + memset(endPalette() + 231 * 3, 0, 8 * 3); + memset(endPalette() + 246 * 3, 0, 1 * 3); + data.byte(kFadedirection) = 1; + data.byte(kFadecount) = 63; + data.byte(kColourpos) = 0; + data.byte(kNumtofade) = 128; + hangOn(128); +} + +void DreamGenContext::fadeupMonFirst() { + palToStartPal(); + palToEndPal(); + memset(startPalette() + 231 * 3, 0, 8 * 3); + memset(startPalette() + 246 * 3, 0, 1 * 3); + data.byte(kFadedirection) = 1; + data.byte(kFadecount) = 63; + data.byte(kColourpos) = 0; + data.byte(kNumtofade) = 128; + hangOn(64); + playChannel1(26); + hangOn(64); +} + +void DreamBase::fadeScreenUp() { + clearStartPal(); + palToEndPal(); + data.byte(kFadedirection) = 1; + data.byte(kFadecount) = 63; + data.byte(kColourpos) = 0; + data.byte(kNumtofade) = 128; +} + +void DreamBase::fadeScreenUps() { + clearStartPal(); + palToEndPal(); + data.byte(kFadedirection) = 1; + data.byte(kFadecount) = 63; + data.byte(kColourpos) = 0; + data.byte(kNumtofade) = 64; +} + +void DreamBase::fadeScreenUpHalf() { + endPalToStart(); + palToEndPal(); + data.byte(kFadedirection) = 1; + data.byte(kFadecount) = 31; + data.byte(kColourpos) = 0; + data.byte(kNumtofade) = 32; +} + +void DreamBase::fadeScreenDown() { + palToStartPal(); + clearEndPal(); + data.byte(kFadedirection) = 1; + data.byte(kFadecount) = 63; + data.byte(kColourpos) = 0; + data.byte(kNumtofade) = 128; +} + +void DreamBase::fadeScreenDowns() { + palToStartPal(); + clearEndPal(); + data.byte(kFadedirection) = 1; + data.byte(kFadecount) = 63; + data.byte(kColourpos) = 0; + data.byte(kNumtofade) = 64; +} + +void DreamGenContext::clearPalette() { + data.byte(kFadedirection) = 0; + clearStartPal(); + dumpCurrent(); +} + +// Converts palette to grey scale, summed using formula +// .20xred + .59xGreen + .11xBlue +void DreamBase::greyscaleSum() { + byte *src = mainPalette(); + byte *dst = endPalette(); + + for (int i = 0; i < 256; ++i) { + const unsigned int r = 20 * *src++; + const unsigned int g = 59 * *src++; + const unsigned int b = 11 * *src++; + const byte grey = (r + b + g) / 100; + byte tmp; + + tmp = grey; + //if (tmp != 0) // FIXME: The assembler code has this check commented out. Bug or feature? + tmp += data.byte(kAddtored); + *dst++ = tmp; + + tmp = grey; + if (tmp != 0) + tmp += data.byte(kAddtogreen); + *dst++ = tmp; + + tmp = grey; + if (tmp != 0) + tmp += data.byte(kAddtoblue); + *dst++ = tmp; + } +} + +void DreamBase::allPalette() { + memcpy(startPalette(), mainPalette(), 3 * 256); + dumpCurrent(); +} + +void DreamBase::dumpCurrent() { + uint8 *pal = startPalette(); + + engine->waitForVSync(); + engine->processEvents(); + engine->setPalette(pal, 0, 128); + + pal += 128 * 3; + + engine->waitForVSync(); + engine->processEvents(); + engine->setPalette(pal, 128, 128); +} + +void DreamGenContext::showGroup() { + engine->processEvents(); + unsigned n = (uint16)cx; + uint8 *src = ds.ptr(si, n * 3); + engine->setPalette(src, al, n); + si += n * 3; + cx = 0; +} + +void DreamGenContext::rollEndCredits2() { + rollEm(); +} + +} // End of namespace DreamGen diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp index 53db811313..cea9dbef8c 100644 --- a/engines/dreamweb/vgagrafx.cpp +++ b/engines/dreamweb/vgagrafx.cpp @@ -21,28 +21,20 @@ */ #include "dreamweb/dreamweb.h" +#include "dreamweb/stubs.h" #include "engines/util.h" #include "graphics/surface.h" namespace DreamGen { -uint8 *DreamGenContext::workspace() { - uint8 *result = segRef(data.word(kWorkspace)).ptr(0, 0); - return result; -} - -void DreamGenContext::allocatework() { - data.word(kWorkspace) = allocatemem(0x1000); -} - -void DreamGenContext::multiget() { - multiget(ds.ptr(si, 0), di, bx, cl, ch); +void DreamGenContext::multiGet() { + multiGet(ds.ptr(si, 0), di, bx, cl, ch); si += cl * ch; di += bx * kScreenwidth + kScreenwidth * ch; cx = 0; } -void DreamGenContext::multiget(uint8 *dst, uint16 x, uint16 y, uint8 w, uint8 h) { +void DreamBase::multiGet(uint8 *dst, uint16 x, uint16 y, uint8 w, uint8 h) { assert(x < 320); assert(y < 200); const uint8 *src = workspace() + x + y * kScreenwidth; @@ -50,22 +42,22 @@ void DreamGenContext::multiget(uint8 *dst, uint16 x, uint16 y, uint8 w, uint8 h) h = 200 - y; if (x + w > 320) w = 320 - x; - //debug(1, "multiget %u,%u %ux%u -> segment: %04x->%04x", x, y, w, h, (uint16)ds, (uint16)es); - for(unsigned l = 0; l < h; ++l) { + //debug(1, "multiGet %u,%u %ux%u -> segment: %04x->%04x", x, y, w, h, (uint16)ds, (uint16)es); + for (unsigned l = 0; l < h; ++l) { const uint8 *src_p = src + kScreenwidth * l; uint8 *dst_p = dst + w * l; memcpy(dst_p, src_p, w); } } -void DreamGenContext::multiput() { - multiput(ds.ptr(si, 0), di, bx, cl, ch); +void DreamGenContext::multiPut() { + multiPut(ds.ptr(si, 0), di, bx, cl, ch); si += cl * ch; di += bx * kScreenwidth + kScreenwidth * ch; cx = 0; } -void DreamGenContext::multiput(const uint8 *src, uint16 x, uint16 y, uint8 w, uint8 h) { +void DreamBase::multiPut(const uint8 *src, uint16 x, uint16 y, uint8 w, uint8 h) { assert(x < 320); assert(y < 200); uint8 *dst = workspace() + x + y * kScreenwidth; @@ -73,43 +65,47 @@ void DreamGenContext::multiput(const uint8 *src, uint16 x, uint16 y, uint8 w, ui h = 200 - y; if (x + w > 320) w = 320 - x; - //debug(1, "multiput %ux%u -> segment: %04x->%04x", w, h, (uint16)ds, (uint16)es); - for(unsigned l = 0; l < h; ++l) { + //debug(1, "multiPut %ux%u -> segment: %04x->%04x", w, h, (uint16)ds, (uint16)es); + for (unsigned l = 0; l < h; ++l) { const uint8 *src_p = src + w * l; uint8 *dst_p = dst + kScreenwidth * l; memcpy(dst_p, src_p, w); } } -void DreamGenContext::multidump(uint16 x, uint16 y, uint8 width, uint8 height) { +void DreamGenContext::multiDump() { + multiDump(di, bx, cl, ch); + unsigned offset = di + bx * kScreenwidth; + si = di = offset + ch * kScreenwidth; + cx = 0; +} + +void DreamBase::multiDump(uint16 x, uint16 y, uint8 width, uint8 height) { unsigned offset = x + y * kScreenwidth; - //debug(1, "multidump %ux%u(segment: %04x) -> %d,%d(address: %d)", w, h, (uint16)ds, x, y, offset); + //debug(1, "multiDump %ux%u(segment: %04x) -> %d,%d(address: %d)", w, h, (uint16)ds, x, y, offset); engine->blit(workspace() + offset, kScreenwidth, x, y, width, height); } -void DreamGenContext::multidump() { - multidump(di, bx, cl, ch); - unsigned offset = di + bx * kScreenwidth; - si = di = offset + ch * kScreenwidth; - cx = 0; +void DreamBase::workToScreenCPP() { + engine->blit(workspace(), 320, 0, 0, 320, 200); } -void DreamGenContext::worktoscreen() { +void DreamGenContext::workToScreen() { + workToScreenCPP(); uint size = 320 * 200; - engine->blit(workspace(), 320, 0, 0, 320, 200); di = si = size; cx = 0; } -void DreamGenContext::printundermon() { +void DreamBase::printUnderMon() { engine->printUnderMonitor(); } -void DreamGenContext::cls() { +void DreamBase::cls() { engine->cls(); } -void DreamGenContext::frameoutnm(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y) { +void DreamBase::frameOutNm(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y) { dst += pitch * y + x; for (uint16 j = 0; j < height; ++j) { @@ -119,7 +115,7 @@ void DreamGenContext::frameoutnm(uint8 *dst, const uint8 *src, uint16 pitch, uin } } -void DreamGenContext::frameoutbh(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y) { +void DreamBase::frameOutBh(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y) { uint16 stride = pitch - width; dst += y * pitch + x; @@ -135,7 +131,7 @@ void DreamGenContext::frameoutbh(uint8 *dst, const uint8 *src, uint16 pitch, uin } } -void DreamGenContext::frameoutfx(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y) { +void DreamBase::frameOutFx(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y) { uint16 stride = pitch - width; dst += y * pitch + x; dst -= width; @@ -152,7 +148,7 @@ void DreamGenContext::frameoutfx(uint8 *dst, const uint8 *src, uint16 pitch, uin } } -void DreamGenContext::doshake() { +void DreamBase::doShake() { uint8 &counter = data.byte(kShakecounter); if (counter == 48) return; @@ -177,46 +173,21 @@ void DreamGenContext::doshake() { 0, -2, 3, -2, 0, 2, 4, -1, 1, -3, 3, 0, }; + assert(counter < ARRAYSIZE(shakeTable)); int offset = shakeTable[counter]; engine->setShakePos(offset >= 0 ? offset : -offset); } -void DreamGenContext::vsync() { - push(ax); - push(bx); - push(cx); - push(dx); - push(si); - push(di); - push(es); - push(ds); +void DreamBase::vSync() { engine->waitForVSync(); - ds = pop(); - es = pop(); - di = pop(); - si = pop(); - dx = pop(); - cx = pop(); - bx = pop(); - ax = pop(); -} - -void DreamGenContext::setmode() { - vsync(); - initGraphics(320, 200, false); } -static Common::String getFilename(Context &context) { - uint16 name_ptr = context.dx; - Common::String name; - uint8 c; - while((c = context.cs.byte(name_ptr++)) != 0) - name += (char)c; - return name; +void DreamBase::setMode() { + engine->waitForVSync(); + initGraphics(320, 200, false); } -void DreamGenContext::showpcx() { - Common::String name = getFilename(*this); +void DreamBase::showPCX(const Common::String &name) { Common::File pcxFile; if (!pcxFile.open(name)) { @@ -224,20 +195,19 @@ void DreamGenContext::showpcx() { return; } - uint8 *maingamepal; + uint8 *mainGamePal; int i, j; // Read the 16-color palette into the 'maingamepal' buffer. Note that // the color components have to be adjusted from 8 to 6 bits. pcxFile.seek(16, SEEK_SET); - es = data.word(kBuffers); - maingamepal = es.ptr(kMaingamepal, 768); - pcxFile.read(maingamepal, 48); + mainGamePal = mainPalette(); + pcxFile.read(mainGamePal, 48); - memset(maingamepal + 48, 0xff, 720); + memset(mainGamePal + 48, 0xff, 720); for (i = 0; i < 48; i++) { - maingamepal[i] >>= 2; + mainGamePal[i] >>= 2; } // Decode the image data. @@ -285,31 +255,31 @@ void DreamGenContext::showpcx() { pcxFile.close(); } -void DreamGenContext::frameoutv(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, int16 x, int16 y) { +void DreamBase::frameOutV(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, int16 x, int16 y) { // NB : These resilience checks were not in the original engine, but did they result in undefined behaviour // or was something broken during porting to C++? assert(pitch == 320); - if(x < 0) { + if (x < 0) { assert(width >= -x); width -= -x; src += -x; x = 0; } - if(y < 0) { + if (y < 0) { assert(height >= -y); height -= -y; src += (-y) * width; y = 0; } - if(x >= 320) + if (x >= 320) return; - if(y >= 200) + if (y >= 200) return; - if(x + width > 320) { + if (x + width > 320) { width = 320 - x; } - if(y + height > 200) { + if (y + height > 200) { height = 200 - y; } @@ -327,12 +297,12 @@ void DreamGenContext::frameoutv(uint8 *dst, const uint8 *src, uint16 pitch, uint } } -void DreamGenContext::showframe(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag) { +void DreamBase::showFrame(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag) { uint8 width, height; - showframe(frameData, x, y, frameNumber, effectsFlag, &width, &height); + showFrame(frameData, x, y, frameNumber, effectsFlag, &width, &height); } -void DreamGenContext::showframe(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height) { +void DreamBase::showFrame(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height) { const Frame *frame = frameData + frameNumber; if ((frame->width == 0) && (frame->height == 0)) { *width = 0; @@ -340,12 +310,12 @@ void DreamGenContext::showframe(const Frame *frameData, uint16 x, uint16 y, uint return; } -//notblankshow: +//notBlankShow: if ((effectsFlag & 128) == 0) { x += frame->x; y += frame->y; } -//skipoffsets: +//skipOffsets: *width = frame->width; *height = frame->height; @@ -356,45 +326,48 @@ void DreamGenContext::showframe(const Frame *frameData, uint16 x, uint16 y, uint x -= *width / 2; y -= *height / 2; } - if (effectsFlag & 64) { //diffdest - frameoutfx(es.ptr(0, dx * *height), pSrc, dx, *width, *height, x, y); + if (effectsFlag & 64) { //diffDest + error("Unsupported DreamBase::showFrame effectsFlag %d", effectsFlag); + /* + frameOutFx(es.ptr(0, dx * *height), pSrc, dx, *width, *height, x, y); return; + */ } - if (effectsFlag & 8) { //printlist + if (effectsFlag & 8) { //printList /* push(ax); al = x - data.word(kMapadx); ah = y - data.word(kMapady); - //addtoprintlist(); // NB: Commented in the original asm + //addToPrintList(); // NB: Commented in the original asm ax = pop(); */ } - if (effectsFlag & 4) { //flippedx - frameoutfx(workspace(), pSrc, 320, *width, *height, x, y); + if (effectsFlag & 4) { //flippedX + frameOutFx(workspace(), pSrc, 320, *width, *height, x, y); return; } - if (effectsFlag & 2) { //nomask - frameoutnm(workspace(), pSrc, 320, *width, *height, x, y); + if (effectsFlag & 2) { //noMask + frameOutNm(workspace(), pSrc, 320, *width, *height, x, y); return; } if (effectsFlag & 32) { - frameoutbh(workspace(), pSrc, 320, *width, *height, x, y); + frameOutBh(workspace(), pSrc, 320, *width, *height, x, y); return; } } -//noeffects: - frameoutv(workspace(), pSrc, 320, *width, *height, x, y); +//noEffects: + frameOutV(workspace(), pSrc, 320, *width, *height, x, y); return; } -void DreamGenContext::showframe() { +void DreamGenContext::showFrame() { uint8 width, height; - showframe((Frame *)ds.ptr(0, 0), di, bx, ax & 0x1ff, ah & 0xfe, &width, &height); + showFrame((Frame *)ds.ptr(0, 0), di, bx, ax & 0x1ff, ah & 0xfe, &width, &height); cl = width; ch = height; } -void DreamGenContext::clearwork() { +void DreamBase::clearWork() { memset(workspace(), 0, 320*200); } @@ -404,15 +377,15 @@ void DreamGenContext::zoom() { if (data.byte(kZoomon) != 1) return; if (data.byte(kCommandtype) >= 199) { - putunderzoom(); + putUnderZoom(); return; } uint16 srcOffset = (data.word(kOldpointery) - 9) * 320 + (data.word(kOldpointerx) - 11); uint16 dstOffset = (kZoomy + 4) * 320 + (kZoomx + 5); const uint8 *src = workspace() + srcOffset; uint8 *dst = workspace() + dstOffset; - for(size_t i=0; i<20; ++i) { - for(size_t j=0; j<23; ++j) { + for (size_t i = 0; i < 20; ++i) { + for (size_t j = 0; j < 23; ++j) { uint8 v = src[j]; dst[2*j+0] = v; dst[2*j+1] = v; @@ -426,43 +399,85 @@ void DreamGenContext::zoom() { data.byte(kDidzoom) = 1; } -void DreamGenContext::paneltomap() { - multiget(segRef(data.word(kMapstore)).ptr(0, 0), data.word(kMapxstart) + data.word(kMapadx), data.word(kMapystart) + data.word(kMapady), data.byte(kMapxsize), data.byte(kMapysize)); +uint8 *DreamBase::mapStore() { + return getSegment(data.word(kMapstore)).ptr(0, 0); +} + +void DreamBase::panelToMap() { + multiGet(mapStore(), data.word(kMapxstart) + data.word(kMapadx), data.word(kMapystart) + data.word(kMapady), data.byte(kMapxsize), data.byte(kMapysize)); } -void DreamGenContext::maptopanel() { - multiput(segRef(data.word(kMapstore)).ptr(0, 0), data.word(kMapxstart) + data.word(kMapadx), data.word(kMapystart) + data.word(kMapady), data.byte(kMapxsize), data.byte(kMapysize)); +void DreamBase::mapToPanel() { + multiPut(mapStore(), data.word(kMapxstart) + data.word(kMapadx), data.word(kMapystart) + data.word(kMapady), data.byte(kMapxsize), data.byte(kMapysize)); } -void DreamGenContext::dumpmap() { - multidump(data.word(kMapxstart) + data.word(kMapadx), data.word(kMapystart) + data.word(kMapady), data.byte(kMapxsize), data.byte(kMapysize)); +void DreamBase::dumpMap() { + multiDump(data.word(kMapxstart) + data.word(kMapadx), data.word(kMapystart) + data.word(kMapady), data.byte(kMapxsize), data.byte(kMapysize)); } -void DreamGenContext::transferinv() { - const Frame *freeFrames = (const Frame *)segRef(data.word(kFreeframes)).ptr(kFrframedata, 0); +void DreamBase::transferInv() { + const Frame *freeFrames = (const Frame *)getSegment(data.word(kFreeframes)).ptr(kFrframedata, 0); const Frame *freeFrame = freeFrames + (3 * data.byte(kItemtotran) + 1); - Frame *exFrames = (Frame *)segRef(data.word(kExtras)).ptr(kExframedata, 0); + Frame *exFrames = (Frame *)getSegment(data.word(kExtras)).ptr(kExframedata, 0); Frame *exFrame = exFrames + (3 * data.byte(kExpos) + 1); exFrame->width = freeFrame->width; exFrame->height = freeFrame->height; exFrame->x = freeFrame->x; exFrame->y = freeFrame->y; uint16 byteCount = freeFrame->width * freeFrame->height; - const uint8 *src = segRef(data.word(kFreeframes)).ptr(kFrframes + freeFrame->ptr(), byteCount); - uint8 *dst = segRef(data.word(kExtras)).ptr(kExframes + data.word(kExframepos), byteCount); + const uint8 *src = getSegment(data.word(kFreeframes)).ptr(kFrframes + freeFrame->ptr(), byteCount); + uint8 *dst = getSegment(data.word(kExtras)).ptr(kExframes + data.word(kExframepos), byteCount); memcpy(dst, src, byteCount); exFrame->setPtr(data.word(kExframepos)); data.word(kExframepos) += byteCount; } -bool DreamGenContext::pixelcheckset(const ObjPos *pos, uint8 x, uint8 y) { +bool DreamGenContext::pixelCheckSet(const ObjPos *pos, uint8 x, uint8 y) { x -= pos->xMin; y -= pos->yMin; - SetObject *setObject = getsetad(pos->index); - Frame *frame = (Frame *)segRef(data.word(kSetframes)).ptr(kFramedata, 0) + setObject->index; - const uint8 *ptr = segRef(data.word(kSetframes)).ptr(kFrames, 0) + frame->ptr() + y * frame->width + x; + SetObject *setObject = getSetAd(pos->index); + Frame *frame = (Frame *)getSegment(data.word(kSetframes)).ptr(kFramedata, 0) + setObject->index; + const uint8 *ptr = getSegment(data.word(kSetframes)).ptr(kFrames, 0) + frame->ptr() + y * frame->width + x; return *ptr != 0; } -} /*namespace dreamgen */ +void DreamBase::loadPalFromIFF() { + Common::File palFile; + palFile.open("DREAMWEB.PAL"); + palFile.read(mapStore(), 2000); + palFile.close(); + + const uint8 *src = mapStore() + 0x30; + uint8 *dst = mainPalette(); + for (size_t i = 0; i < 256*3; ++i) { + uint8 c = src[i] / 4; + if (data.byte(kBrightness) == 1) { + if (c) { + c = c + c / 2 + c / 4; + if (c > 63) + c = 63; + } + } + dst[i] = c; + } +} + +void DreamBase::createPanel() { + showFrame(engine->icons2(), 0, 8, 0, 2); + showFrame(engine->icons2(), 160, 8, 0, 2); + showFrame(engine->icons2(), 0, 104, 0, 2); + showFrame(engine->icons2(), 160, 104, 0, 2); +} + +void DreamBase::createPanel2() { + createPanel(); + showFrame(engine->icons2(), 0, 0, 5, 2); + showFrame(engine->icons2(), 160, 0, 5, 2); +} + +void DreamBase::showPanel() { + showFrame(engine->icons1(), 72, 0, 19, 0); + showFrame(engine->icons1(), 192, 0, 19, 0); +} +} // End of namespace DreamGen |