diff options
-rwxr-xr-x | devtools/tasmrecover/tasm-recover | 1 | ||||
-rw-r--r-- | engines/dreamweb/dreambase.h | 4 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 2 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 5 | ||||
-rw-r--r-- | engines/dreamweb/dreamweb.cpp | 5 | ||||
-rw-r--r-- | engines/dreamweb/keypad.cpp | 2 | ||||
-rw-r--r-- | engines/dreamweb/monitor.cpp | 4 | ||||
-rw-r--r-- | engines/dreamweb/newplace.cpp | 4 | ||||
-rw-r--r-- | engines/dreamweb/object.cpp | 2 | ||||
-rw-r--r-- | engines/dreamweb/print.cpp | 2 | ||||
-rw-r--r-- | engines/dreamweb/saveload.cpp | 10 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 31 | ||||
-rw-r--r-- | engines/dreamweb/talk.cpp | 4 | ||||
-rw-r--r-- | engines/dreamweb/use.cpp | 4 |
14 files changed, 38 insertions, 42 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index f18f4af3a5..c4292f92f3 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -59,6 +59,7 @@ p = parser(skip_binary_data = [ 'id', 'place', 'blinktab', + 'quitrequested', # keypad.asm 'keypadlist', 'symbollist', diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h index fb06309f15..6c09d41f1c 100644 --- a/engines/dreamweb/dreambase.h +++ b/engines/dreamweb/dreambase.h @@ -114,7 +114,8 @@ protected: public: DreamBase(DreamWeb::DreamWebEngine *en); -public: + bool _quitRequested; + // from backdrop.cpp void doBlocks(); uint8 getXAd(const uint8 *setData, uint8 *result); @@ -446,7 +447,6 @@ public: void readMouse(); uint16 readMouseState(); void hangOn(uint16 frameCount); - bool quitRequested(); void lockMon(); uint8 *textUnder(); void readKey(); diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 37ef12efa8..ce871c4b71 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -75,7 +75,7 @@ void DreamGenContext::__start() { //0x0150: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0160: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, }; + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, }; ds.assign(src, src + sizeof(src)); dreamweb(); } diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 28a40187f7..66c6aef806 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -307,9 +307,8 @@ static const uint16 kCh1playing = 374; static const uint16 kCh1blockstocopy = 375; static const uint16 kCurrentsample = 377; static const uint16 kRoomssample = 378; -static const uint16 kQuitrequested = 379; -static const uint16 kSubtitles = 380; -static const uint16 kForeignrelease = 381; +static const uint16 kSubtitles = 379; +static const uint16 kForeignrelease = 380; static const uint16 kBlocktextdat = (0); static const uint16 kPersonframes = (0); static const uint16 kDebuglevel1 = (0); diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 997f36438e..f1d5c5415c 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -102,7 +102,7 @@ void DreamWebEngine::waitForVSync() { } void DreamWebEngine::quit() { - _base.data.byte(DreamGen::kQuitrequested) = 1; + _base._quitRequested = true; _base.data.byte(DreamGen::kLasthardkey) = 1; } @@ -213,7 +213,7 @@ Common::Error DreamWebEngine::run() { _timer->installTimerProc(vSyncInterrupt, 1000000 / 70, this, "dreamwebVSync"); _context.__start(); - _base.data.byte(DreamGen::kQuitrequested) = 0; + _base._quitRequested = false; _timer->removeTimerProc(vSyncInterrupt); @@ -417,6 +417,7 @@ namespace DreamGen { // FIXME/TODO: Move this to a better place. DreamBase::DreamBase(DreamWeb::DreamWebEngine *en) : engine(en) { _openChangeSize = kInventx+(4*kItempicsize); + _quitRequested = false; } } // End of namespace DreamGen diff --git a/engines/dreamweb/keypad.cpp b/engines/dreamweb/keypad.cpp index b165c00394..c3db72f282 100644 --- a/engines/dreamweb/keypad.cpp +++ b/engines/dreamweb/keypad.cpp @@ -139,7 +139,7 @@ void DreamBase::enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3 dumpKeypad(); dumpTextLine(); checkCoords(keypadList); - if (quitRequested() || (data.byte(kGetback) == 1)) + if (_quitRequested || (data.byte(kGetback) == 1)) break; if (data.byte(kLightcount) == 1) { if (data.byte(kLockstatus) == 0) diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp index eb6d876ca4..69a46d725f 100644 --- a/engines/dreamweb/monitor.cpp +++ b/engines/dreamweb/monitor.cpp @@ -86,7 +86,7 @@ void DreamBase::useMon() { data.word(kMonadx) = oldMonadx; data.word(kMonady) = oldMonady; stop = execCommand(); - if (quitRequested()) //TODO : Check why it crashes when put before the execcommand + if (_quitRequested) //TODO : Check why it crashes when put before the execcommand break; } while (!stop); getRidOfTemp(); @@ -203,7 +203,7 @@ void DreamBase::input() { vSync(); delCurs(); readKey(); - if (quitRequested()) + if (_quitRequested) return; uint8 currentKey = data.byte(kCurrentkey); if (currentKey == 0) diff --git a/engines/dreamweb/newplace.cpp b/engines/dreamweb/newplace.cpp index efcffef82a..3c50eb7b12 100644 --- a/engines/dreamweb/newplace.cpp +++ b/engines/dreamweb/newplace.cpp @@ -59,7 +59,7 @@ void DreamBase::selectLocation() { data.byte(kNewlocation) = 255; while (data.byte(kNewlocation) == 255) { - if (quitRequested()) + if (_quitRequested) break; delPointer(); @@ -84,7 +84,7 @@ void DreamBase::selectLocation() { checkCoords(destList); } - if (quitRequested() || data.byte(kGetback) == 1 || data.byte(kNewlocation) == data.byte(kLocation)) { + if (_quitRequested || data.byte(kGetback) == 1 || data.byte(kNewlocation) == data.byte(kLocation)) { data.byte(kNewlocation) = data.byte(kReallocation); data.byte(kGetback) = 0; } diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp index 8152394de0..cb105c7798 100644 --- a/engines/dreamweb/object.cpp +++ b/engines/dreamweb/object.cpp @@ -195,7 +195,7 @@ void DreamBase::examineOb(bool examineAgain) { } } - if (data.byte(kQuitrequested) != 0) + if (_quitRequested) break; if (data.byte(kExamagain) != 0) examineAgain = true; diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp index 7edf44443f..7bd090d3ee 100644 --- a/engines/dreamweb/print.cpp +++ b/engines/dreamweb/print.cpp @@ -103,7 +103,7 @@ uint8 DreamBase::printSlow(const uint8 *string, uint16 x, uint16 y, uint8 maxWid data.word(kCharshift) = 0; for (int i=0; i<2; ++i) { uint16 mouseState = waitFrames(); - if (data.byte(kQuitrequested)) + if (_quitRequested) return 0; if (mouseState == 0) continue; diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp index c879afe034..525c48e4d4 100644 --- a/engines/dreamweb/saveload.cpp +++ b/engines/dreamweb/saveload.cpp @@ -72,7 +72,7 @@ void DreamBase::doLoad(int savegameId) { data.byte(kGetback) = 0; while (data.byte(kGetback) == 0) { - if (quitRequested()) + if (_quitRequested) return; delPointer(); readMouse(); @@ -166,7 +166,7 @@ void DreamBase::saveGame() { data.byte(kGetback) = 0; while (data.byte(kGetback) == 0) { - if (quitRequested()) + if (_quitRequested) return; delPointer(); checkInput(); @@ -288,7 +288,7 @@ void DreamBase::doSaveLoad() { data.byte(kGetback) = 0; do { // wait ops - if (data.byte(kQuitrequested)) { + if (_quitRequested) { data.byte(kManisoffscreen) = 0; return; } @@ -376,7 +376,7 @@ void DreamBase::discOps() { }; do { - if (data.byte(kQuitrequested) != 0) + if (_quitRequested) return; // quitdiscops delPointer(); @@ -637,7 +637,7 @@ void DreamBase::loadOld() { doLoad(-1); - if (data.byte(kGetback) == 4 || quitRequested()) + if (data.byte(kGetback) == 4 || _quitRequested) return; showDecisions(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index ebc2580158..1ef1e5e588 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -527,7 +527,7 @@ void DreamBase::dreamweb() { cls(); setMode(); decide(); - if (quitRequested()) + if (_quitRequested) goto done; if (data.byte(kGetback) == 4) @@ -544,17 +544,17 @@ void DreamBase::dreamweb() { // TODO: In the demo version, titles() did nothing clearPalette(); bibleQuote(); - if (!quitRequested()) // "titlesearly" + if (!_quitRequested) // "titlesearly" intro(); - if (quitRequested()) + if (_quitRequested) goto done; // "credits" clearPalette(); realCredits(); - if (quitRequested()) + if (_quitRequested) goto done; clearChanges(); @@ -581,13 +581,12 @@ void DreamBase::dreamweb() { // main loop while (true) { - - if (quitRequested()) + if (_quitRequested) goto done; screenUpdate(); - if (quitRequested()) + if (_quitRequested) goto done; if (data.byte(kWongame) != 0) { @@ -645,14 +644,10 @@ done: // The engine will need some cleaner finalization, let's put it here for n engine->freeIcons2(); } -bool DreamBase::quitRequested() { - return data.byte(kQuitrequested); -} - void DreamBase::screenUpdate() { newPlace(); mainScreen(); - if (quitRequested()) + if (_quitRequested) return; animPointer(); @@ -1742,7 +1737,7 @@ void DreamBase::hangOn(uint16 frameCount) { while (frameCount) { vSync(); --frameCount; - if (quitRequested()) + if (_quitRequested) break; } } @@ -1756,7 +1751,7 @@ void DreamBase::hangOnW(uint16 frameCount) { vSync(); dumpPointer(); --frameCount; - if (quitRequested()) + if (_quitRequested) break; } } @@ -1782,7 +1777,7 @@ void DreamBase::hangOnP(uint16 count) { showPointer(); vSync(); dumpPointer(); - if (quitRequested()) + if (_quitRequested) break; if (data.word(kMousebutton) != 0 && data.word(kMousebutton) != data.word(kOldbutton)) break; @@ -1837,7 +1832,7 @@ void DreamBase::enterSymbol() { { 0xFFFF,0,0,0,0 } }; checkCoords(symbolList); - } while ((data.byte(kGetback) == 0) && !quitRequested()); + } while ((data.byte(kGetback) == 0) && !_quitRequested); if ((data.byte(kSymbolbotnum) == 3) && (data.byte(kSymboltopnum) == 5)) { removeSetObject(43); placeSetObject(46); @@ -2529,7 +2524,7 @@ void DreamBase::useMenu() { { 0xFFFF,0,0,0,0 } }; checkCoords(menuList); - } while ((data.byte(kGetback) != 1) && !quitRequested()); + } while ((data.byte(kGetback) != 1) && !_quitRequested); data.byte(kManisoffscreen) = 0; redrawMainScrn(); getRidOfTemp(); @@ -3125,7 +3120,7 @@ void DreamBase::decide() { }; do { - if (data.byte(kQuitrequested) != 0) + if (_quitRequested) return; readMouse(); diff --git a/engines/dreamweb/talk.cpp b/engines/dreamweb/talk.cpp index aacd2d2980..74357f395f 100644 --- a/engines/dreamweb/talk.cpp +++ b/engines/dreamweb/talk.cpp @@ -57,7 +57,7 @@ void DreamBase::talk() { dumpTextLine(); data.byte(kGetback) = 0; checkCoords(talkList); - if (data.byte(kQuitrequested)) + if (_quitRequested) break; } while (!data.byte(kGetback)); @@ -216,7 +216,7 @@ bool DreamBase::hangOnPQ() { dumpTextLine(); checkCoords(quitList); - if (data.byte(kGetback) == 1 || data.byte(kQuitrequested)) { + if (data.byte(kGetback) == 1 || _quitRequested) { // Quit conversation delPointer(); data.byte(kPointermode) = 0; diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index dc76cf30fd..a7d80b8a03 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -199,7 +199,7 @@ void DreamBase::viewFolder() { workToScreenM(); data.byte(kGetback) = 0; do { - if (quitRequested()) + if (_quitRequested) break; delPointer(); readMouse(); @@ -1288,7 +1288,7 @@ void DreamBase::useDiary() { dumpDiaryKeys(); dumpTextLine(); checkCoords(diaryList); - } while (!data.byte(kGetback) && !quitRequested()); + } while (!data.byte(kGetback) && !_quitRequested); getRidOfTemp(); |